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 


Buttons on my trainer

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

Joined: 01 Mar 2014
Posts: 2
Location: Philippines

PostPosted: Mon Dec 08, 2014 9:01 am    Post subject: Buttons on my trainer Reply with quote

Hello.

I wanted to create buttons on my trainer. I have created hotkeys. All I want is a toggle button that will toggle the cheats through hotkeys. How will I do that?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25288
Location: The netherlands

PostPosted: Mon Dec 08, 2014 10:44 am    Post subject: Reply with quote

in the onclick event of your button do something like:
Code:

mr=getAddressList().GetMemoryRecordByDescription('a memoryrecord entry')

--find the hotkey
for i=0, mr.HotkeyCount-1 do
  if mr.Hotkey[i].Description=='inc 100' then
    --found it
    mr.Hotkey[i].doHotkey() --activate it
  end
end

--if you know the hotkeyid (it's shown the the set/change hotkey window) you can use mr.getHotkeyByID(id).doHotkey() instead

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Bryan_James
How do I cheat?
Reputation: 0

Joined: 01 Mar 2014
Posts: 2
Location: Philippines

PostPosted: Tue Dec 09, 2014 12:49 am    Post subject: Some errors Reply with quote

I copied and paste your code directly to CE without editing. And it made an error. What are the parts on the code that I need to edit to make my button run?
Also, where can I find the hotkey ID? I used F1 as one of my hotkeys. Does that mean that the hotkey ID was F1?

Sorry if I'm a noob. I try searching the internet for this but I can't find the answer.

Thank you!
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25288
Location: The netherlands

PostPosted: Tue Dec 09, 2014 5:56 am    Post subject: Reply with quote

You need to change the script's descriptions accordingly (multiple)
And the id is an integer. It is shown in the bottom right of the set hotkey window when the hotkey is selected

This script uses the description though, so if you're using that, then the description is in the description field

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
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