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 


readInteger / WriteInteger

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

Joined: 05 Jun 2014
Posts: 86

PostPosted: Tue Jun 28, 2016 12:28 pm    Post subject: readInteger / WriteInteger Reply with quote

Hello, i want to make like this thread
http://forum.cheatengine.org/viewtopic.php?t=579440

my result


function CEButtonReadClick(sender)
setProperty(Goliath.PositionX,"Text", readInteger[[[[["Goliath.exe"+00BC61D4]+744]+475c]+10]+2c4]+54))
setProperty(Goliath.PositionY,"Text", readInteger[[[[["Goliath.exe"+00BC61D4]+744]+475c]+10]+2c4]+5c))
end

but i have unfinished long string (stating at line 2) near <oef>


Last edited by mausi125 on Wed Jun 29, 2016 1:49 am; edited 1 time in total
Back to top
View user's profile Send private message
Der5t
Newbie cheater
Reputation: 0

Joined: 10 Mar 2014
Posts: 14

PostPosted: Tue Jun 28, 2016 4:59 pm    Post subject: Reply with quote

Try this-

Code:
function CEButtonReadClick(sender)
setProperty(Goliath.PositionX,"Text", readInteger('[[[[["Goliath.exe"+00BC61D4]+744]475c]+10]+2c4]+54'))
setProperty(Goliath.PositionY,"Text", readInteger('[[[[["Goliath.exe"+00BC61D4]+744]475c]+10]+2c4]+5c'))
end


It should be like - readInteger(address)
Ex-
Code:
readInteger('[[[[[BasePointer]+Offset1]+Offset2]+Offset3]+Offset4]+Offset5')
Back to top
View user's profile Send private message
mausi125
Advanced Cheater
Reputation: 1

Joined: 05 Jun 2014
Posts: 86

PostPosted: Wed Jun 29, 2016 2:03 am    Post subject: Reply with quote

Der5t wrote:
Try this-

Code:
function CEButtonReadClick(sender)
setProperty(Goliath.PositionX,"Text", readInteger('[[[[["Goliath.exe"+00BC61D4]+744]475c]+10]+2c4]+54'))
setProperty(Goliath.PositionY,"Text", readInteger('[[[[["Goliath.exe"+00BC61D4]+744]475c]+10]+2c4]+5c'))
end


It should be like - readInteger(address)
Ex-
Code:
readInteger('[[[[[BasePointer]+Offset1]+Offset2]+Offset3]+Offset4]+Offset5')


Thanks alot dude Embarassed

Last Queestion ( with script parkourpenguin )

function CEButtonReadClick(sender)
setProperty(UDF1.CEEditX,"Text", readFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+58'))
setProperty(UDF1.CEEditY,"Text", readFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+5c'))
end

local lastCoords = {0, 0, 0}

function saveButtonClicked(sender)
lastCoords[1] = readFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+58')
lastCoords[2] = readFloat(address)
lastCoords[3] = readFloat(address)
end

function loadButtonClicked(sender)
writeFloat(('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+58'), lastCoords[1])
writeFloat(address, lastCoords[2])
writeFloat(address, lastCoords[3])
end

For Save and Load position, First address save X but i need Save X Y Z position, add 3 address ?
Back to top
View user's profile Send private message
Der5t
Newbie cheater
Reputation: 0

Joined: 10 Mar 2014
Posts: 14

PostPosted: Wed Jun 29, 2016 3:29 am    Post subject: Reply with quote

Try using this -

Code:

local lastCoords = {0, 0, 0}

function saveButtonClicked(sender)
lastCoords[1] = readFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+58')
lastCoords[2] = readFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+5C')
lastCoords[3] = readFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+60')
end

function loadButtonClicked(sender)
writeFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+58', lastCoords[1])
writeFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+5C', lastCoords[2])
writeFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+60', lastCoords[3])
end


I suppose this should work.If [[[[["Goliath.exe"+00BC61D4]+744]..]..]..]+58 is your X axis, then your Y axis should be 4 bytes away {58(hex) + 4(hex) = 5C(hex)}.That gives our Y Axis address as [[[[["Goliath.exe"+00BC61D4]+744]..]..]..]+5C.
Similarly, the Z Axis should be 4 bytes away from the Y Axis address.Since {5C(hex) + 4(hex) = 60(hex)}, we get the Z address as [[[[["Goliath.exe"+00BC61D4]+744]..]..]..]+60.

So that should work as your save/load location. Very Happy

Extra: You may want to show your Z Axis as well on your form.
Create a label with name 'CEEditZ' and add this line to your CEButtonReadClick() function-


Code:
setProperty(UDF1.CEEditZ,"Text", readFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+60'))


Make sure you add the above statement BEFORE 'end'.
Finally it should look like -

Code:
function CEButtonReadClick(sender)
setProperty(UDF1.CEEditX,"Text", readFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+58'))
setProperty(UDF1.CEEditY,"Text", readFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+5c'))
setProperty(UDF1.CEEditZ,"Text", readFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+60'))
end
Back to top
View user's profile Send private message
mausi125
Advanced Cheater
Reputation: 1

Joined: 05 Jun 2014
Posts: 86

PostPosted: Wed Jun 29, 2016 3:47 am    Post subject: Reply with quote



Save / Load perfect work but teleport me in the sky ^^[/img]




EDIT i think teleport to 0,0,0 but if i remove savebuttonclicked lua not work

function saveButtonClicked(sender)

local lastCoords = {0, 0, 0}

function saveButtonClicked(sender)
lastCoords[1] = readFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+60')
lastCoords[2] = readFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+5c')
lastCoords[3] = readFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+58')
end

function loadButtonClicked(sender)
writeFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+58', lastCoords[1])
writeFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+5c', lastCoords[2])
writeFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+60', lastCoords[3])
end
end

function CEButtonReadClick(sender)
setProperty(UDF1.CEEditX,"Text", readFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+60'))
setProperty(UDF1.CEEditY,"Text", readFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+5c'))
setProperty(UDF1.CEEditZ,"Text", readFloat('[[[[["Goliath.exe"+00BC61D4]+744]+75c]+10]+2c4]+58'))
end


EDIT 2 now work but how save more location ?
Back to top
View user's profile Send private message
Der5t
Newbie cheater
Reputation: 0

Joined: 10 Mar 2014
Posts: 14

PostPosted: Wed Jun 29, 2016 8:10 pm    Post subject: Reply with quote

mausi125 wrote:

EDIT 2 now work but how save more location ?


I think use a combobox so that when Save Button is clicked, the location will be added in the combobox.Then clicking Load Button should teleport you to the location selected in the combobox.Using a combobox is the cleanest way I can think of.. (By clean I mean keeping the form look simple and small)
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