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 


I don't know How to write a script

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
rikku007
How do I cheat?
Reputation: 0

Joined: 12 Mar 2018
Posts: 5
Location: thailand

PostPosted: Mon Mar 12, 2018 6:16 am    Post subject: I don't know How to write a script Reply with quote

Please write a script and release me please
I want Script Save Value from HasEditBox to Text and Load save to HasEditBox
and Script Show Coordinates ฺ X Y Z Button
Help me please
Sad Sad Sad



Zo3284.jpg
 Description:
 Filesize:  33.7 KB
 Viewed:  1203 Time(s)

Zo3284.jpg


Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater
Reputation: 17

Joined: 10 Apr 2015
Posts: 619

PostPosted: Mon Mar 12, 2018 10:49 pm    Post subject: Reply with quote

Juat for sample to save / load value from a text file :

Code:
f = createForm()

lb1 = createLabel(f)
lb1.left = 10
lb1.top = 10
lb1.Caption = 'Top 1'

lb2 = createLabel(f)
lb2.left = 10
lb2.top = 30
lb2.Caption = 'Texture'

e1 = createEdit(f)
e1.left = 100
e1.top = 10
e1.width = 100
e1.Text ='0'

e2 = createEdit(f)
e2.left = 100
e2.top = 30
e2.width = 100
e2.Text = '0'

b1 = createButton(f)
b1.left = 10
b1.height = 30
b1.top = 100
b1.width = 60
b1.Caption = 'Save'

b2 = createButton(f)
b2.left = b1.left + b1.width + 10
b2.height = 30
b2.top = 100
b2.width = 60
b2.Caption = 'Load'

b3 = createButton(f)
b3.left = b2.left + b2.width + 10
b3.height = 30
b3.top = 100
b3.width = 60
b3.Caption = 'Close'


function SaveVars()
 get_Top1 = tonumber(e1.text)
 get_Texture1 = tonumber(e2.text)
 local f = assert(io.open("SavedVars.txt", "w"))
 f:write(get_Top1,"\n")
 f:write(get_Texture1,"\n")
 f:close()
 showMessage("Done... Data Saved")
 return
end

function LoadVars()
 local f = assert(io.open("SavedVars.txt", "r"))
 set_Top1 = f:read("*line")
 set_Texture1 = f:read("*line")
 f:close()
 e1.Text = tostring(set_Top1)
 e2.Text = tostring(set_Texture1)
end

function exitTrainer()
 form_hide(f)
 return caFree
end

b1.onClick = SaveVars
b2.onClick = LoadVars
b3.onClick = exitTrainer

f.show()


from this topic:
http://www.cheatengine.org/forum/viewtopic.php?p=5729979&sid=376119ba3bd3db3be5e9d9bf75ef9a88

_________________
Singapore Sling + Johnnie Walker + Some Peanuts....
Back to top
View user's profile Send private message
rikku007
How do I cheat?
Reputation: 0

Joined: 12 Mar 2018
Posts: 5
Location: thailand

PostPosted: Sat Mar 17, 2018 5:24 pm    Post subject: Reply with quote

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