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 


Help for trainer and process

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

Joined: 05 Jun 2014
Posts: 86

PostPosted: Sun Oct 19, 2014 2:50 pm    Post subject: Help for trainer and process Reply with quote

Hello i have problem with my trainer, my game have two same process and trainer open wrong process. I saw this tutorial I do not understand


Code:
local target = "abc.exe";
local f = io.popen( string.format( "TASKLIST /FI \"IMAGENAME eq %s\" /FO csv", target ) );
assert( f, "Failed to obtain results from TASKLIST.exe!" );

-- Do work here..

f:close();


You can then parse each line returned like this:

Code:

for x in f:lines() do
-- Strip the header line so we don't try to read it as a process..
local input = string.gsub( x, "(.*),\"Mem Usage\"", '' );
if string.len( input ) > 0 then
local parts = input:split( "[^,]+" );
print( #parts );
print( parts[1] ); -- prints the process name
print( parts[2] ); -- prints the process id
end
end


Using the string:split function from:

Code:

string.split = function(str, pattern)
pattern = pattern or "[^%s]+"
if pattern:len() == 0 then pattern = "[^%s]+" end
local parts = {__index = table.insert}
setmetatable(parts, parts)
str:gsub(pattern, parts)
setmetatable(parts, nil)
parts.__index = nil
return parts
end
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