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 


SHARING SHORT SCRIPT

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
MateeJr GT
Advanced Cheater
Reputation: 0

Joined: 24 Dec 2017
Posts: 66

PostPosted: Sun Feb 04, 2018 2:09 am    Post subject: SHARING SHORT SCRIPT Reply with quote

This Script is for CELabel Text is tell the game is attached or processed

here :
Code:

if openProcess("{Your Game Here.exe}") then
UDF1.CELabel1.Caption = 'Attached'
else
UDF1.CELabel1.Caption = 'Not Attached
end'

_________________
Hi Lynxz Gaming
Back to top
View user's profile Send private message
exohaxor
Expert Cheater
Reputation: 1

Joined: 02 Sep 2018
Posts: 101

PostPosted: Mon Feb 18, 2019 12:48 pm    Post subject: Reply with quote

fixing for copy pasters
Code:


if openProcess("{Your Game Here.exe}") then
UDF1.CELabel1.Caption = 'Attached'
else
UDF1.CELabel1.Caption = 'Not Attached'
end
Back to top
View user's profile Send private message
Optimusik
How do I cheat?
Reputation: 0

Joined: 29 Sep 2018
Posts: 2

PostPosted: Tue Feb 19, 2019 6:14 am    Post subject: Reply with quote

("{Your Game Here.exe}")
is there really need in brackets? {}
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Tue Feb 19, 2019 7:44 am    Post subject: This post has 1 review(s) Reply with quote

Is there really need in parens? ()

No, lua is perfectly happy accepting openProcess'proc.exe'. But it can be clearer to some people so there's no harm in having them.

You can also do something like

UDF1.CELabel1.Caption = (not openProcess("{Your Game Here.exe}") and 'Not ' or '') .. 'Attached'
and
UDF1.CELabel1.Caption = openProcess("Your Game Here.exe") and 'Attached' or 'Not Attached'
Or if you set the label to say 'Not Attached' in the editor/creation by default then you can just have a simple if
if openProcess("{Game.exe}") then UDF1.CELabel1.Caption = 'Attached' end

_________________
https://github.com/FreeER/ has a few CE related repos
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