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 


value from Editbox?

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

Joined: 13 Jun 2013
Posts: 13

PostPosted: Sun Jun 23, 2013 7:10 am    Post subject: value from Editbox? Reply with quote

He dudes, i want to make a speedhack trainer, and i want a editbox where you can insert the speed value.
How can i read the value form the Editbox and insert it in a variable?

Sorry for bad english :/
Im German Razz
Back to top
View user's profile Send private message
daspamer
Grandmaster Cheater Supreme
Reputation: 54

Joined: 13 Sep 2011
Posts: 1588

PostPosted: Sun Jun 23, 2013 8:01 am    Post subject: Reply with quote

Code:
speedhack_setSpeed(tonumber(control_getCaption(EditBox)))

_________________
I'm rusty and getting older, help me re-learn lua.
Back to top
View user's profile Send private message Visit poster's website
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Sun Jun 23, 2013 8:03 am    Post subject: Reply with quote

Code:
function CEButton1Click(sender)

  local userSpeedValueString = UDF1.CEEdit1.Text:gsub(',','.')   -- it allows , and . as decimal separator
  local number = tonumber(userSpeedValueString)

  if number==nil then
    UDF1.CEEdit1.Color = 0xC6C6FF     -- not number, change color to bright red and quit
    return
  end

  if number>1000 or number<0 then
    UDF1.CEEdit1.Color = 0xC6C6FF     -- too big or too small, change color to bright red and quit
    return
  end

  UDF1.CEEdit1.Color = 0xFFFFFF         -- it's good
  speedhack_setSpeed(number)            -- set speed

end

_________________
Back to top
View user's profile Send private message MSN Messenger
ethnic
Newbie cheater
Reputation: 0

Joined: 13 Jun 2013
Posts: 13

PostPosted: Sun Jun 23, 2013 9:28 am    Post subject: Reply with quote

Thanks!
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