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 


Make trainer cheat function work on button

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

Joined: 27 Dec 2011
Posts: 3
Location: Tbilisi

PostPosted: Tue Dec 27, 2011 4:01 pm    Post subject: Make trainer cheat function work on button Reply with quote

hi, please help me i want to make trainer and no luck Sad((( i made trainer with hotkey (ex. CTRL+F) works fine but i want to make trainer with buttons. i mean wen i will press a button one of trainer function will enable. i know that for this i need scryot.plase help how to make this Sad(
thanks..

_________________
I love disassembling programs Razz
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

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

PostPosted: Tue Dec 27, 2011 4:34 pm    Post subject: Reply with quote

Code:
function Button1Click(sender)

  hotkey=memoryrecord_getHotkeyByID(memrec0,0)
  memoryrecordhotkey_doHotkey(hotkey)

end

control_onClick(CETrainer_Button1, Button1Click)


But you must know which memrec (memrec0, memrec1, memrec2, etc) and you must know which hotkey ID.

I used memrec0 and hotkeyID = 0.

_________________
Back to top
View user's profile Send private message MSN Messenger
midler
How do I cheat?
Reputation: 0

Joined: 27 Dec 2011
Posts: 3
Location: Tbilisi

PostPosted: Wed Dec 28, 2011 2:08 am    Post subject: Reply with quote

it tells me: access violation... whats the problem? can you write quckly how to find memrec 0 or 1 or 2 ? i replaced all names but no luck
_________________
I love disassembling programs Razz
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Wed Dec 28, 2011 9:07 am    Post subject: Reply with quote

replace
Code:

hotkey=memoryrecord_getHotkeyByID(memrec0,0)

with

Code:

local mr=addresslist_getMemoryRecordByDescription(getAddressList(),"Unique description of your cheat entry") --find the memrec
if (mr~=nil) then
  hotkey=memoryrecord_getHotkey(mr,0) --first hotkey of the memrec (if there's only 1, this is it)
else
  print("Cheat entry not found")
end

_________________
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
midler
How do I cheat?
Reputation: 0

Joined: 27 Dec 2011
Posts: 3
Location: Tbilisi

PostPosted: Wed Dec 28, 2011 10:54 am    Post subject: Reply with quote

thank you very much Dark Byte Smile)
_________________
I love disassembling programs Razz
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