thenewcomer Newbie cheater Reputation: 0
Joined: 09 Mar 2013 Posts: 22 Location: Behind you
|
Posted: Sat Oct 26, 2013 8:08 pm Post subject: lua error |
|
|
ive been messing around some and found Code: | function DEC_HEX(IN)
local B,K,OUT,I,D=16,"0123456789ABCDEF","",0
if IN<1 then
OUT=0
return OUT
end
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 Aobswap(search, change)
aobs = AOBScan(search)
if(aobs ~= nil) then
j = stringlist_getCount(aobs)
--print("Found:",j);
for i = 1, j do
--print(stringlist_getString(aobs,i-1));
--66 ?? ?? d1 a1 68 ?? ?? d0 d0
address=stringlist_getString(aobs,i-1)
for i = 1, string.len(change), 3 do
z = string.sub(change, i, i+2)
x, y = string.find(z, "%?+")
if (x == nil) then
script=[[
]]..address.."+"..(DEC_HEX((i-1)/3))..[[:
db ]]..z..[[
]]
autoAssemble(script)
--print(z)
--print(address.."+"..(DEC_HEX((i-1)/3)))
end
end
end
object_destroy(aobs);
aobs=nil
end
end
| somewhere on the site and its very helpful. the problem im having is i want to make it portable, rather than needing it in the autorun folder. when i try to put it into a CT using the <LuaScript> it throws an error of "name starts with invalid character" and fails to load the cheat table. and if i remove the first function, it loads the table but i receive another error "attempt to call global 'DEC_HEX' (a nil value)" when trying to actually use it.
i know this would seem painfully obvious to most of you as to why it wont work, but im clueless. any help or information would be much appreciated
edit: ill put the whole table here in case you need it Code: | <?xml version="1.0" encoding="utf-8"?>
<CheatTable CheatEngineTableVersion="16">
<LuaScript>
function DEC_HEX(IN)
local B,K,OUT,I,D=16,"0123456789ABCDEF","",0
if IN<1 then
OUT=0
return OUT
end
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 Aobswap(search, change)
aobs = AOBScan(search, "+W")
if(aobs == nil) then AobSwapCheck=false else
j = stringlist_getCount(aobs)
for i = 1, j do
address=stringlist_getString(aobs,i-1)
for i = 1, string.len(change), 3 do
z = string.sub(change, i, i+2)
x, y = string.find(z, "%?+")
if (x == nil) then
script=[[
]]..address.."+"..(DEC_HEX((i-1)/3))..[[:
db ]]..z..[[
]]
autoAssemble(script)
end
end
end
object_destroy(aobs);
aobs=nil
AobSwapCheck=true
end
end
</LuaScript>
<CheatEntries>
<CheatEntry>
<ID>13</ID>
<Description>"Hacks"</Description>
<Color>A00000</Color>
<VariableType>Auto Assembler Script</VariableType>
<LuaScript>
aobresult=aobscan("8B 54 87 0C 89 95 ?? ?? FF FF 8B 85 ?? ?? FF FF 89 85 A0 F9 FF FF 8B 85 A0 F9 FF FF 83 40 44 FF")
if (aobresult~=nil) then
label(_typeOne)
registersymbol(_typeOne)
end
aobresult=aobscan("8B 54 87 0C 89 95 ?? ?? FF FF 8B 85 ?? ?? FF FF 89 85 A0 F9 FF FF 8B 85 A0 F9 FF FF FF 48 44")
if (aobresult~=nil) then
label(_typeTwo)
registersymbol(_typeTwo)
end
</LuaScript>
<AssemblerScript>[ENABLE]
LuaCall(Aobswap("8B 54 87 0C 89 95 ?? ?? FF FF 8B 85 ?? ?? FF FF 89 85 A0 F9 FF FF 8B 85 A0 F9 FF FF 83 40 44 FF","8B 54 87 0C 89 95 ?? ?? FF FF 8B 85 ?? ?? FF FF 89 85 A0 F9 FF FF 8B 85 A0 F9 FF FF 90 90 90 90"))
LuaCall(Aobswap("8B 54 87 0C 89 95 ?? ?? FF FF 8B 85 ?? ?? FF FF 89 85 A0 F9 FF FF 8B 85 A0 F9 FF FF FF 48 44","8B 54 87 0C 89 95 ?? ?? FF FF 8B 85 ?? ?? FF FF 89 85 A0 F9 FF FF 8B 85 A0 F9 FF FF 90 90 90"))
[DISABLE]
_typeOne+1C:
db 83 40 44 FF
_typeTwo+1C:
db FF 48 44
unregistersymbol(_typeOne)
unregistersymbol(_typeTwo)
</AssemblerScript>
</CheatEntry>
</CheatEntries>
<Comments>Info about this table:
</Comments>
</CheatTable>
|
double edit: i feel like it might have something to do with the variable type, but i have no idea how to fix it
_________________
-TNC |
|