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 


Recalculating addresses using Lua

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

Joined: 28 Jan 2018
Posts: 41

PostPosted: Sat Feb 01, 2020 2:11 am    Post subject: Recalculating addresses using Lua Reply with quote

Using Lua and AOB Scans, I've been finding addresses and writing them to clipboard in order to paste them when I recalculate addresses for different groups.

I was wondering if Lua could automatically recalculate addresses? Ex: Instead of setting MyData1's address, could Lua do the equivalent of right clicking and recalculating it?

i have 6 groups of addresses for which I've made 6 lua scripts to find the address using an AOB scan, and write it to the clipboard. Ive been doing the recalculation part using an AHK script to click around my screen and paste it.

Lua:
Code:
one=AOBScan("00 00 29 C3 00 00 BE 42 00 00 B3 42 00 00 29 C3 00 00 BE C2 00 00 9C 42 00 00 29 C3 00 00 BE 42 00 00 9C 42 00 00 29 C3 00")
print (one[0])
writeToClipboard(one[0])


AHK:
Code:
#F1::
Send {RButton}
sleep 100
SendInput r
WinWait Recalculate addres
sleep 200
MouseClick, left,  160,  40
Send, ^a
sleep 10
Send, ^v
sleep 30
Send {Enter}
sleep 100
WinWait Lua Engine
sleep 200
MouseMove, 0, 0
return
Back to top
View user's profile Send private message
mg_01
Cheater
Reputation: 0

Joined: 28 Jan 2018
Posts: 41

PostPosted: Sun Feb 02, 2020 6:15 am    Post subject: Reply with quote

Sorry, I might need to make a different topic for this but I didnt want to post too much.

I had another question slightly related to what I was trying to do. I've been working on creating camera movements using LUA and I wanted to use write and read Float commands with data-descriptions instead of the hard addresses since I have to recalculate them every new game.

For example:
Code:
y1 = readFloat("050EBFF0");
z1 = readFloat("050EBFF4");
function getData()
         y1 = readFloat("050EBFF0")
         z1 = readFloat("050EBFF4")
         end
if (y1 ~= 95 and z1 ~= 812.3571777) then
   while (y1 ~= 95 and z1 ~= 812.3571777) do
   getData()
   writeFloat("050EBFF0", y1 - .002)
   writeFloat("050EBFF4", z1 - .002)
   end
   end
writeFloat("050EBFF0",95)
writeFloat("050EBFF4",812.3571777)


I couldn't figure out how to use getMembyDes with read/writeFloat commands.

Thank you
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