|
You last visited: Today at 00:49
Advertisement
Getting the process ID using AutoIt.
Discussion on Getting the process ID using AutoIt. within the CO2 Programming forum part of the Conquer Online 2 category.
11/01/2010, 23:33
|
#1
|
elite*gold: 0
Join Date: Sep 2010
Posts: 27
Received Thanks: 0
|
Getting the process ID using AutoIt.
Currently I have to get the PID from memory and change the script on a per-login basis. Can anyone tell me why this AutoIt method isn't working:
Code:
$pid = WinGetProcess("[Conquer Online]")
|
|
|
11/01/2010, 23:47
|
#2
|
elite*gold: 20
Join Date: Mar 2008
Posts: 3,940
Received Thanks: 2,212
|
WinGetProcess needs the correct window name/handle, are you sure the window name is [Conquer Online] ?
Try this just for a test.
Code:
$hWnd = WinGetHandle("[Conquer Online]")
If WinExists($hWnd) Then
$vPID = WinGetProcess($hWnd)
MsgBox(0, "", $vPID)
Else
MsgBox(0, "", "Window not found")
EndIf
|
|
|
11/02/2010, 00:09
|
#3
|
elite*gold: 0
Join Date: Sep 2010
Posts: 27
Received Thanks: 0
|
Quote:
Originally Posted by theoneofgod
WinGetProcess needs the correct window name/handle, are you sure the window name is [Conquer Online] ?
Try this just for a test.
Code:
$hWnd = WinGetHandle("[Conquer Online]")
If WinExists($hWnd) Then
$vPID = WinGetProcess($hWnd)
MsgBox(0, "", $vPID)
Else
MsgBox(0, "", "Window not found")
EndIf
|
Using your code outputs a PID for a process called "SciTE.exe" regardless of what text you put in "WinGetHandle(" HERE")".
Edit: Using "$pid = WinGetProcess("[Conquer2.0]")" or even "$pid = WinGetProcess("[Conquer Online: Raiding Clans]")" worked flawlessly in the past. I think maybe "[Conquer Online]" is what is showing up in the taskbar and the actual process name is different. Why can't they just keep the name the same?
|
|
|
11/02/2010, 00:33
|
#4
|
elite*gold: 20
Join Date: Mar 2008
Posts: 3,940
Received Thanks: 2,212
|
Try this one...
Code:
$hWnd = "[Conquer Online]"
If WinExists($hWnd) Then
$vPID = WinGetProcess($hWnd)
MsgBox(0, "", $vPID)
Else
MsgBox(0, "", "Window not found")
EndIf
|
|
|
11/02/2010, 00:44
|
#5
|
elite*gold: 0
Join Date: Sep 2010
Posts: 27
Received Thanks: 0
|
Quote:
Originally Posted by theoneofgod
Try this one...
Code:
$hWnd = "[Conquer Online]"
If WinExists($hWnd) Then
$vPID = WinGetProcess($hWnd)
MsgBox(0, "", $vPID)
Else
MsgBox(0, "", "Window not found")
EndIf
|
This one worked like a charm. Now the only issue is "[Conquer Online]" isn't the process name. That said is there anyway one can get the exact name of a process using knowing the PID number.
|
|
|
11/02/2010, 01:05
|
#6
|
elite*gold: 20
Join Date: Mar 2008
Posts: 3,940
Received Thanks: 2,212
|
Code:
$vPID = 1111 ; your PID here
$vRet = _PIDGetProcessName($vPID)
MsgBox(0,"",$vRet)
Func _PIDGetProcessName($vPID)
$aProcesslist = ProcessList()
For $i = 1 To $aProcesslist[0][0]
If $aProcesslist[$i][1] = $vPID Then Return $aProcesslist[$i][0]
Next
EndFunc ;==>_PIDGetProcess
; returns = 0 (pid does not exist)
|
|
|
11/02/2010, 02:03
|
#7
|
elite*gold: 0
Join Date: Sep 2010
Posts: 27
Received Thanks: 0
|
Quote:
Originally Posted by theoneofgod
Code:
$vPID = 1111 ; your PID here
$vRet = _PIDGetProcessName($vPID)
MsgBox(0,"",$vRet)
Func _PIDGetProcessName($vPID)
$aProcesslist = ProcessList()
For $i = 1 To $aProcesslist[0][0]
If $aProcesslist[$i][1] = $vPID Then Return $aProcesslist[$i][0]
Next
EndFunc ;==>_PIDGetProcess
; returns = 0 (pid does not exist)
|
Returns "Conquer.exe". Tried making "Conquer.exe" the name in your code above to find the PID and comes back as before "window not found".
|
|
|
11/02/2010, 02:17
|
#8
|
elite*gold: 20
Join Date: Mar 2008
Posts: 3,940
Received Thanks: 2,212
|
Conquer.exe is not a window.
|
|
|
11/02/2010, 02:26
|
#9
|
elite*gold: 0
Join Date: Sep 2010
Posts: 27
Received Thanks: 0
|
Quote:
Originally Posted by theoneofgod
Conquer.exe is not a window.
|
I know it isn't. I want to find the window name of a running Conquer client. "[Conquer Online]" doesn't want to work so need to discover what that actual window name is.
|
|
|
11/02/2010, 02:41
|
#10
|
elite*gold: 20
Join Date: Mar 2008
Posts: 3,940
Received Thanks: 2,212
|
Code:
$vPID = 3560
MsgBox(0, "", _ProcessGetWin($vPID))
Func _ProcessGetWin($vPID)
$aWinlist = WinList()
For $i = 1 To $aWinlist[0][0]
If $vPID = WinGetProcess($aWinlist[$i][0]) Then Return $aWinlist[$i][0]
Next
EndFunc ;==>_ProcessGetWin
|
|
|
11/02/2010, 02:49
|
#11
|
elite*gold: 0
Join Date: Sep 2010
Posts: 27
Received Thanks: 0
|
Quote:
Originally Posted by theoneofgod
Code:
$vPID = 3560
MsgBox(0, "", _ProcessGetWin($vPID))
Func _ProcessGetWin($vPID)
$aWinlist = WinList()
For $i = 1 To $aWinlist[0][0]
If $vPID = WinGetProcess($aWinlist[$i][0]) Then Return $aWinlist[$i][0]
Next
EndFunc ;==>_ProcessGetWin
|
When I use the PID of the Conquer client it returns "0" but any other application is returns the proper window name. I might just end up needing to enter the PID and recompiling my script on an as-needed basis. Pretty much all I'm making is an auto-hp script that pots at a given health and automatically dose the XP skill for me.
It's a "Conquer Clicky" rip-off but programmed as a macro to pot and do xp skills. I could just use Joek's but his doesn't currently auto-pot and I've been sent to botjail twice with his macro. So kinda want to play it safe and use something I know wont land me in the slammer.
|
|
|
11/02/2010, 10:43
|
#12
|
elite*gold: 0
Join Date: Feb 2006
Posts: 151
Received Thanks: 58
|
cant you just use active window prolly not the best method but always worked for me.
something like...
PHP Code:
MsgBox(4096, "Get PID","Select the CO window you wish to use then click ok")
Sleep(1000)
GetPID()
Func GetPID()
$pid = WinGetProcess("[ACTIVE]") .......
blah de blah...
|
|
|
11/02/2010, 16:43
|
#13
|
elite*gold: 0
Join Date: Sep 2010
Posts: 27
Received Thanks: 0
|
Quote:
Originally Posted by trash
cant you just use active window prolly not the best method but always worked for me.
something like...
PHP Code:
MsgBox(4096, "Get PID","Select the CO window you wish to use then click ok")
Sleep(1000)
GetPID()
Func GetPID()
$pid = WinGetProcess("[ACTIVE]") .......
blah de blah...
|
I could give that a whirl :P.
|
|
|
 |
