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 


Game running status

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

Joined: 03 May 2016
Posts: 7

PostPosted: Tue May 03, 2016 11:15 am    Post subject: Game running status Reply with quote

Hi,
at many trainer we can see a part about game ruining status that according processor name display status of game (the game running or no)
can you please explain how can i add this part to my trainer.(detect processor id)

Thank you
Back to top
View user's profile Send private message
showian
How do I cheat?
Reputation: 0

Joined: 03 May 2016
Posts: 7

PostPosted: Wed May 11, 2016 3:39 am    Post subject: Reply with quote

any idea??????
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Wed May 11, 2016 3:43 am    Post subject: Reply with quote

you could use a timer that checks the result of getOpenedProcessID() and if it returns something else than 0 the process has been opened.

Of use a timer to read out a known location(e.g readInteger("ntdll.dll") ). If it fails, (returns nil) then it's not opened, else it's open

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Wed May 11, 2016 3:46 am    Post subject: Reply with quote

Code:
function myattach(timer)
  t.Enabled = false
  if getProcessIDFromProcessName("<Game.exe>") ~= nil then
    --getAutoAttachList().add("<Game.exe>")
    repeat
      OpenProcess("<Game.exe>")
    until readInteger("<Game.exe>") ~= nil;
    CETrainer.lbl_process.Font.Color = 0x00ff00   --green
    CETrainer.lbl_process.Caption = "<Game.exe> running"
    t.OnTimer = mycheck
  end
  t.Enabled = true
end

function mycheck(timer)
  t.Enabled = false
  if getProcessIDFromProcessName("<Game.exe>") == nil then
    CETrainer.lbl_process.Font.Color = 0x0000ff   --red
    CETrainer.lbl_process.Caption = "<Game.exe> not running"
    t.OnTimer = myattach
  end
  t.Enabled = true
end

f=createForm(false) --create an invisible window
t=createTimer(f);
t.Interval = 10
t.OnTimer = myattach

You could do something like this on the trainer.
Back to top
View user's profile Send private message
showian
How do I cheat?
Reputation: 0

Joined: 03 May 2016
Posts: 7

PostPosted: Mon May 16, 2016 3:07 pm    Post subject: Reply with quote

thank you i added a label "lbl_process" to my trainer but its not worked

its should be something like
Code:
if openProcess("game.exe") then
  printMessage("Game running") // i dont know to print it in label
else
  printMessage("game not running")
end


and how can i make it flash(winker) colorful text like this
Code:
d19265538.consolebackup.'add com here'/?y=dd8a1e46&x=4g5MVuvMPeaGDeNT5jL7GJv2WzKsxsCuk6f8DsmXXvsTSPiIf48K56vhoSvoAor8EIKqQp9otncoCpy5Y68EVk6s4lNA%2FmHz8JsVugOA2%2Bfk7Tl83Mmc2D5rMLg%2Fv4Lgnu0Bu5LTn4VluK0MnkH43KQ%2BaCaoNO%2FI5qxd3AkLlug%3D

remove quests and add com ,because i cant post url
Back to top
View user's profile Send private message
sjl002
Master Cheater
Reputation: 0

Joined: 31 Aug 2013
Posts: 305

PostPosted: Sat Jun 11, 2016 5:25 am    Post subject: Reply with quote

you can add this script to your lua script:

Code:
local color = 0
  for i=0,3 do
    color = color * 10 + math.random(255)
  end
  UDF1.CELabel1.Font.Color = color
end


this script for randomize color.
-------------------------------------------------------------------
or you can add this to your lua script:

Code:
function InitLabel( form, x, y, text )
local label = createLabel( form );
if( label == nil ) then
return nil;
end

control_setCaption( label, text );
control_setPosition( label, x, y );
return label;
end
local form = createForm(true);
label = InitLabel(form , 50 , 100 , "Hello Cheat Engine WOrld ")
labelFont=control_getFont(label)
font_setColor(labelFont, 65535 )
function rep()
local labelFont=control_getFont(label)
if ( font_getColor(labelFont) == 65535 ) then
font_setColor(labelFont, 255 )
else
font_setColor(labelFont, 65535 )
end
end

local t = createTimer(nil) -- it will create a Timer object and assign it to variable t.
timer_onTimer(t, rep) -- The function repeat will be called every 3 seconds.
timer_setInterval(t,100) --Call repeat() every 3 seconds
timer_setEnabled(t, true) -- Set timer to true. If false is passed as argument then it will disable timer object.


this is second script.
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