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 


Lua AOB Scan Returning a different result from menu?

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

Joined: 19 Jun 2015
Posts: 22

PostPosted: Mon May 16, 2016 7:25 pm    Post subject: Lua AOB Scan Returning a different result from menu? Reply with quote

So I'm trying to run a AOBScan with Lua With just the following code

Code:
Result = AOBScan("00,00,00,00,00,00,FF,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,FF,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,90,01,00,00,90,01,00,00,90,01,00,00,90,01,00,00,90,01")
print(Result)


this has outputted addresses

0D8F49B0
0D8F65B0

now I've used the same string of bytes in the menu and get the results as followed (respectively)

11915666E
11915166E

I've taken a screenshot here: http://i.imgur.com/e054ttb.jpg

If I'm doing something incorrect or if I could do something better to get the results desired please let me know.

Thanks so much.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Mon May 16, 2016 7:54 pm    Post subject: Reply with quote

That's because the variable "Result" is userdata, not a string. To print it out you have to get the results from that userdata:
Code:
local res = AOBScan("00 00 00 00 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 01 00 00 90 01 00 00 90 01 00 00 90 01 00 00 90 01 00 00 90 01")
if res == nil then return end
for i=0, res.Count-1, 1 do
  print(res[i])
end
res.destroy()

See main.lua (inside the main CE directory) for more information.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
pozzum
Newbie cheater
Reputation: 0

Joined: 19 Jun 2015
Posts: 22

PostPosted: Mon May 16, 2016 10:46 pm    Post subject: Reply with quote

ParkourPenguin wrote:
That's because the variable "Result" is userdata, not a string. To print it out you have to get the results from that userdata:
Code:
local res = AOBScan("00 00 00 00 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 01 00 00 90 01 00 00 90 01 00 00 90 01 00 00 90 01 00 00 90 01")
if res == nil then return end
for i=0, res.Count-1, 1 do
  print(res[i])
end
res.destroy()

See main.lua (inside the main CE directory) for more information.


Yeah that managed to do it. I tried something more simple and trying just a print(Result[1]) and I was getting errors so I was getting confused.

Thanks so much
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