View previous topic :: View next topic |
Author |
Message |
mg_01 Cheater Reputation: 0
Joined: 28 Jan 2018 Posts: 41
|
Posted: Thu Nov 01, 2018 7:54 pm Post subject: Lua Script to update values every frame? |
|
|
Hello,
I was wondering if it were possible to use Lua to change an address' value every frame. I wanted to use it for a camera in a game.
I have all the values and addresses already, I was just hoping to create manual camera movements using if/else statements in Lua that ran on a timer to change the value every frame.
Something like:
Code: |
addresslist=getAddressList()
function test()
yv = addresslist.getMemoryRecordByDescription("P1_A_Y_Pos").getValue()
if (yv < 1) then
while (yv < 1) do
yv = addresslist.getMemoryRecordByDescription("P1_A_Y_Pos").getValue()
addresslist.getMemoryRecordByDescription("P1_A_Y_Pos").setValue(1)
end
end
end
|
|
|
Back to top |
|
|
mg_01 Cheater Reputation: 0
Joined: 28 Jan 2018 Posts: 41
|
Posted: Fri Nov 02, 2018 5:02 pm Post subject: |
|
|
After more digging, Im still not sure how to do it but from what I can tell, it's possible to use writeFloat or setValue. I'm just not sure how to write the syntax for the address I have.
Code: | {$lua}
[Enable]
function jump()
yval = readFloat("057930E8")
if (yval < 1) then
writeFloat("057930E8",yval + 10)
end
end
[Disable]
|
I'm not sure on the syntax and conversions between Lua and AA. I'm not sure if this thing can be written in Lua as a script to execute. Any help is appreciated.
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Fri Nov 02, 2018 8:43 pm Post subject: |
|
|
You can use the memory record's value and tonumber to convert the string to a number, a bit more more flexible than lua especially if you already have it all set. Can't really say how to convert the address to lua parsable one without know what it is but in general to read a pointer just add []s around it. eg "[[game.exe+0xBACE]+30]"
The "problem" is that lua doesn't really have any concept of a "frame" in your game, though you can use a timer and run it every 16.67 milliseconds etc.
_________________
|
|
Back to top |
|
|
|