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 


Form's Buttom AOBswap LUA Script

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
3kokocam
Newbie cheater
Reputation: 0

Joined: 22 Dec 2014
Posts: 22
Location: 127.0.0.1

PostPosted: Tue Jan 13, 2015 11:27 am    Post subject: Form's Buttom AOBswap LUA Script Reply with quote

Hello Guys,

When I'm Trying to Add AOBswap to my Bottom on my form it gives an Error
Any Help??!
I Have Tried in many Ways
First one:
Code:
function CEButton1Click(sender)
[[LuaCall(Aobswap("66 b1 4d 66 bd 08 ab 62 07 11 14 00 00","66 b1 4d 66 bd 07 ab 62 07 11 14 00 00"))]]
end

Second one:
Code:
function CEButton1Click(sender)
Aobswap("66 b1 4d 66 bd 08 ab 62 07 11 14 00 00","66 b1 4d 66 bd 07 ab 62 07 11 14 00 00")
end

But The Two Seem to be Incorrect and give error when executing
So what AOBswap's LUA i Should Use ??
Thanks For Helping
See the Captures!! Arrow
Very Happy Smile Surprised Exclamation Exclamation Question



112134.PNG
 Description:
 Filesize:  590.48 KB
 Viewed:  8488 Time(s)

112134.PNG


Back to top
View user's profile Send private message
Redouane
Master Cheater
Reputation: 3

Joined: 05 Sep 2013
Posts: 363
Location: Algeria

PostPosted: Tue Jan 13, 2015 12:26 pm    Post subject: Re: Form's Buttom AOBswap LUA Script Reply with quote

3kokocam wrote:
Hello Guys,

When I'm Trying to Add AOBswap to my Bottom on my form it gives an Error
Any Help??!
I Have Tried in many Ways
First one:
Code:
function CEButton1Click(sender)
[[LuaCall(Aobswap("66 b1 4d 66 bd 08 ab 62 07 11 14 00 00","66 b1 4d 66 bd 07 ab 62 07 11 14 00 00"))]]
end

Second one:
Code:
function CEButton1Click(sender)
Aobswap("66 b1 4d 66 bd 08 ab 62 07 11 14 00 00","66 b1 4d 66 bd 07 ab 62 07 11 14 00 00")
end

But The Two Seem to be Incorrect and give error when executing
So what AOBswap's LUA i Should Use ??
Thanks For Helping
See the Captures!! Arrow
Very Happy Smile Surprised Exclamation Exclamation Question


First one is wrong,in Lua,the operators [[]] delimit a string,and the 'luacall' is an auto-assemble commant,you are not in the Auto Assembler.
The second one is also wrong,because the function Aobswap does not exist,so you are trying to call a nil value,you must define it before calling it.
Two ways to do it:
1-Use the autoAssemble function:
Code:

function CEButton1Click(sender)
  return autoAssemble[[aobscan(myaob,66 b1 4d 66 bd 08 ab 62 07 11 14 00 00)
myaob:
db 66 b1 4d 66 bd 07 ab 62 07 11 14 00 00]]
end

2-Define the Aobswap function,then call it:
Code:

function Aobswap(aob1,aob2)
  local r = AOBScan(aob1);
  local result = r[0];
  r.destroy();
  local bytetable = {};
  for n in aob2:gmatch'%x%x' do
    bytetable[#bytetable+1]=tonumber(n,16);
  end
  return writeBytes(result,unpack(bytetable));
end
function CEButton1Click(sender)
  return Aobswap("66 b1 4d 66 bd 08 ab 62 07 11 14 00 00","66 b1 4d 66 bd 07 ab 62 07 11 14 00 00");
end
Back to top
View user's profile Send private message
3kokocam
Newbie cheater
Reputation: 0

Joined: 22 Dec 2014
Posts: 22
Location: 127.0.0.1

PostPosted: Wed Jan 14, 2015 5:01 am    Post subject: rnib Thanks Reply with quote

Very Very Thanks to You rnib
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