[REQUEST] AutoIt Script

06/23/2012 20:07 CantShutMyMouth#1
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 Freddy​#2
PHP Code:
While 1
   
If Not ProcessExists("firefox.exe"Then
      MsgBox
(0,"","")
      
ExitLoop
   
EndIf
   
Sleep(200)
WEnd 
06/23/2012 22:22 KDeluxe#3
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 CantShutMyMouth#4
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?:D
06/24/2012 12:04 KDeluxe#5
How could we help you, if you do nothing?


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 CantShutMyMouth#6
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 :D
06/25/2012 08:06 Hybrid~#7
Quote:
Originally Posted by CantShutMyMouth View Post
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 :D
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 CantShutMyMouth#8
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. :D


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 :D
06/25/2012 15:15 Lumi#9
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 CantShutMyMouth#10
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"31475192124)
$Button1 GUICtrlCreateButton("Nu opri BOB-ul!"241610020)
$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 $ExistsThen $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 KDeluxe#11
Copy&Paste != learning
07/01/2012 01:09 Logtetsch#12
Quote:
Originally Posted by KDeluxe View Post
Copy&Paste != learning
Hmmmm :rolleyes: Wenn die Leute es nötig haben...