View previous topic :: View next topic |
Author |
Message |
Casatodo Total How do I cheat? Reputation: 0
Joined: 10 May 2013 Posts: 3
|
Posted: Fri May 10, 2013 2:29 am Post subject: [Solved] Problem with "less than" operator on CETr |
|
|
hi everyone, its my first time using lua on CE (and using Lua at all) and wanted to ask: why is this code from my CETrainer file failing at line 7 position 8?
Code: |
<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="14">
<Forms/>
<UserdefinedSymbols/>
<LuaScript>
key=4
if key<5 then
showMessage("yay")
else
showMessage("nay")
end
</LuaScript>
</CheatTable>
|
it works on the Lua Engine, and changing the logical evaluator from less than to greater than works as expected, is there some special function that do logical comparisions?
also, I cant leave space between the logical operator and the values to compare like on the Lua examples from lua dot org using less than ("whitespace is not allowed here"), but I can with greater than, and that doesn't happen with Lua Engine either.
Last edited by Casatodo Total on Fri May 10, 2013 4:14 am; edited 1 time in total |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25295 Location: The netherlands
|
Posted: Fri May 10, 2013 2:38 am Post subject: |
|
|
I think you used a text editor to edit the .xml file instead of using cheat engine
In xml, you must change < with < and some other things
Code: |
<?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="14">
<CheatEntries/>
<UserdefinedSymbols/>
<LuaScript>key=4
if key<5 then
showMessage("yay")
else
showMessage("nay")
end
</LuaScript>
</CheatTable>
|
_________________
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 |
|
|
Casatodo Total How do I cheat? Reputation: 0
Joined: 10 May 2013 Posts: 3
|
Posted: Fri May 10, 2013 3:19 am Post subject: |
|
|
yes, I use a text editor to editing the CETrainer, I cant use cheat engine to edit more than the form GUI and its initial properties (that looks nothing friendly on text) and select which values from the game the trainer must get (in fact, I must raise an error on the trainer like bringing an nonexistant form to get the lua engine and test code there)
then this error is because its evaluating if the less than came from xml instead of from Lua? will I need to do that if I do a require(luafile) on the xml file calling a lua file as explained on the CE wiki?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25295 Location: The netherlands
|
Posted: Fri May 10, 2013 3:51 am Post subject: |
|
|
table->show cheat engine lua script will show the trainer script
If you have to, just paste the script in there when done editing it with another editor
_________________
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 |
|
|
Casatodo Total How do I cheat? Reputation: 0
Joined: 10 May 2013 Posts: 3
|
Posted: Fri May 10, 2013 4:12 am Post subject: |
|
|
Dark Byte wrote: | table->show cheat engine lua script will show the trainer script
|
it shows nothing, I think it has to do with me having WinXP or something, will test with other WinOS to see it
and I had to use dofile("file.lua") cause require("file") only works once, for testing purposes, it reloads the trainer but dont execute the scripts again but "less than" works
I'm starting to like the Lua programming on CE, I want to do a visual interpreter of the values in the game and at first though of making it with GM and some dll to see the values and CE to search them before but now looks like CE will be enough for everything planned
thanks Dark Byte and Co., keep the good work
|
|
Back to top |
|
|
|