View previous topic :: View next topic |
Author |
Message |
Mobie Cheater Reputation: 0
Joined: 10 Feb 2011 Posts: 43
|
Posted: Tue Mar 26, 2013 6:31 am Post subject: AOB Scan Script help! |
|
|
Hello here a scrip from a friend
-- Search via AOB
sl = AOBScan("D9 40 04 D8 45 08");
if(sl == nil) then
print("No code found!");
else
j = stringlist_getCount(sl);
print("Found:",j);
for i = 1, j do
print(stringlist_getString(sl,i-1));
end
object_destroy(sl);
end
-- end of the script
How i can write a script that scan more as 1 code ( like Health,ammo )
sl = AOBScan("D9 40 04 D8 45 08"); Ammo
sl = AOBScan("0F B7 81 10 0F 00 00"); Health
|
|
Back to top |
|
|
Rectangle Advanced Cheater Reputation: 1
Joined: 23 Feb 2013 Posts: 73
|
Posted: Tue Mar 26, 2013 9:25 am Post subject: |
|
|
What do they need to be in the same script for?
Why not just make separate scripts?
#EDIT: Oh wait, you're not using an auto-assemble script. In that case, you've already answered your own question:
Code: | ammoScan = AOBScan("D9 40 04 D8 45 08"); --Ammo
hpScan = AOBScan("0F B7 81 10 0F 00 00"); --Health |
|
|
Back to top |
|
|
Mobie Cheater Reputation: 0
Joined: 10 Feb 2011 Posts: 43
|
Posted: Tue Mar 26, 2013 4:49 pm Post subject: |
|
|
thanks for reply
here my script
-- Search via AOB
scanammo = AOBScan("66 29 54 41 0A"); --ammo
scanhealth = AOBScan("0F B7 81 10 0F 00 00 0F B7 8E 22 02 00 00"); --health
if(sl == nil) then
print("No code found!");
else
j = stringlist_getCount(sl);
print("Found:",j);
for i = 1, j do
print(stringlist_getString(sl,i-1));
end
object_destroy(sl);
end
-- end of the script
when i go to execute than comes this error in ouput
Error:Access violation
Script Error
|
|
Back to top |
|
|
Rectangle Advanced Cheater Reputation: 1
Joined: 23 Feb 2013 Posts: 73
|
Posted: Tue Mar 26, 2013 5:55 pm Post subject: |
|
|
You need to use the variables you created.
AOBScan returns a list of address strings. In your script above, you are creating two variables, each holding a list of address strings, and then you are trying to use another variable (sl) to get the number of results in a string list... but since you changed the variable name to scanammo and scanhealth, sl either contains nothing ("nil") or something else entirely instead of a string list.
Change your code to use the variables you created.
|
|
Back to top |
|
|
DaSpamer Grandmaster Cheater Supreme Reputation: 52
Joined: 13 Sep 2011 Posts: 1578
|
Posted: Tue Mar 26, 2013 5:55 pm Post subject: |
|
|
sl is not defined.
_________________
|
|
Back to top |
|
|
Rectangle Advanced Cheater Reputation: 1
Joined: 23 Feb 2013 Posts: 73
|
Posted: Tue Mar 26, 2013 10:29 pm Post subject: |
|
|
Mother of hack wrote: | sl is not defined. |
I thought of stating it like that, except I wasn't sure if the code posted above was the entirety of the script, or simply an excerpt where sl may be defined elsewhere.
And judging by the user's question and response, he doesn't seem to understand the logic of the script... so I figured it would be better to help him understand not just what was wrong, but also why, so that he can write his own scripts instead of potentially asking for more code which he doesn't understand, leading him once again back to the forum.
Sort of a "teach a man to fish" versus "give a man a fish" scenario.
|
|
Back to top |
|
|
|