View previous topic :: View next topic |
Author |
Message |
gabriel19 How do I cheat?
Reputation: 0
Joined: 16 Dec 2011 Posts: 3 Location: Brasil
|
Posted: Thu Jan 12, 2012 8:02 pm Post subject: It is possible to put 2 lua scripts in just a cheat table? |
|
|
It is possible to put 2 lua scripts in just a cheat table?
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 468
Joined: 09 May 2003 Posts: 25707 Location: The netherlands
|
Posted: Thu Jan 12, 2012 8:31 pm Post subject: |
|
|
yes, just check that if you use global variables that don't interfere (and functionnames must be different)
_________________
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 |
|
 |
mgr.inz.Player I post too much
Reputation: 221
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Thu Jan 12, 2012 9:18 pm Post subject: |
|
|
I'm using two LUA scripts too. (reason: more human readable code)
First one is inside CT table. ("show cheat table lua script" ctrl+alt+L)
Second scripts is loaded with this instruction require "myscript" - it loads myscript.lua file. CT file and myscript.lua must be in the same directory. Btw. myscript.lua contains my universal functions and wrappers.
When I'm making EXE trainers I must add secondfile.lua file manually ("Exe Trainer Generator" , "Extra files" panel) or copy&paste second script at the end of first script.
@Dark Byte
Would be nice to load second lua file from CT (added this way: Table -> add file), like this:
Code: | -- new registered function (suggestion)
-- function similar to findTableFile, but combined with require LUA function
require_fromTableFile('myscript')
|
Of course I could use this:
Code: | luascripttablefile=findTableFile('myscript')
tablefile_saveToFile(luascripttablefile,'myscript.lua')
require "myscript"
|
but I got "Error:Access violation" at tablefile_saveToFile() (rev.1160) (tablefile_saveToFile doesn't work?)
Edit:
OK. I've finished editing my post.
Edit2:
My sugesstons:
1) require_fromTableFile('myscript')
2) auto-adding lua files ( require ) when creating EXE trainers.
_________________
|
|
Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 221
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Mon Jan 23, 2012 8:26 am Post subject: |
|
|
mgr.inz.Player wrote: |
Of course I could use this:
Code: | luascripttablefile=findTableFile('myscript')
tablefile_saveToFile(luascripttablefile,'myscript.lua')
require "myscript"
|
but I got "Error:Access violation" at tablefile_saveToFile() (rev.1160) (tablefile_saveToFile doesn't work?)
|
OK, It works now. And I'm using this:
Code: | luascripttablefile=findTableFile('myscript')
tablefile_saveToFile(luascripttablefile,'myscript.lua')
require "myscript"
os.remove("myscript.lua") -- immediately delete file after loading it.
-- It's still inside cheattable (table -> add file)
|
_________________
|
|
Back to top |
|
 |
ddtank. Newbie cheater
Reputation: 0
Joined: 03 Dec 2011 Posts: 21
|
Posted: Mon Jan 30, 2012 3:06 am Post subject: |
|
|
I can't use the function dofile("file1.lua") for that?
I try this and work fine for 2 scripts, but in the 3rd the script fails, all the functions don't work...
|
|
Back to top |
|
 |
ddtank. Newbie cheater
Reputation: 0
Joined: 03 Dec 2011 Posts: 21
|
Posted: Sun Feb 05, 2012 11:41 pm Post subject: |
|
|
I try do this in lua:
dofile("script1.lua")
dofile("script2.lua")
dofile("script3.lua")
or this:
require("script1.lua")
require("script2.lua")
require("script3.lua")
to do the attachment luas, but this don't work.
I need change global variables? If i do this i can use all the functions in the lua of one ct, right?
I don't know which are global variables in the scrits, you can help me?
Description: |
|
 Download |
Filename: |
script3.lua |
Filesize: |
1.03 KB |
Downloaded: |
1629 Time(s) |
Description: |
|
 Download |
Filename: |
script1.lua |
Filesize: |
1.03 KB |
Downloaded: |
1673 Time(s) |
Description: |
|
 Download |
Filename: |
script2.lua |
Filesize: |
1.03 KB |
Downloaded: |
1623 Time(s) |
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 468
Joined: 09 May 2003 Posts: 25707 Location: The netherlands
|
Posted: Mon Feb 06, 2012 12:08 am Post subject: |
|
|
rename replaceAOB and restoreAOB for each script to a unique functionname
e.g: restoreAOB1, restoreAOB2, restoreAOB3
also activatetick and deactivatetick
_________________
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 |
|
 |
|