|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
DTeCH Newbie cheater Reputation: 0
Joined: 19 Jul 2013 Posts: 23 Location: Cayman Islands
|
Posted: Wed Apr 23, 2014 8:57 am Post subject: Execute 2 hotkey functions by clicking 1 Hotkey (HELP) |
|
|
Hello again dudes
I want to have both (or more) hotkeys executed, or just the code of each executed by a single hotkey trigger... the multiple beeps are driving me nutty.
Here's my code so far:
Code: | <?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="16">
<Forms>
<CETrainer Class="TTrainerForm" Encoding="Ascii85">R E M O V E D</CETrainer>
</Forms>
<CheatEntries>
<CheatEntry>
<ID>5</ID>
<Description>"Experiment Bow Ammo 1"</Description>
<Color>80000008</Color>
<VariableType>4 Bytes</VariableType>
<Address>"GAME.dll"+008EF7C4</Address>
<Offsets>
<Offset>41C</Offset>
<Offset>48</Offset>
<Offset>354</Offset>
<Offset>6CC</Offset>
<Offset>614</Offset>
</Offsets>
<Hotkeys>
<Hotkey>
<Action>Toggle Activation</Action>
<Keys>
<Key>112</Key>
</Keys>
<Description>AmmoLock</Description>
<ID>0</ID>
</Hotkey>
<Hotkey>
<Action>Set Value</Action>
<Keys>
<Key>113</Key>
</Keys>
<Value>999</Value>
<Description>Ammo999</Description>
<ID>1</ID>
</Hotkey>
</Hotkeys>
</CheatEntry>
</CheatEntries>
<UserdefinedSymbols/>
<LuaScript>
--TRAINERGENERATORSTART--
--This is autogenerated code. Changing code in this block will
--get erased and rewritten if you regenerate the trainer code
--Uncomment the following line if this is a Cheat Table format trainer and you don't want CE to show (Tip, save as .CETRAINER alternatively)
--hideAllCEWindows()
RequiredCEVersion=6.3
if (getCEVersion==nil) or (getCEVersion()<RequiredCEVersion) then
messageDialog('Please install Cheat Engine '..RequiredCEVersion, mtError, mbOK)
closeCE()
end
addresslist=getAddressList()
memrec5=addresslist_getMemoryRecordByID(addresslist,5)
memrec5_hotkey0=memoryrecord_getHotkeyByID(memrec5,0)
memrec5_hotkey1=memoryrecord_getHotkeyByID(memrec5,1)
function onPostHotkey0(Hotkey)
--Executed after the "toggle*" cheat got executed
local memrec=memoryrecordhotkey_getOwner(Hotkey)
local isActive=memoryrecord_isActive(memrec) --get the state after the hotkey got triggered
cheatcomponent_setActive(CETrainer_CHEAT0, isActive)
if gBeepOnAction then
beep()
end
end
memoryrecordhotkey_onPostHotkey(memrec5_hotkey0,onPostHotkey0)
function onHotkey1(Hotkey)
--Executed before the hotkey is handled
cheatcomponent_setActive(CETrainer_CHEAT1, true, 1500)
if gBeepOnAction then
beep()
end
end
memoryrecordhotkey_onHotkey(memrec5_hotkey1,onHotkey1)
control_setVisible(CETrainer_SEPERATOR, false)
strings_add(getAutoAttachList(), "GAME.exe")
gBeepOnAction=true
form_show(CETrainer)
function AboutClick()
showMessage(gAboutText)
end
gAboutText=[[DTeCH]]
function CloseClick()
closeCE()
return caFree --onClick doesn't care, but onClose would like a result
end
--TRAINERGENERATORSTOP--
</LuaScript>
</CheatTable> |
F1 will do one thing, & F2 another, but I want to click F1, & have the thingy both set the value, AND Lock it in one click ( F1 + F2 ). without heariing 2, or sometimes 4 system Beeps/Dings.
I have seen it done, but not in CE LUA script.
Help + TAX lol
EDIT:
I changed the title
Anyway, is it even possible to trigger the execution of other hotkeys by clicking just one?
The following is where I'm getting confused:
Code: |
-- <Hotkey>
-- <Action>Toggle Activation</Action>
-- <Keys>
-- <Key>112</Key> ---- F1
-- </Keys>
-- <Description>AmmoLock</Description>
-- <ID>0</ID>
-- </Hotkey>
-- <Hotkey>
-- <Action>Set Value</Action>
-- <Keys>
-- <Key>113</Key> ---- F2
-- </Keys>
-- <Value>999</Value>
-- <Description>Ammo999</Description>
-- <ID>1</ID>
-- </Hotkey>
-------- How are these used, or what do they do? --------
memrec5_hotkey0=memoryrecord_getHotkeyByID(memrec5,0) ---- AmmoLock?
memrec5_hotkey1=memoryrecord_getHotkeyByID(memrec5,1) ---- Ammo999?
-----------------------------------------------------------------
function onPostHotkey0(Hotkey) ---- Is this fired after the Hotkey0 completes executing... ie: Locked the Ammo, or does one of the lines of code inside execute it? (Which one)
--Executed after the "toggle*" cheat got executed
local memrec=memoryrecordhotkey_getOwner(Hotkey)
local isActive=memoryrecord_isActive(memrec) --get the state after the hotkey got triggered
cheatcomponent_setActive(CETrainer_CHEAT0, isActive)
if gBeepOnAction then
beep()
end
end
--------------------- What does this do? ---------------------
memoryrecordhotkey_onPostHotkey(memrec5_hotkey0,onPostHotkey0)
-----------------------------------------------------------------
|
I just want to allow both to execute when I click F1... Set Ammo to 999, then LOCK it, then Beep.
ps: Would this do it?
Code: | function onPostHotkey0(Hotkey)
--Executed after the "toggle*" cheat got executed
local memrec=memoryrecordhotkey_getOwner(Hotkey)
local isActive=memoryrecord_isActive(memrec) --get the state after the hotkey got triggered
cheatcomponent_setActive(CETrainer_CHEAT0, isActive)
cheatcomponent_setActive(CETrainer_CHEAT1, isActive) ---- ??? :)
if gBeepOnAction then
beep()
end
end |
...or this?
Code: | function onPostHotkey0(Hotkey)
--Executed after the "toggle*" cheat got executed
local memrec=memoryrecordhotkey_getOwner(Hotkey)
local isActive=memoryrecord_isActive(memrec) --get the state after the hotkey got triggered
cheatcomponent_setActive(CETrainer_CHEAT0, isActive)
onHotkey1(113) ---- ??? :)
if gBeepOnAction then
beep()
end
end
function onHotkey1(Hotkey)
--Executed before the hotkey is handled
cheatcomponent_setActive(CETrainer_CHEAT1, true, 1500)
-- if gBeepOnAction then
-- beep()
-- end
end |
_________________
Hitler... When all else fails, you'll be in the right state of mind. Jesus Saves. |
|
Back to top |
|
|
DTeCH Newbie cheater Reputation: 0
Joined: 19 Jul 2013 Posts: 23 Location: Cayman Islands
|
|
Back to top |
|
|
|
|
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
|
|