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 


Skip command for cheat,engine

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
moussahp2
How do I cheat?
Reputation: 0

Joined: 09 Nov 2022
Posts: 6

PostPosted: Wed Nov 09, 2022 11:52 pm    Post subject: Skip command for cheat,engine Reply with quote

Hello CE community
i have an issue i am doing aob search for some headers and writing bytes to some addresses but some times the first aobis not loaded so CE w'ont
continue to excute next aob search for example
Error:[string "dbk_initialize()
..."]:636: attempt to index a function value (global 'four')
and it stops here
IS it possible to skip first value and move to next if not found
as this
local aob = AOBScan(...)

if aob then
-- run code
end

-- alternative:
if not aob then
skip or move next -- skip if aob not found
end
please if you knw solution to this help me really needed


Last edited by moussahp2 on Thu Nov 10, 2022 2:29 pm; edited 1 time in total
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4289

PostPosted: Wed Nov 09, 2022 11:57 pm    Post subject: Reply with quote

The solution is to handle the error properly instead of ignoring it.
Code:
local whatever = AOBScan(...)

if whatever then
  -- only run code if the aob exists
end

-- alternative:
if not whatever then
  return  -- exit if aob not found
end

_________________
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
moussahp2
How do I cheat?
Reputation: 0

Joined: 09 Nov 2022
Posts: 6

PostPosted: Thu Nov 10, 2022 1:30 am    Post subject: Reply with quote

it not really an error it means 1st aob not loaded yet
here is an example of what i want
dbk_initialize(true)
dbk_useKernelmodeOpenProcess(true)
dbk_useKernelmodeProcessMemoryAccess(true)
dbk_writesIgnoreWriteProtection(true)

--============================================================
--AOB REPLACE FUNCTION
function AOBRep(search, change)
local aob = AOBScan(search)
if aob then
for i=0,aob.Count-1 do
autoAssemble(aob[i]..':\ndb '..change)
end
if not aob then
return -- exit if aob not found
end
end
end
--============================================================
EmuSelection = createForm(true)
EmuSelection.Caption = 'lib PATCH'
EmuSelection.Width = 140
EmuSelection.Height = 150
--============================================================
--FUNCTION WHEN GAMELOOP IS SELECTED

function gameloop()
speak('Gameloop Selected')
emu= "aow_exe"
startmenu()
EmuSelection.hide()
end
--============================================================
GameloopSel = createButton(EmuSelection)
GameloopSel.Left = 12
GameloopSel.Top = 17
GameloopSel.Width = 110
GameloopSel.Height = 33
GameloopSel.onClick = gameloop
GameloopSel.Caption = 'lib-release'
--============================================================
--============================================================
function startmenu()
local p = io.popen('tasklist /fi "IMAGENAME eq '..emu..'.exe" /fi "MEMUSAGE gt 300000" /nh', 'r');
local procInfo = p:read('*a');
p:close();
local pid = procInfo:match('%d+');
pid = tonumber(pid);
if(pid == nil)then
showMessage("Process not identified. Either Stuck on Logo or not running")

else
openProcess(pid)
MyForm = createForm(true)
speak('Main Menu')
MyForm.Caption = 'Private Antiban'
MyForm.Width = 300
MyForm.Height = 300
MyForm.Color = 0x000000
MyForm.setOnClose(FormClose)
--============================================================
shl = createLabel(MyForm)
shl.Caption= 'TENCENT Patch'
shl.Left = 15
shl.Top = 15
shl.Font.Color= 0x00FF00

shbo = createButton(MyForm)
shbo.Left = 180
shbo.Top = 15
shbo.Width = 50
shbo.Height = 30
shbo.onClick = TENCENT
shbo.Caption = 'On'

--============================================================
shl = createLabel(MyForm)
shl.Caption= 'lobby Patch'
shl.Left = 15
shl.Top = 50
shl.Font.Color= 0x00FF00

shbo = createButton(MyForm)
shbo.Left = 180
shbo.Top = 50
shbo.Width = 50
shbo.Height = 30
shbo.onClick = lobby
shbo.Caption = 'On'
end
end
--============================================================

function TENCENT()
Tersafe = AOBScan("7F 45 4C 46 01 01 01 00 00 00 00 00 00 00")

for enummex=0, Tersafe.Count-1 do
LOL = tonumber(Tersafe[enummex], 16);
print(LOL)
writeBytes(LOL+0x271EDC,0x00, 0x20 , 0x70, 0x47);



end

LIBUE4 = AOBScan("7F 45 4C 46 01 01 01 00 00 00 00 00 00 00")

for enummex=0, LIBUE4.Count-1 do
RUN = tonumber(LIBUE4[enummex], 16);
print(RUN)

writeBytes(writeBytes(RUN +0x43206,0x00,0x20, 0x70,0x47);

i want if the first aob not found so move to the next one
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 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