View previous topic :: View next topic |
Author |
Message |
Lynxz Gaming Expert Cheater Reputation: 4
Joined: 01 Jul 2017 Posts: 208 Location: help
|
Posted: Mon Jul 16, 2018 5:35 am Post subject: how to add auto assembler script in lua [help] |
|
|
Hiii,
how to make a new auto assembler script with lua and it will be in a cheat table
any idea?
_________________
my english is bad
discord : rynx#9828 |
|
Back to top |
|
|
MateeJr GT Advanced Cheater Reputation: 0
Joined: 24 Dec 2017 Posts: 66
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Mon Jul 16, 2018 2:25 pm Post subject: |
|
|
make a new auto assembler script
with lua - {$lua} ... {$asm}
it will be in a cheat table
save
_________________
|
|
Back to top |
|
|
Lynxz Gaming Expert Cheater Reputation: 4
Joined: 01 Jul 2017 Posts: 208 Location: help
|
Posted: Tue Jul 17, 2018 6:21 am Post subject: |
|
|
FreeER wrote: | make a new auto assembler script
with lua - {$lua} ... {$asm}
it will be in a cheat table
save |
sorry bad english
but i mean is like make a new script table in table list using lua script
_________________
my english is bad
discord : rynx#9828 |
|
Back to top |
|
|
TheyCallMeTim13 Wiki Contributor Reputation: 50
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Tue Jul 17, 2018 7:23 am Post subject: |
|
|
Lynxz Gaming wrote: |
sorry bad english
but i mean is like make a new script table in table list using lua script |
Quote: |
make a new script, in table list, using lua script |
No idea if this is what you meant.
Code: |
local function addAAScript()
local mr = AddressList.createMemoryRecord()
mr.Type = vtAutoAssembler
mr.Script = '[Enable]\r\n\r\n[Disable]\r\n\r\n'
mr.Description = 'Auto Assemble Script ()->'
end |
Side question, if I am unable to convey ideas or thoughts in a language; am I bad at it, or can I just not speak/write that language?
_________________
|
|
Back to top |
|
|
FreeER Grandmaster Cheater Supreme Reputation: 53
Joined: 09 Aug 2013 Posts: 1091
|
Posted: Tue Jul 17, 2018 10:46 am Post subject: |
|
|
Ah, yeah if what you meant was creating a new AA script and adding it to the table using lua then TheyCallMeTim13's example works, though I do want to add that you can use lua's multi-line strings eg.
Code: | local mr = AddressList.createMemoryRecord()
mr.Type = vtAutoAssembler
mr.Description = 'My new lua generated AA Script!'
mr.Script = [====[// lua generated AA script
[ENABLE]
{$lua}
print((([[see, you can use lua in AA from lua!
You can even use mutliline strings in a multiline string!
Isn't this fantastic! :)]]):gsub('\n','\r\n')))
-- script output uses \r\n for new line, hence gsub to change just \n to \r\n
--[[
note that escape sequences are ignored in multi line strings
so if you really needed those you'd need to use string concatenation
table.concatenate or string.format which are more efficient
for long strings, and/or many strings (since strings are immutable in lua)
]]
{$asm}
[DISABLE]
// end of script]====]
|
You can even use lua to create a memory record that uses lua to return a lua block that, well in this example just prints something
Code: | local mr = AddressList.createMemoryRecord()
mr.Type = vtAutoAssembler
mr.Description = 'My new lua generated AA Script!'
mr.Script = [====[// lua generated AA script
[ENABLE]
{$lua}
-- concatenation of '{$lua}' to prevent {$lua} the first token on a line
-- and used in the script rather than as part of the returned string.
return '{$lua}\n\n' .. [=[print((([[see, you can use lua in AA from lua!
You can even use mutliline strings in a multiline string!
Isn't this fantastic! :)]]):gsub('\n','\r\n')))
]=]
-- script output uses \r\n for new line, hence gsub to change just \n to \r\n
--[[
note that escape sequences are ignored in multi line strings
so if you really needed those you'd need to use string concatenation
table.concatenate or string.format which are more efficient
for long strings, and/or many strings (since strings are immutable in lua)
]]
{$asm}
[DISABLE]
// end of script]====] |
_________________
|
|
Back to top |
|
|
|