Jump to content

whats wrong with this script?


Recommended Posts

this script only works sometimes, its odd and picky lol

$Sleep = Random(1 * 1000, 20 * 1000, 1)
$RSleep = ($Sleep + Random(1 * 1000, 20 * 1000, 1))
$i = 1
Do
    If WinActive("Mozilla") Then
        If WinActive("Facebook") Then
            ;Sleep($RSleep)
            WinClose("Facebook")
            msgbox(0 , "Error,", "Firefox has detected an error in the sites scripting")
        ElseIf WinActive("MySpace") Then
            ;Sleep($RSleep)
            WinClose("MySpace")
            msgbox(0 , "Error,", "Firefox has detected an error in the sites scripting")
        EndIf
    EndIf
    If WinActive("Internet Explorer") Then
        If WinActive("Facebook") Then
            ;Sleep($RSleep)
            WinClose("Facebook")
            msgbox(0 , "Error,", "Firefox has detected an error in the sites scripting")
        ElseIf WinActive("MySpace") Then
            ;Sleep($RSleep)
            WinClose("MySpace")
            msgbox(0 , "Error,", "Firefox has detected an error in the sites scripting")
        EndIf
    EndIf
Until $i = 0
[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
Link to comment
Share on other sites

That Do.. Until seems to be the problem.

This works for me.

Opt("WinTitleMatchMode", 2)
$Sleep = Random(1 * 1000, 20 * 1000, 1)
$RSleep = ($Sleep + Random(1 * 1000, 20 * 1000, 1))
HotKeySet("{PAUSE}", "Doit")
$i = 1
Do 
Until $i = 0

Func Doit()
    If WinActive("Mozilla") Then
        If WinActive("Facebook") Then
    ;Sleep($RSleep)
            WinClose("Facebook")
            MsgBox(0, "Error,", "Firefox has detected an error in the sites scripting")
        ElseIf WinActive("MySpace") Then
    ;Sleep($RSleep)
            WinClose("MySpace")
            MsgBox(0, "Error,", "Firefox has detected an error in the sites scripting")
        EndIf
    EndIf
    If WinActive("Internet Explorer") Then
        If WinActive("Facebook") Then
    ;Sleep($RSleep)
            WinClose("Facebook")
            MsgBox(0, "Error,", "Firefox has detected an error in the sites scripting")
        ElseIf WinActive("MySpace") Then
    ;Sleep($RSleep)
            WinClose("MySpace")
            MsgBox(0, "Error,", "Firefox has detected an error in the sites scripting")
        EndIf
    EndIf
EndFunc ;==>Doit
Edited by 1905russell
Link to comment
Share on other sites

ty...this works, guess I needed the opt :)

Opt("WinTitleMatchMode", 2)
$Sleep = Random(1 * 1000, 20 * 1000, 1)
$RSleep = ($Sleep + Random(1 * 1000, 20 * 1000, 1))
$i = 1
Do
    If WinActive("Mozilla") Then
        If WinActive("Facebook") Then
            ;Sleep($RSleep)
            WinClose("Facebook")
            msgbox(0 , "Error,", "Firefox has detected an error in the sites scripting")
        ElseIf WinActive("MySpace") Then
            ;Sleep($RSleep)
            WinClose("MySpace")
            msgbox(0 , "Error,", "Firefox has detected an error in the sites scripting")
        EndIf
    EndIf
    If WinActive("Internet Explorer") Then
        If WinActive("Facebook") Then
            ;Sleep($RSleep)
            WinClose("Facebook")
            msgbox(0 , "Error,", "Internet Explorer has detected an error in the sites scripting")
        ElseIf WinActive("MySpace") Then
            ;Sleep($RSleep)
            WinClose("MySpace")
            msgbox(0 , "Error,", "Internet Explorer has detected an error in the sites scripting")
        EndIf
    EndIf
Until $i = 0
Edited by ReaImDown
[u][font="Century Gothic"]~я α и d γ ĵ . ċ . ѕ қ ϊ и и ε я~- My Programs -auto shutdownSleep funcdisallow programs[/font][/u]
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...