|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
byway How do I cheat? Reputation: 0
Joined: 26 Feb 2018 Posts: 4 Location: Peru
|
Posted: Sat Apr 14, 2018 10:29 pm Post subject: How to change values of the AA script |
|
|
hi...
I need help with this .. change values of the AA script in Lua.
I Use string.format and tostring ()
Code: |
function CECheckbox1Change(ItemFilter)
if ItemFilter.checked then
autoAssemble(string.format([[
alloc(ItemFilter,256)
alloc(ItemList,2048)
alloc(Mesos,4)
alloc(Mode,4)
label(Return)
label(End)
label(FilterMesos)
label(RejectOrAccept)
label(AcceptFilter)
label(RejectFilter)
label(Ignore)
Mesos:
dd #0 // Minimum meso
Mode:
dd #%s // 0 = Accept, 1 = reject
ItemList:
%s
dd 00 // End of list
ItemFilter:
push edx
mov edx,[Mesos]
cmp eax,edx
jle FilterMesos
mov edx,ItemList
jmp RejectOrAccept
FilterMesos:
mov [ebx+48],0
jmp End
RejectOrAccept:
cmp byte ptr [Mode],0
je AcceptFilter
cmp byte ptr [Mode],1
je RejectFilter
AcceptFilter:
cmp eax,[edx]
je End
cmp dword ptr [edx],0
je Ignore
add edx,4
jmp AcceptFilter
RejectFilter:
cmp eax,[edx]
je Ignore
cmp dword ptr [edx],0
je End
add edx,4
jmp RejectFilter
Ignore:
cmp eax,#50000 // Added this code otherwise mesos is dropped but not shown in accept mode
jle End
mov eax,0
End:
pop edx
mov ecx,edi // Original Opcode
mov [ebx+48],eax // Original Opcode
jmp Return
0108F40F:
jmp ItemFilter
Return:
]],tostring(UDF1.CEEdit1.Text),UDF1.CEMemo1.Lines.Text))
end
end
function ChangeFilterMode(FilterMode)
local value = tostring(UDF1.CEEdit1.Text)
if FilterMode.Checked then
writeBytes("Mode", value)
end
end
|
Values to be changed are:
Mode: it can be 1 or 0 from un textbox
ItemList: from Memo
dd # 2512226
dd # 2512227
dd # 2512228
dd # 2512229
dd # 2512230
dd # 2512231
I can not find the error. |
|
Back to top |
|
|
TheyCallMeTim13 Wiki Contributor Reputation: 50
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Sat Apr 14, 2018 10:59 pm Post subject: |
|
|
Code: | print(string.format('1: %s; 2: %s', tostring(1, 2))) |
Quote: | Error:[string "print(string.format('1: %s; 2: %s', tostring(..."]:1: bad argument #3 to 'format' (no value) |
Code: | print(string.format('1: %d; 2: %d', 1, 2)) |
_________________
|
|
Back to top |
|
|
byway How do I cheat? Reputation: 0
Joined: 26 Feb 2018 Posts: 4 Location: Peru
|
Posted: Sun Apr 15, 2018 4:59 pm Post subject: |
|
|
Code: | print(string.format('1: %d; 2: %d', 1, 2)) |
[/quote]
correct, but how to use it in the AA script
to edit the values within the AA script. |
|
Back to top |
|
|
TheyCallMeTim13 Wiki Contributor Reputation: 50
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Sun Apr 15, 2018 5:08 pm Post subject: |
|
|
Are you asking how to use "string.format" or is this a new question? _________________
|
|
Back to top |
|
|
byway How do I cheat? Reputation: 0
Joined: 26 Feb 2018 Posts: 4 Location: Peru
|
Posted: Sun Apr 15, 2018 5:24 pm Post subject: |
|
|
how to use it correctly because it does not work in this way
Code: |
autoAssemble(string.format([[
alloc(ItemList,2048)
alloc(Mode,4)
..
Mode:
dd #%s
ItemList:
%s
..
..
]],UDF1.CEEdit1.Text,UDF1.CEMemo1.Lines.Text))
|
Code: |
writeBytes("Mode", value)
|
|
|
Back to top |
|
|
TheyCallMeTim13 Wiki Contributor Reputation: 50
Joined: 24 Feb 2017 Posts: 976 Location: Pluto
|
Posted: Sun Apr 15, 2018 5:30 pm Post subject: |
|
|
Code: | print(type(UDF1.CEEdit1.Text))
print(UDF1.CEEdit1.Text)
print(type(UDF1.CEMemo1.Lines.Text))
print(UDF1.CEMemo1.Lines.Text) |
Code: |
print(string.format([[
alloc(ItemList,2048)
alloc(Mode,4)
Mode:
dd #%s
ItemList:
%s
]],UDF1.CEEdit1.Text,UDF1.CEMemo1.Lines.Text)) |
Run this and show your results. But I think for starters all the "\r" and "\n" will be trimmed (haven't tested but I remember running into this before).
EDIT:
A different way (the one I like to go), try this function:
Code: |
function interp(s, tbl)
if s == nil then return end
return (s:gsub('($%b{})', function(w) return tbl[w:sub(3, -2)] or w end))
end |
Code: | local s = [[
alloc(ItemList,2048)
alloc(Mode,4)
Mode:
dd #${Value}
ItemList:
${ItemList}
]]
local script = interp(s, { Value = UDF1.CEEdit1.Text, ItemList = UDF1.CEMemo1.Lines.Text })
autoAssemble(script) |
_________________
|
|
Back to top |
|
|
byway How do I cheat? Reputation: 0
Joined: 26 Feb 2018 Posts: 4 Location: Peru
|
Posted: Mon Apr 16, 2018 1:05 pm Post subject: |
|
|
thanks but apparently it does not work as it should be .. |
|
Back to top |
|
|
|
|
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
|
|