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 


trainer failure to hook the game

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
mben
Newbie cheater
Reputation: 0

Joined: 20 Jan 2018
Posts: 14

PostPosted: Sun Jan 21, 2018 6:55 pm    Post subject: trainer failure to hook the game Reply with quote

hello everybody, i am making my first trainer with lua and custom form, everything works fine until i export my trainer like .exe standalone, for some weird reason my trainer dont load and show this message

in pop window
failure loading the trainer. reason this is a not valid cheat table(error executing this table's lua script: undefined lua error)

output window:
error:failure determining what BH6.exe means

it seems the trainer in stand alone cant find and hook the game

this is the function i am using to attach the process
Code:

function myattach(timer)
  if getProcessIDFromProcessName("BH6.exe") ~= nil then
    object_destroy(timer)
    --print("proceso abierto")
    openProcess("BH6.exe")
    sleep(2000)
    form_show(UDF1)
   end
end

t=createTimer(nil);
timer_setInterval(t,6000)
timer_onTimer(t,myattach)


any idea why is this happening?
thanks in advance
Back to top
View user's profile Send private message
sumnice22
How do I cheat?
Reputation: 0

Joined: 31 Mar 2021
Posts: 1

PostPosted: Fri Apr 02, 2021 1:16 pm    Post subject: Reply with quote

I'm having exactly the same issue, I've tried everything but it wont work, the only way is to open cheat engine, hook the game manually and run the script.
Back to top
View user's profile Send private message
ByTransient
Expert Cheater
Reputation: 5

Joined: 05 Sep 2020
Posts: 240

PostPosted: Fri Apr 02, 2021 1:54 pm    Post subject: Reply with quote

This works for me. Wink

Code:
UDF1.hide()

function myattach(timer)
  if getProcessIDFromProcessName("chrome.exe") ~= nil then
    openProcess("chrome.exe")
    showMessage("proceso abierto");
    sleep(2000)
    UDF1.show()
    object_destroy(timer)
    else
    showMessage("No se encontró el juego. Primero abre el juego.");
    object_destroy(timer)
  --closeCE();
  --return caFree --Possible options: caHide, caFree, caMinimize, caNone

   end
end

t=createTimer(nil);
timer_setInterval(t,6000)
timer_onTimer(t,myattach)
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 Lua Scripting 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