View previous topic :: View next topic |
Author |
Message |
Genjuro Newbie cheater Reputation: 0
Joined: 26 Mar 2018 Posts: 15
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Mon Mar 26, 2018 2:46 pm Post subject: |
|
|
Code: | local t = createTimer()
t.OnTimer = some lua function to run after the interval (will be passed the timer object)
t.Interval = milliseconds to delay until next run eg 3000 for 3 seconds
|
_________________
Last edited by FreeER on Tue Mar 27, 2018 6:28 am; edited 1 time in total |
|
Back to top |
|
|
Genjuro Newbie cheater Reputation: 0
Joined: 26 Mar 2018 Posts: 15
|
Posted: Mon Mar 26, 2018 2:54 pm Post subject: |
|
|
Excellant dude, i will try to add this in later 😁
At work now.
|
|
Back to top |
|
|
Genjuro Newbie cheater Reputation: 0
Joined: 26 Mar 2018 Posts: 15
|
Posted: Tue Mar 27, 2018 8:47 am Post subject: |
|
|
Ok i dont know what im doing here, i have the trainer script straight from the auto generator here :
Code: | <?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="26">
<Forms>
<CETrainer Class="TTrainerForm" Encoding="Ascii85">.....form data.....</CETrainer>
</Forms>
<CheatEntries>
<CheatEntry>
<ID>0</ID>
<Description>"No description"</Description>
<LastState RealAddress="7FF7950CC230"/>
<VariableType>String</VariableType>
<Length>22</Length>
<Unicode>0</Unicode>
<CodePage>0</CodePage>
<ZeroTerminate>1</ZeroTerminate>
<Address>wmn5r.exe+194C230</Address>
<Hotkeys>
<Hotkey>
<Action>Set Value</Action>
<Keys>
<Key>83</Key>
</Keys>
<Value>GENJURO</Value>
<Description>name</Description>
<ID>0</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.7
if (getCEVersion==nil) or (getCEVersion()<RequiredCEVersion) then
messageDialog('Please install Cheat Engine '..RequiredCEVersion, mtError, mbOK)
closeCE()
end
addresslist=getAddressList()
memrec0=addresslist.getMemoryRecordByID(0)
memrec0_hotkey0=memrec0.getHotkeyByID(0)
function onHotkey0(Hotkey)
--Executed before the hotkey is handled
CETrainer.CHEAT0.setActive(true, 1500)
if gPlaySoundOnAction then
playSound(gActivateSound)
end
end
memrec0_hotkey0.onHotkey=onHotkey0
CETrainer.SEPERATOR.Visible=false
getAutoAttachList().add("wmn5r.exe")
gPlaySoundOnAction=false
CETrainer.show()
function AboutClick()
showMessage(gAboutText)
end
gAboutText=[[This trainer was made by Cheat Engine
cheatengine]]
function CloseClick()
--called by the close button onClick event, and when closing the form
closeCE()
return caFree --onClick doesn't care, but onClose would like a result
end
--TRAINERGENERATORSTOP--
</LuaScript>
</CheatTable>
|
and want to change this so the <Value>GENJURO</Value> is written to the address above every 3 or 4 seconds (so i dont need a hotkey), with the timer that was posted above
Code: |
local t = createTimer()
t.OnTimer = some lua function to run after the interval (will be passed the timer object)
t.Interval = milliseconds to delay until next run eg 3000 for 3 seconds
|
Also i understand this is a script that needs cheat engine to be installed in order to run. Im guessing this should be easy to change to a portable .exe when im done tweaking it?
Last edited by Genjuro on Wed Mar 28, 2018 5:22 am; edited 1 time in total |
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Tue Mar 27, 2018 12:26 pm Post subject: |
|
|
I'd probably go with something like this (note that I removed the form encoding to make it display a little nicer on the forum, replace it with the original)
Code: | <?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="26">
<Forms>
<CETrainer Class="TTrainerForm" Encoding="Ascii85">...ASCII encoded trainer...</CETrainer>
</Forms>
<CheatEntries>
<CheatEntry>
<ID>0</ID>
<Description>"GENJURO"</Description>
<LastState RealAddress="7FF7950CC230"/>
<VariableType>String</VariableType>
<Length>22</Length>
<Unicode>0</Unicode>
<CodePage>0</CodePage>
<ZeroTerminate>1</ZeroTerminate>
<Address>wmn5r.exe+194C230</Address>
</CheatEntry>
</CheatEntries>
<UserdefinedSymbols/>
<LuaScript>--TRAINERGENERATORSTART--
hideAllCEWindows()
addresslist=AddressList or getAddressList()
GENJURO_mr=addresslist.getMemoryRecordByID(0)
GENJURO_timer = createTimer()
GENJURO_timer.Enabled = false
GENJURO_timer.Interval = 3000 -- every 3 seconds
GENJURO_timer.OnTimer = function(t)
GENJURO_mr.Value = "GENJURO"
end
GENJURO_hotkey = createHotkey(function (Hotkey)
-- determine toggle state
local state = not GENJURO_timer.Enabled
-- update state
CETrainer.CHEAT0.setActive(state, 1500)
if gPlaySoundOnAction then
playSound(state and gActivateSound or gDeactivateSound)
end
GENJURO_timer.Enabled = state
end, {('S'):byte(1)})
CETrainer.SEPERATOR.Visible=false
getAutoAttachList().add("wmn5r.exe")
gPlaySoundOnAction=false
CETrainer.show()
function AboutClick()
showMessage(gAboutText)
end
gAboutText=[[This trainer was made by Cheat Engine
cheatengine]]
function CloseClick()
--called by the close button onClick event, and when closing the form
closeCE()
return caFree --onClick doesn't care, but onClose would like a result
end
--TRAINERGENERATORSTOP--
</LuaScript>
</CheatTable>
|
That does leave the hotkey in but it's a toggle rather than having to press it every time it changes and you can just remove the hotkey part and enable the timer when it's created if you like.
And yeah, getting an exe should be about as simple as file->save and choosing the exe option.
_________________
|
|
Back to top |
|
|
Genjuro Newbie cheater Reputation: 0
Joined: 26 Mar 2018 Posts: 15
|
Posted: Tue Mar 27, 2018 1:07 pm Post subject: |
|
|
Lost count how many times ive edited this reply.
Its working nice and smooth
FreeER is a god
|
|
Back to top |
|
|
Genjuro Newbie cheater Reputation: 0
Joined: 26 Mar 2018 Posts: 15
|
Posted: Thu Mar 29, 2018 4:38 am Post subject: |
|
|
Ok now i want to add an editbox and enter button to the form to change the "name" value that is being repeated.
ive put this together but when i click enter nothing happens :
Code: |
function EnterClick(sender)
writeInteger("GENJURO_mr.Value", getProperty(CETrainer.TCEEdit,"Text"))
|
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Thu Mar 29, 2018 5:39 am Post subject: |
|
|
writeInteger takes an address to write to and an Integer, you're giving it two strings, the current name and the new name. While GENJURO_mr.Address, without quotes, would be the address you'd still want writeString, however in this case what you'd really want to do is change a global variable and have the timer use that when updating the value otherwise it only gets written once (and presumably without the timer it changes back). Also I kind of doubt that you named the edit box TCEEdit (which happens to be the "className" of all edit boxes) eg.
Code: | thename = "GENJURO"
GENJURO_timer.OnTimer = function(t)
GENJURO_mr.Value = thename
end
function EnterClick(sender)
thename = CETrainer.CEEdit1.Text
-- ^ equivalent to getProperty(CETrainer.CEEdit1,"Text"))
-- getProperty existed pre 6.5 while .Text did not, both work
-- generated trainers have an if statement that only allow
-- versions older than what they were created with so it's
-- not considered bad practice or anything to use .Text :)
end
|
_________________
|
|
Back to top |
|
|
Genjuro Newbie cheater Reputation: 0
Joined: 26 Mar 2018 Posts: 15
|
Posted: Thu Mar 29, 2018 6:05 am Post subject: |
|
|
sorry man all the examples I could find were written like that.
Well ive changed the script with the above and its printing whats contained in thename but the enter button isnt taking whats in the edit box.
Dont be suprised if this has been assembled wrong. Just pity me
(cant upload images)
ok the edit box in the object inspector is named as
Name: TCEEdit
so ive put the script together like this :
Code: |
addresslist=AddressList or getAddressList()
GENJURO_mr=addresslist.getMemoryRecordByID(0)
GENJURO_timer = createTimer()
GENJURO_timer.Enabled = true
GENJURO_timer.Interval = 1000
thename = "GENJURO"
GENJURO_timer.OnTimer = function(t)
GENJURO_mr.Value = thename
end
CETrainer.SEPERATOR.Visible=false
getAutoAttachList().add("wmn5r.exe")
gPlaySoundOnAction=false
CETrainer.show()
function AboutClick()
showMessage(gAboutText)
end
gAboutText=[[This trainer was made by Cheat Engine
cheatengine]]
function CloseClick()
--called by the close button onClick event, and when closing the form
closeCE()
return caFree --onClick doesn't care, but onClose would like a result
end
--TRAINERGENERATORSTOP--
function EnterClick(sender)
thename = CETrainer.Name.Text
end
|
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Thu Mar 29, 2018 6:22 am Post subject: |
|
|
Did you do anything in the form editor to associate the EnterClick function with the CEEdit box? If not then it won't be called. Also, I don't remember CE having an event when the enter button is press, you have to check for it yourself in the Changed/KeyPress event (whatever it's called, I don't remember off the top of my head), didn't mention it before since I figured the function was part some other code you found but since I don't see any...
something like Code: | function CEEdit1KeyPress(sender, key)
if key=='\r' or key == '\n' then EnterClick(sender) end
return key
end |
_________________
|
|
Back to top |
|
|
Genjuro Newbie cheater Reputation: 0
Joined: 26 Mar 2018 Posts: 15
|
Posted: Thu Mar 29, 2018 6:24 am Post subject: |
|
|
Ok i changed the name of the edit box to make more sense and it seems to be working now.
Again thanks a lot.
Would it be ok to give u credit for this?
Its gonna make a few people quite happy
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Thu Mar 29, 2018 6:29 am Post subject: |
|
|
No problem, and if you want to mention that I helped you with the lua code then feel free
_________________
|
|
Back to top |
|
|
Genjuro Newbie cheater Reputation: 0
Joined: 26 Mar 2018 Posts: 15
|
Posted: Thu Mar 29, 2018 6:31 am Post subject: |
|
|
Dude your getting full credit for the whole thing...
All i did was fumble about
Your amazing man
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Thu Mar 29, 2018 6:38 am Post subject: |
|
|
Take some credit, you found the the right address to change and got someone to help you at the least, clearly more than anyone else had taken the time to do
_________________
|
|
Back to top |
|
|
Genjuro Newbie cheater Reputation: 0
Joined: 26 Mar 2018 Posts: 15
|
Posted: Sun Apr 15, 2018 1:04 pm Post subject: |
|
|
Is there a way to add another address to be changed in this script?
I noticed another part of the game where your name should be displayed.
Would it be somthing like Code: | <LastState RealAddress="7FF7950CC230, 7FF7950DC240"/> |
|
|
Back to top |
|
|
|