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 


button that increases value

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

Joined: 28 May 2016
Posts: 51

PostPosted: Sun Jul 03, 2016 8:28 pm    Post subject: button that increases value Reply with quote

how do i create a button that increases a integer value?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4293

PostPosted: Sun Jul 03, 2016 8:33 pm    Post subject: Reply with quote

Code:
f = createForm()
local b = createButton(f)
b.OnClick = function(sender)
  writeInteger(address, readInteger(address)+10)
end

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
lothe23
Advanced Cheater
Reputation: 0

Joined: 28 May 2016
Posts: 51

PostPosted: Sun Jul 03, 2016 8:43 pm    Post subject: Reply with quote

ParkourPenguin wrote:
Code:
f = createForm()
local b = createButton(f)
b.OnClick = function(sender)
  writeInteger(address, readInteger(address)+10)
end


im sorry i didnt explain properly, i already got a button and when it is pressed i want it to increase the value with 10
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4293

PostPosted: Sun Jul 03, 2016 8:46 pm    Post subject: Reply with quote

If you're using the form designer, click on the button, go to the "Events" tab in the object inspector, and assign a function to the OnClick event manually (double click it and CE will make one for you).
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
lothe23
Advanced Cheater
Reputation: 0

Joined: 28 May 2016
Posts: 51

PostPosted: Sun Jul 03, 2016 8:49 pm    Post subject: Reply with quote

ParkourPenguin wrote:
If you're using the form designer, click on the button, go to the "Events" tab in the object inspector, and assign a function to the OnClick event manually (double click it and CE will make one for you).


yeah but how do i assign a function that increases a value with etc 10?

like within this?

Code:
function CEButton1Click(sender)

end


this might be so stupid but i couldnt find a thread bout it somewhere else
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4293

PostPosted: Sun Jul 03, 2016 8:51 pm    Post subject: Reply with quote

ParkourPenguin wrote:
writeInteger(address, readInteger(address)+10)

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
lothe23
Advanced Cheater
Reputation: 0

Joined: 28 May 2016
Posts: 51

PostPosted: Sun Jul 03, 2016 9:24 pm    Post subject: Reply with quote

ParkourPenguin wrote:
ParkourPenguin wrote:
writeInteger(address, readInteger(address)+10)
'

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