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 


CE Trainer trackbar with keyboard hotkeys

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

Joined: 28 Nov 2022
Posts: 62

PostPosted: Wed Aug 23, 2023 11:03 am    Post subject: CE Trainer trackbar with keyboard hotkeys Reply with quote

Is there a way to make the trackbar in a CE trainer increase and decrease in position value using keyboard hotkeys.

I'm wanting to use the numpad + to increase and numpad - to decrease.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4708

PostPosted: Wed Aug 23, 2023 11:57 am    Post subject: Reply with quote

celua.txt
Quote:
TrackBar Class : (Inheritance: WinControl->Control->Component->Object)

properties
Min: integer - Minimal value for the trackbar
Max: integer - Maximum value for the trackbar
Position: integer - The current position

...

GenericHotkey Class : (Inheritance: Object)
createHotkey(function, keys, ...) : returns an initialized GenericHotkey class object. Maximum of 5 keys

_________________
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
Bit Byte
Advanced Cheater
Reputation: 0

Joined: 28 Nov 2022
Posts: 62

PostPosted: Thu Aug 24, 2023 4:38 am    Post subject: Reply with quote

Before your post I got it to work doing this:

Code:
function CETrainer_CETimer3Timer(sender)
if isKeyPressed(VK_ADD) then
   if CETrainer.CETrackBar1.Position < 7 then
    CETrainer.CETrackBar1.Position = CETrainer.CETrackBar1.Position + 1
    end
end
if isKeyPressed(VK_SUBTRACT) then
    if CETrainer.CETrackBar1.Position > 1 then
    CETrainer.CETrackBar1.Position = CETrainer.CETrackBar1.Position - 1
    end
end
end



Now I've done
Code:
createHotkey(function, keys, ...)

which also works Very Happy
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4708

PostPosted: Thu Aug 24, 2023 9:51 am    Post subject: Reply with quote

Instead of the hard-coded values 1 and 7, I'd look at the Min and Max properties. Then the hotkeys will work even if you change the trackbar's min or max.
_________________
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
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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