Similar Threads
|
[AutoIt]Process-Hiding Tool
03/15/2013 - Coding Releases - 25 Replies
Nun, ich hatte Langeweile... Außerdem weiß ich nicht, wo ichs reinstellen soll, deswegen einfach mal hier.
Hier mal ein kleines Tool, das einfach nur einen Prozess versteckt. Dabei habe ich dann noch ein paar kleine Funktionen rein gebaut. Dabei handelt es sich um folgendes:
Im Kontextmenü lässt sich die Option "Run and Hide..." auswählen. Wenn man diese Option anklickt, wird dieser Prozess gestartet und automatisch danach sofort versteckt, sodass ihn kein Prozess Explorer oder der...
|
Mit Process Explorer /Process Hacker Hs umgehen
05/22/2010 - General Gaming Discussion - 1 Replies
Ich habe hier im Forum gelesen, das man mit Process Explorer bzw. Process Hacker das HS umgehen kann. Leider ist mir irgendwie schleierhaft wie das gehen soll. Vllt erbarmt sich jemand und erklärt es (:, da man den sogenannten Bypasser nur noch las Premium Dings Da bei Upload.to runterladen kann :rolleyes:
|
C# how to pause a process/freeze process
12/08/2008 - CO2 Programming - 2 Replies
ya so i was semi bored and after little bit of looking around i didnt find to many examples of how to do this so attached is a demo project to show you how.
basically it comes down to calling ResumeThread() and SuspendThread() (API functions) on all the threads of a process...simple enough
http://img388.imageshack.us/img388/9762/exampleil 6.png
please note when you enter the process name there's no ".exe" to the end
Warning: this isn't idiot proof
.
.
|
All times are GMT +1. The time now is 00:49.
|
|