Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


problem in enabling the script

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
sgsgwv$6263
Advanced Cheater
Reputation: 0

Joined: 05 Aug 2020
Posts: 84

PostPosted: Mon Oct 05, 2020 1:48 am    Post subject: problem in enabling the script Reply with quote

I wrote a script ,it doesnot have any syntactical mistake because I was able to add the script to the cheat table but the script wont enable in the cheat table.
i just want to know what error is causing ths to happen.

Here it is
Code:

{$lua}

if syntaxcheck then return end

[ENABLE]

local one=1
local two=1
local three=1
list=getAddressList()
registerSymbol("one",getAddress(one))
registerSymbol("two",getAddress(two))
registerSymbol("three",getAddress(three))

if list.getMemoryRecordByDescription("X Vector").Address~=list.getMemoryRecordByDescription("two").Address and list.getMemoryRecordByDescription("X Vector").Address~=list.getMemoryRecordByDescription("three").Address then
list.getMemoryRecordByDescription("one").Address=list.getMemoryRecordByDescription("X Vector").Address
end
if list.getMemoryRecordByDescription("X Vector").Address~=list.getMemoryRecordByDescription("one").Address and list.getMemoryRecordByDescription("X Vector").Address~=list.getMemoryRecordByDescription("three").Address then
list.getMemoryRecordByDescription("two").Address=list.getMemoryRecordByDescription("X Vector").Address
end
if list.getMemoryRecordByDescription("X Vector").Address~=list.getMemoryRecordByDescription("one").Address and list.getMemoryRecordByDescription("X Vector").Address~=list.getMemoryRecordByDescription("two").Address then
list.getMemoryRecordByDescription("three").Address=list.getMemoryRecordByDescription("X Vector").Address
end



[DISABLE]
unregisterSymbol("one")
unregisterSymbol("two")
unregisterSymbol("three")




Edit:

Actually my purpose is to get 3 addresses accessed by an instruction and store them in one,two and three locations.

There is another script that gives the "X Vector" (description name of the memory record in the cheat table) an address(by code injection) but because the instruction is a shared opcode the address of the "X vector " memory record keeps on changing.The problem is that the "what address this instruction acceses" functionality doesnot work in page exception BP(because this game has trust issues and constantly checks if there is a debugger or not).

Now suppose 5 addresses are accessed by my instruction (in which one of the instruction is my characters address in the game and the rest are pedestrian addresses),I want to find two ped addresses and my character addresses to be stored in "one","two" and "three" memory locations(these 3 memory locations are mentioned in my above script as you can notice),just to do a "compare data structures" operation and find that offset or location that seperates my character from the ped characters.

Now if there is a better solution to access all the addresses accesed by the an instruction without using the "what addreses are accessed by this instruction" functionality then please tell me.


Last edited by sgsgwv$6263 on Mon Oct 05, 2020 4:46 am; edited 2 times in total
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Mon Oct 05, 2020 3:45 am    Post subject: Reply with quote

It seems like:

local one=1
local two=1
local three=1

then, one = two = three. So, one, two, three always equals.
and did the address list need to be activated?

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
sgsgwv$6263
Advanced Cheater
Reputation: 0

Joined: 05 Aug 2020
Posts: 84

PostPosted: Mon Oct 05, 2020 4:35 am    Post subject: Reply with quote

Im pretty sure that
local one=1
local two=1
local three=1
should not cause any problems because in the if conditions Im checking thier addresses not their values although I know thats bad practice.
I dont understand what you mean by "address list need to be activated".

Actually my purpose is to get 3 addresses accessed by an instruction and store them in one,two and three locations.

There is another script that gives the "X Vector" (description name of the memory record in the cheat table) an address(by code injection) but because the instruction is a shared opcode the address of the "X vector " memory record keeps on changing.The problem is that the "what address this instruction acceses" functionality doesnot work in page exception BP(because this game has trust issues and constantly checks if there is a debugger or not).

Now suppose 5 addresses are accessed by my instruction (in which one of the address is my characters address in the game and the rest are pedestrian addresses),I want to find two ped addresses and my character addresses to be stored in "one","two" and "three" memory locations(these 3 memory locations are mentioned in my above script as you can notice),just to do a "compare data structures" operation and find that offset or location that seperates my character from the ped characters.

Now if there is a better solution to access all the addresses accesed by the an instruction without using the "what addreses are accessed by this instruction" functionality then please tell me.
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Mon Oct 05, 2020 6:38 am    Post subject: This post has 2 review(s) Reply with quote

I am not familiar with write Lua script under AA script, but I wrote a Lua script to simulating what is happen with your script, with assumption one, two, three and Vector X has different addresses.

Code:
local X_Vector = {Desc = "X Vector", Address = "London"}
local one = {desc = "one", Address = "Seoul"}
local two = {desc = "two", Address = "Paris"}
local three = {desc = "three", Address = "Rome"}


if X_Vector.Address ~= two.Address and
   X_Vector.Address ~= three.Address then
   one.Address = X_Vector.Address
   print(one.Address)
end

if X_Vector.Address ~= one.Address and
   X_Vector.Address ~= three.Address then
   two.Address = X_Vector.Address
   print(two.Address)
end

if X_Vector.Address ~= one.Address and
   X_Vector.Address ~= two.Address then
   three.Address = X_Vector.Address
   print(two.Address)
end

-- execute will give result as 'London'.


Conclusion:
The script is work, check the first 'if' argument and then break because the first 'if' argument already reach and done.

And I meant with 'Activating' is : to activating the hacks on cheat table (if any)

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
sgsgwv$6263
Advanced Cheater
Reputation: 0

Joined: 05 Aug 2020
Posts: 84

PostPosted: Mon Oct 05, 2020 7:18 am    Post subject: Reply with quote

Oh yes that makes sense.Thank you.
But where are the addresses supposed to get printed?
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Mon Oct 05, 2020 8:35 am    Post subject: Reply with quote

Not sure, but to print address list items:

Code:
local list = getAddressList()

for i = 0, list.Count-1 do
 memrec = list[i]
 theDesc= memrec.Description
 theAddress = memrec.Address
 theValue= memrec.Value
 print(theDesc, theAddress, theValue)
end

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites