| View previous topic :: View next topic |
| Author |
Message |
suckershake How do I cheat?
Reputation: 0
Joined: 30 Oct 2013 Posts: 8
|
Posted: Sun Nov 17, 2013 7:21 am Post subject: Error attempt to concatenate global |
|
|
Error:[string "Offsets =..."]:23: attempt to concatenate global 'TempResult' (a userdata value)
| Code: | Offsets =
{
Offset1 = "XX XX XX XX XX XX",
Offset2 = "XX XX XX XX XX XX",
Offset3 = "XX XX XX XX XX XX"
}
function DECtoHEX(IN)
if IN<=0 then
return '0'
end
local B,K,OUT,I,D=16,"0123456789ABCDEF","",0
while IN>0 do
I=I+1
IN,D=math.floor(IN/B),math.mod(IN,B)+1
OUT=string.sub(K,D,D)..OUT
end
return OUT
end
function Format(count)
[b]local ReadBytes = readBytes(TempResult..'+count',1,true);[/b]
for _,String in pairs(ReadBytes) do
local Hex = DECtoHEX(String);
if Hex:len()==1 then
Hex = '0' .. Hex;
end
ReadBytes[_] = Hex;
end
return ReadBytes
end
for key,value in pairs(Offsets) do
TempResult=AOBScan(value)
local Result = (unpack(Format(7))..unpack(Format(6))..unpack(Format(5))..unpack(Format(4)))
print(key..": 0x"..Result)
end |
the Format(7) to Format(4) stuff is to print the offset in the right order. Reversing the Bytes.
(and the ; are there cuz of copypaste)
This is not supposed to be the final version, but I have no clue how to make this error go away.
Go away stupid error! |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25818 Location: The netherlands
|
Posted: Sun Nov 17, 2013 9:46 am Post subject: |
|
|
AOBScan doesn't return a string, but a Stringlist object instead, or nil if no results.
if results are found, you can access the first string, using TempResult[0] _________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
suckershake How do I cheat?
Reputation: 0
Joined: 30 Oct 2013 Posts: 8
|
Posted: Sun Nov 17, 2013 2:07 pm Post subject: |
|
|
... Can't believe how long I've been going at this stuff... I guess that's what happens when you make a stupid mistake and copypaste it all the time
Getting
Error:Failure determining what 002367AB+count means
now though... |
|
| Back to top |
|
 |
daspamer Grandmaster Cheater Supreme
Reputation: 54
Joined: 13 Sep 2011 Posts: 1588
|
Posted: Sun Nov 17, 2013 2:10 pm Post subject: |
|
|
You put '+count'.
count now represents a string --> error, because c.e can't understand what is count.
Set only the + as string ('+') and leave count as a variable. _________________
I'm rusty and getting older, help me re-learn lua. |
|
| Back to top |
|
 |
suckershake How do I cheat?
Reputation: 0
Joined: 30 Oct 2013 Posts: 8
|
Posted: Sun Nov 17, 2013 3:27 pm Post subject: |
|
|
Thanks Now I can focus on properly learning some lua to optimize that crappy makeshift code. |
|
| Back to top |
|
 |
|