|
You last visited: Today at 00:11
Advertisement
[REQUEST] AutoIt Script
Discussion on [REQUEST] AutoIt Script within the AutoIt forum part of the Coders Den category.
06/23/2012, 20:07
|
#1
|
elite*gold: 0
Join Date: Apr 2012
Posts: 380
Received Thanks: 163
|
[REQUEST] AutoIt Script
Hey,i'm new at AutoIt and i need ascript that do something wwhen a proces close.
I tried this,but didint worked:
If ProcessClose("iexplore.exe") then MsgBox(1,"sada","dwqda")
Can someone help me?
|
|
|
06/23/2012, 20:17
|
#2
|
elite*gold: 0
Join Date: Mar 2011
Posts: 8,645
Received Thanks: 3,454
|
PHP Code:
While 1 If Not ProcessExists("firefox.exe") Then MsgBox(0,"","") ExitLoop EndIf Sleep(200) WEnd
|
|
|
06/23/2012, 22:22
|
#3
|
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,149
|
Code:
$Process = "iexplore.exe"
$Exists = False
While Sleep(10)
If ProcessExists($Process) And Not $Exists Then $Exists = True
If $Exists And Not ProcessExists($Process) Then
;...
$Exists = False
EndIf
WEnd
|
|
|
06/24/2012, 08:38
|
#4
|
elite*gold: 0
Join Date: Apr 2012
Posts: 380
Received Thanks: 163
|
Thanks Both.
There's another request:
If i have a process like iexplore.exe do nothing but if another iexplore.exe opens then auto close it.
Can someone help me with this script?
|
|
|
06/24/2012, 12:04
|
#5
|
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,149
|
How could we help you, if you do nothing?
Code:
$Process = "iexplore.exe"
$ProcessId = 0
$Exists = False
While Sleep(10)
If Not $Exists Then $ProcessId = ProcessExists($Process)
If ($ProcessId > 0) And (Not $Exists) Then $Exists = True
If ($Exists) And (Not ProcessExists($ProcessId)) Then
$Exists = False
ElseIf ($Exists) And (ProcessExists($ProcessId)) Then
$ProcessList = ProcessList($Process)
If $ProcessList[0][0] > 1 Then
For $i = 1 To $ProcessList[0][0]
If $ProcessList[$i][1] <> $ProcessId Then
ProcessClose($ProcessList[$i][1])
EndIf
Next
EndIf
EndIf
WEnd
The IE creates a new child process for each tab. If you run the IE, there will be two tabs and two processes. If you close one, the other one will be closed too. It's easy to change that, but it's your turn now.
|
|
|
06/24/2012, 14:37
|
#6
|
elite*gold: 0
Join Date: Apr 2012
Posts: 380
Received Thanks: 163
|
Thanks a lot Kdeluxe.
Actually my program doesn't start 2 processes,so your script was enough without any changes,only the $Process.
But i want to learn,so i will try to make it work to iexplore.exe too.
I just love to learn AutoIt,hope in 1 year i will know enough to make my own scripts
|
|
|
06/25/2012, 08:06
|
#7
|
elite*gold: 0
Join Date: Jan 2012
Posts: 1,458
Received Thanks: 1,407
|
Quote:
Originally Posted by CantShutMyMouth
Thanks a lot Kdeluxe.
Actually my program doesn't start 2 processes,so your script was enough without any changes,only the $Process.
But i want to learn,so i will try to make it work to iexplore.exe too.
I just love to learn AutoIt,hope in 1 year i will know enough to make my own scripts 
|
You just needa read the help file few times... Make some newb scripts...after that go higher and higher
Try to compete with ya ... get higher and higher... Exceed ur limits :P
|
|
|
06/25/2012, 10:52
|
#8
|
elite*gold: 0
Join Date: Apr 2012
Posts: 380
Received Thanks: 163
|
Thanks Hybryd.
I made some begginer scripts before i started to those one... i made LuckyNumber game in AutoIt.
But i didn;t know how to make those one in this post,and i needed them,i didn't made then to learn.
Edit: What am I doing wrong here?:
PHP Code:
While (1)
If Not ProcessExists("crossfire_downloader.exe") then
MsgBox(1,"blah blah","blah blah")
If MsgBox(1,"blah blah","blah blah")then ProcessClose("explorer.exe")
If Not ProcessExists("explorer.exe") Then
MsgBox(1,"blah blah","blah blah")
EndIf
ExitLoop
Sleep(200)
WEnd
I know i can use strings,not this is the problem
|
|
|
06/25/2012, 15:15
|
#9
|
ベトナム警察
elite*gold: 0
Join Date: Jan 2012
Posts: 16,499
Received Thanks: 3,527
|
PHP Code:
While 1 If ProcessExists("crossfire_downloader.exe") Then MsgBox(1, "Windows Open", "Open") ProcessClose("explorer.exe") Else MsgBox(1, "Windows Closed", "Closed") EndIf
WEnd
Maybe you mean that?
|
|
|
06/30/2012, 20:23
|
#10
|
elite*gold: 0
Join Date: Apr 2012
Posts: 380
Received Thanks: 163
|
There is why i needed those scripts....to make this:
There is a hack called M2bob,and i've got a crack of it... But the crack has some bugs:
It opens more game clients,when i need only 1 client.
And,my little sister usually stop my bot when she come to PC,so i needed the ne with MsgBox when ProcessNotExists.
Now,this is how i used them,and that's what i learned in 2 weeks only.
PHP Code:
$Form1 = GUICreate("M2Bob helper", 314, 75, 192, 124) $Button1 = GUICtrlCreateButton("Nu opri BOB-ul!", 24, 16, 100, 20) $Button2 = GUICTRLCreateButton ("Doar un proces", 200,16,100,20) $Button3 = GUICTRLCREATEBUTTON ("Exit",120,50,100,20) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Button1 _Hack() Case $Button2 _Hack2() Case $button3 _Hack3() EndSwitch WEnd
Func _Hack() GUISetState(@SW_SHOW) While 1 If Not ProcessExists("M2Bob 1.3.2.exe") Then MsgBox(1,"Nu","Nu opri BOB-ul!!!!") ExitLoop EndIf Sleep(200) WEnd EndFunc
Func _Hack2() GUISetState(@SW_SHOW) $Process = "metin2client.bin" $ProcessId = 0 $Exists = False
While Sleep(10) If Not $Exists Then $ProcessId = ProcessExists($Process) If ($ProcessId > 0) And (Not $Exists) Then $Exists = True
If ($Exists) And (Not ProcessExists($ProcessId)) Then $Exists = False ElseIf ($Exists) And (ProcessExists($ProcessId)) Then $ProcessList = ProcessList($Process) If $ProcessList[0][0] > 1 Then For $i = 1 To $ProcessList[0][0] If $ProcessList[$i][1] <> $ProcessId Then ProcessClose($ProcessList[$i][1]) EndIf Next EndIf EndIf WEnd EndFunc
Func _Hack3() While 1 ProcessClose ("Bobhelper.exe") Wend EndFunc
Do you guys think is good for only 2 weeks of learning?
And a login bot made with no help
PHP Code:
Func _username() Send("username") EndFunc
Func _password() Send("pass") EndFunc While sleep(200) Hotkeyset("{F1}","_username") Hotkeyset("{F2}","_password") WEnd
I know those scripts are EASY ,but i'm using AutoIt for only 2 weeks....
|
|
|
07/01/2012, 01:05
|
#11
|
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,149
|
Copy&Paste != learning
|
|
|
07/01/2012, 01:09
|
#12
|
elite*gold: 192
Join Date: May 2009
Posts: 2,227
Received Thanks: 3,262
|
Quote:
Originally Posted by KDeluxe
Copy&Paste != learning
|
Hmmmm  Wenn die Leute es nötig haben...
|
|
|
Similar Threads
|
[Request] Battle Punks AutoIt-Script
08/26/2010 - Facebook - 1 Replies
Hi guys :)
This is a request cause i dont know how to build a workin AutoIt-Script.
I could use simple Mouserecorderthingys but every tool i tryed didnt worked at all.
so could some awesome AutoIt Scripter pls build a script for Battle Punkt which can:
Fight automaticly (Scans for Win or Loose)
If Loose -> get new set if enemys
Cooking food and use it after its ready
|
[Request] Simple AutoIt Script
06/26/2008 - Dekaron - 5 Replies
Hello, I'm looking for an autoit script that basically presses 1 2 3 4 5, one after the other every second continuously. Thanks in advance, EW.
|
All times are GMT +2. The time now is 00:11.
|
|