Sign in to follow this  
Followers 0
Haveskillz

What the hey? (I am a blathering idiot)

11 posts in this topic

; Get the handle of the uninstall window
$handle = WinGetHandle("DiabloII", "")  
If @error Then
    exit
Else
$i = 0
Do

etc ,,,

If @error Then

i want it to skip to the next script is that possible ? :)

Share this post


Link to post
Share on other sites



what do you mean "skip to the next script" like an entirely new .au3 or just another section of this script?

Share this post


Link to post
Share on other sites

other section :)

Share this post


Link to post
Share on other sites

; add this to the top
Global $error

; Get the handle of the uninstall window
$handle = WinGetHandle("DiabloII", "")  
$error = 0
If @error Then
    $error = 1
Else
$i = 0
Do
Until
EndIf
While $error = 1
; INSERT HERE THE CODE

ExitLoop
WEnd

something like that maybe?

Share this post


Link to post
Share on other sites

AutoItSetOption("WinTitleMatchMode", 4) 

; Get the handle of the uninstall window
$handle = WinGetHandle("Diablo2", "")  
If @error Then
    exit
Else
$i = 0
Do
    
    


;   MsgBox(4096, "success", "The window handle is " & $handle)
  ; Send some text directly to this window's edit control
  ;ControlClick("handle=" & $handle, "", "", "left")
    sleep(4500)
    ControlSend("handle=" & $handle, "", "", "{ENTER}")
    sleep(40)
    ControlSend("handle=" & $handle, "", "", "{ENTER}")  
    sleep(100)
    $i = $i + 1  
    Until $i = 1

EndIf

AutoItSetOption("WinTitleMatchMode", 4) 

; Get the handle of the uninstall window
$handle = WinGetHandle("Diablo3", "")  
If @error Then
    exit
Else
$i = 0
Do
    
    


;   MsgBox(4096, "success", "The window handle is " & $handle)
  ; Send some text directly to this window's edit control
  ;ControlClick("handle=" & $handle, "", "", "left")
    sleep(4500)
    ControlSend("handle=" & $handle, "", "", "{ENTER}")
    sleep(40)
    ControlSend("handle=" & $handle, "", "", "{ENTER}")  
    sleep(100)
    $i = $i + 1  
    Until $i = 1

EndIf

etcetcetcetc

so that it skips to

AutoItSetOption("WinTitleMatchMode", 4)

of the next script.. thats what i meant :)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Re-reading posts

Try posting without profanity also, because a lot of kids come here.

Edit: Don't understand what you want. I'll let someone else answer your question.

Even though it's worthless when you give the worst description of what you need help with.

Edited by bucky002

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

remove the "exit" after If @error then so make it like:

If @error Then
Else
$i = 0
Do

it basically "says" if at error then, do nothing: else $i = 0 etc, since it "does nothing" it will skip to EndIf *IF* it has an error :)

-edit-

the Exit command will kill your script ( in your case, if its @error :( ) just FYI

Edited by 4gotn1

Share this post


Link to post
Share on other sites

that cost alot of time...

i need to skip it totally :/

now it still do the ControlSend part.. and that cost alot of time

isnt there a way.. that it SKIP the whole part till the next Section ?:)

Share this post


Link to post
Share on other sites

oke for the last time,, if you didnt understand it:

AutoItSetOption("WinTitleMatchMode", 4)

; Get the handle of the uninstall window
$handle = WinGetHandle("Diablo2", "")  
If @error Then 
    [b]SKIP[/b]
Else
$i = 0
Do
    
    


;   MsgBox(4096, "success", "The window handle is " & $handle)
 ; Send some text directly to this window's edit control
 ;ControlClick("handle=" & $handle, "", "", "left")
    sleep(4500)
    ControlSend("handle=" & $handle, "", "", "{ENTER}")
    sleep(40)
    ControlSend("handle=" & $handle, "", "", "{ENTER}")  
    sleep(100)
    $i = $i + 1  
    Until $i = 1

EndIf

[b]AND START HERE AGAIN[/b] AutoItSetOption("WinTitleMatchMode", 4)

; Get the handle of the uninstall window
$handle = WinGetHandle("Diablo3", "")  
If @error Then
    exit
Else
$i = 0
Do
    
    


;   MsgBox(4096, "success", "The window handle is " & $handle)
 ; Send some text directly to this window's edit control
 ;ControlClick("handle=" & $handle, "", "", "left")
    sleep(4500)
    ControlSend("handle=" & $handle, "", "", "{ENTER}")
    sleep(40)
    ControlSend("handle=" & $handle, "", "", "{ENTER}")  
    sleep(100)
    $i = $i + 1  
    Until $i = 1

EndIf

or something close to that... thanks :/

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

AutoItSetOption("WinTitleMatchMode", 4)

; Get the handle of the uninstall window
$handle = WinGetHandle("Diablo2", "")
While @error =-1
    Secondary_Uninstall()
    ExitLoop
WEnd
While NOT @error =-1
    $i = 0
    Do
        
        
        
        
;   MsgBox(4096, "success", "The window handle is " & $handle)
; Send some text directly to this window's edit control
;ControlClick("handle=" & $handle, "", "", "left")
        Sleep(4500)
        ControlSend("handle=" & $handle, "", "", "{ENTER}")
        Sleep(40)
        ControlSend("handle=" & $handle, "", "", "{ENTER}")
        Sleep(100)
        $i = $i + 1
    Until $i = 1
    ExitLoop
WEnd

Func Secondary_Uninstall()
AutoItSetOption("WinTitleMatchMode", 4)

; Get the handle of the uninstall window

$handle = WinGetHandle("Diablo3", "")
If @error Then
    MsgBox(0, "Error", "Their was an error while trying to uninstall.")
Else
    $i = 0
    Do
        
        
        
        
;   MsgBox(4096, "success", "The window handle is " & $handle)
; Send some text directly to this window's edit control
;ControlClick("handle=" & $handle, "", "", "left")
        Sleep(4500)
        ControlSend("handle=" & $handle, "", "", "{ENTER}")
        Sleep(40)
        ControlSend("handle=" & $handle, "", "", "{ENTER}")
        Sleep(100)
        $i = $i + 1
    Until $i = 1
    
EndIf
EndFunc; => Secondary_Uninstall()

If this doesn't work, im gonna have to second V --- this --- V :( cuz i don't understand whats wrong :)

Edit: Don't understand what you want. I'll let someone else answer your question.

Even though it's worthless when you give the worst description of what you need help with.

Edited by 4gotn1

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Run("C:\Program Files\Diablo II\Diablo3.exe")
AutoItSetOption("WinTitleMatchMode", 4)

; Get the handle of the uninstall window
$handle = WinGetHandle("Diablo3", "")  
If @error Then
    exit
Else
$i = 0
Do
    
    


;   MsgBox(4096, "success", "The window handle is " & $handle)
 ; Send some text directly to this window's edit control
 ;ControlClick("handle=" & $handle, "", "", "left")
    sleep(4500)
    ControlSend("handle=" & $handle, "", "", "{ENTER}")
    sleep(40)
    ControlSend("handle=" & $handle, "", "", "{ENTER}")  
    sleep(100)
    $i = $i + 1  
    Until $i = 1

EndIf

exit

but if that file dont exist i want it to skip to the next section of the script :(

understnad me now ? :)

Edited by Haveskillz

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0