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 


box button that target process bug, keypress script bug

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
kentpachi1
Newbie cheater
Reputation: 0

Joined: 16 Jun 2014
Posts: 15

PostPosted: Fri Apr 19, 2024 2:42 am    Post subject: box button that target process bug, keypress script bug Reply with quote

Good day everyone, I pray anyone could help me on my simple problem.
I currently have 2 issues regarding lua script and cant find solution for this



first, the auto select process script is not working if there is a number on the process name

first this is the code
Code:

if getOpenedProcessID() then openProcess(getOpenedProcessID()) end

   dbk_writesIgnoreWriteProtection(true)
    
     function AOBRep(search, change)
   local aob = AOBScan(search)
   if aob then
     for i=0,aob.Count-1 do
       autoAssemble(aob[i]..':\ndb '..change)
     end
     aob.Destroy()
   end
   end

   EmuForm = createForm(true)
   EmuForm.Caption = 'Select Emulator'
   EmuForm.Width = 300
   EmuForm.Height = 60
    EmuForm.Left = 170
   
   function ld9player()
   emu= "Ld9BoxHeadless"
   startmenu()

   end
   
   EmuButton1 = createButton(EmuForm)
   EmuButton1.Left = 10
   EmuButton1.Top = 10
   EmuButton1.Width = 110
   EmuButton1.Height = 40
   EmuButton1.onClick = ld9player
   EmuButton1.Caption = 'ldplayer'


   
   
   function startmenu()
   local p = io.popen('tasklist /fi "IMAGENAME eq '..emu..'.exe" /fi "MEMUSAGE gt 30000" /nh', 'r');
   local procInfo = p:read('*a');
   
   local pid = procInfo:match('%d+');
   pid = tonumber(pid);
   
   
   if(pid == nil)then
   messageDialog("You Must Start The Game First!", mtWarning, mbOK)
   closeCE()
   else
   openProcess(pid)

theres a 1 button and if you press it, CE will attach on that process, it will work for example, if the name is pure words but in my case, its Ld9boxheadless, and it wont attached at all.








second issue lua script

I ahve an AoB changing, instead of pressing the button, i decide to set it on a key to activate but if if my script have 2 or more keys set, it wont work at all.

example code
Code:


   function oten()
   searchV = '?? ?? ?? ?? EC 51 A8 3D 00 C0 10 3F'
    replaceV = '?? ?? ?? ?? 00 00 00 40 00 00 00 3F'
    AOBRep(searchV,replaceV)
   

if drnkey then drnkey.Destroy() drnkey=nil end
drnkey = createHotkey(oten, VK_F1)      

   
   function bilat()
   searchV = '?? ?? ?? ?? 00 00 D8 42 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 00 00 40 00 0B D4 23 1E'
    replaceV = '?? ?? ?? ?? ?? ?? ?? ?? f4 fd 54 3c ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 25 06 81 3d'
    AOBRep(searchV,replaceV)   
    end   


if drnkey then drnkey.Destroy() drnkey=nil end
drnkey = createHotkey(bilat, VK_F2)      


in this example i have 2 AoB script
F1 and F2 but when i play the game and click F2, it doesnt activate at all, only the F1 script works.
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 33

Joined: 16 Feb 2017
Posts: 1307

PostPosted: Fri Apr 19, 2024 5:30 am    Post subject: Reply with quote

Check this out:



Code:
if getOpenedProcessID() then openProcess(getOpenedProcessID()) end

   dbk_writesIgnoreWriteProtection(true)

     function AOBRep(search, change)
   local aob = AOBScan(search)
   if aob then
     for i=0,aob.Count-1 do
       autoAssemble(aob[i]..':\ndb '..change)
     end
     aob.Destroy()
   end
   end

   if EmuForm then EmuForm.Destroy() end
   EmuForm = createForm(true)
   EmuForm.Caption = 'Select Emulator'
   EmuForm.Width = 300
   EmuForm.Height = 60
    EmuForm.Left = 170

   --function ld9player()
   emu = "cheatengine-x86_64"
   --startmenu()

   --end

   EmuButton1 = createButton(EmuForm)
   EmuButton1.Left = 10
   EmuButton1.Top = 10
   EmuButton1.Width = 110
   EmuButton1.Height = 40
   EmuButton1.Caption = 'ldplayer'




   function startmenu()
   local p = io.popen('tasklist.exe /fi "IMAGENAME eq '..emu..'.exe" /fi "MEMUSAGE gt 30000" /nh', 'r');
   local procInfo = p:read('*a');

   local pid = procInfo:match(' (%d+) ');
   pid = tonumber(pid);


   if(pid == nil)then
   messageDialog("You Must Start The Game First!", mtWarning, mbOK)
   --closeCE()
   else
   openProcess(pid)
   end
   end


EmuButton1.onClick = startmenu


and keys

Code:
if drnkey1 then drnkey1.Destroy() drnkey1=nil end
drnkey1 = createHotkey(oten, VK_F1)

if drnkey2 then drnkey2.Destroy() drnkey2=nil end
drnkey2 = createHotkey(bilat, VK_F2)

if drnkey3 then drnkey3.Destroy() drnkey3=nil end
drnkey3 = createHotkey(whatewer, VK_F3)

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
kentpachi1
Newbie cheater
Reputation: 0

Joined: 16 Jun 2014
Posts: 15

PostPosted: Fri Apr 19, 2024 7:41 am    Post subject: Reply with quote

AylinCE wrote:
Check this out:



Code:
if getOpenedProcessID() then openProcess(getOpenedProcessID()) end

   dbk_writesIgnoreWriteProtection(true)

     function AOBRep(search, change)
   local aob = AOBScan(search)
   if aob then
     for i=0,aob.Count-1 do
       autoAssemble(aob[i]..':\ndb '..change)
     end
     aob.Destroy()
   end
   end

   if EmuForm then EmuForm.Destroy() end
   EmuForm = createForm(true)
   EmuForm.Caption = 'Select Emulator'
   EmuForm.Width = 300
   EmuForm.Height = 60
    EmuForm.Left = 170

   --function ld9player()
   emu = "cheatengine-x86_64"
   --startmenu()

   --end

   EmuButton1 = createButton(EmuForm)
   EmuButton1.Left = 10
   EmuButton1.Top = 10
   EmuButton1.Width = 110
   EmuButton1.Height = 40
   EmuButton1.Caption = 'ldplayer'




   function startmenu()
   local p = io.popen('tasklist.exe /fi "IMAGENAME eq '..emu..'.exe" /fi "MEMUSAGE gt 30000" /nh', 'r');
   local procInfo = p:read('*a');

   local pid = procInfo:match(' (%d+) ');
   pid = tonumber(pid);


   if(pid == nil)then
   messageDialog("You Must Start The Game First!", mtWarning, mbOK)
   --closeCE()
   else
   openProcess(pid)
   end
   end


EmuButton1.onClick = startmenu


and keys

Code:
if drnkey1 then drnkey1.Destroy() drnkey1=nil end
drnkey1 = createHotkey(oten, VK_F1)

if drnkey2 then drnkey2.Destroy() drnkey2=nil end
drnkey2 = createHotkey(bilat, VK_F2)

if drnkey3 then drnkey3.Destroy() drnkey3=nil end
drnkey3 = createHotkey(whatewer, VK_F3)


well done all working perfectly, thank you
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions 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