Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


how to add auto assembler script in lua [help]

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Lynxz Gaming
Expert Cheater
Reputation: 4

Joined: 01 Jul 2017
Posts: 208
Location: help

PostPosted: Mon Jul 16, 2018 5:35 am    Post subject: how to add auto assembler script in lua [help] Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
MateeJr GT
Advanced Cheater
Reputation: 0

Joined: 24 Dec 2017
Posts: 66

PostPosted: Mon Jul 16, 2018 7:19 am    Post subject: Re: how to add auto assembler script in lua [help] Reply with quote

Lynxz Gaming wrote:
Hiii,

how to make a new auto assembler script with lua and it will be in a cheat table

any idea?


But The Idea For That Question is "NONE" : Sad Sad Sad Sad Sad Sad Sad

_________________
Hi Lynxz Gaming
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Mon Jul 16, 2018 2:25 pm    Post subject: Reply with quote

make a new auto assembler script
with lua - {$lua} ... {$asm}
it will be in a cheat table
save

_________________
https://github.com/FreeER/ has a few CE related repos
Back to top
View user's profile Send private message
Lynxz Gaming
Expert Cheater
Reputation: 4

Joined: 01 Jul 2017
Posts: 208
Location: help

PostPosted: Tue Jul 17, 2018 6:21 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Tue Jul 17, 2018 7:23 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Tue Jul 17, 2018 10:46 am    Post subject: Reply with quote

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 Very Happy

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]====]

_________________
https://github.com/FreeER/ has a few CE related repos
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites