Sign in to follow this  
Followers 0
Regency

Need some pro's to revise me works..

2 posts in this topic

I have this working, and working good, but wanna knwo if there are ways to compress it, like.. better and shorter ways to write what i wrote,

#RequireAdmin
#AutoIt3Wrapper_Run_Debug_Mode=Y
#include <GUIConstants.au3>
#include <Constants.au3>
#include <IE.au3>
#include  <Misc.au3>
#include <Date.au3>
#include <Garage.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)
Opt("PixelCoordMode", 1)



Global $Crimes = ''
Global $Gta = ''
Global $aPixSums = ''
Global $aCheck = _FindUnique($aPixSums, 1)
Global $Paused = ''

Global $A11 = IniRead("ScorpiA.ini", "Main", "Acct1", "NotFound")
Global $A21 = IniRead("ScorpiA.ini", "Main", "Acct2", "NotFound")
Global $A31 = IniRead("ScorpiA.ini", "Main", "Acct3", "NotFound")
Global $A41 = IniRead("ScorpiA.ini", "Main", "Acct4", "NotFound")
Global $A51 = IniRead("ScorpiA.ini", "Main", "Acct5", "NotFound")
Global $A1 = IniRead("ScorpiA.ini", "Main", "Acct6", "NotFound")
Global $A2 = IniRead("ScorpiA.ini", "Main", "Acct7", "NotFound")
Global $A3 = IniRead("ScorpiA.ini", "Main", "Acct8", "NotFound")
Global $A4 = IniRead("ScorpiA.ini", "Main", "Acct9", "NotFound")
Global $A5 = IniRead("ScorpiA.ini", "Main", "Acct10", "NotFound")

Global $P11 = IniRead("ScorpiA.ini", "Main", "Pass1", "NotFound")
Global $P21 = IniRead("ScorpiA.ini", "Main", "Pass2", "NotFound")
Global $P31 = IniRead("ScorpiA.ini", "Main", "Pass3", "NotFound")
Global $P41 = IniRead("ScorpiA.ini", "Main", "Pass4", "NotFound")
Global $P51 = IniRead("ScorpiA.ini", "Main", "Pass5", "NotFound")
Global $P1 = IniRead("ScorpiA.ini", "Main", "Pass6", "NotFound")
Global $P2 = IniRead("ScorpiA.ini", "Main", "Pass7", "NotFound")
Global $P3 = IniRead("ScorpiA.ini", "Main", "Pass8", "NotFound")
Global $P4 = IniRead("ScorpiA.ini", "Main", "Pass9", "NotFound")
Global $P5 = IniRead("ScorpiA.ini", "Main", "Pass10", "NotFound")



[b][/b][i]Removed $Url Variables as i dont want it flagged from google[/i][u][/u]

Global $Quick = GUICreate("Auto Scripter - By - ScorpiA", 290, 600, 340, 300)

Global $Make = GUICtrlCreateButton("Start Auto Scripter By ScorpiA - Hit ESC to Exit", 8, 552, 267, 25, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_MINIMIZE
            _MinimizeToTray()
        Case $Make
            myRun()
    EndSwitch
WEnd

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

    Local $begin = ''
    Local $begin3 = ''
    Local $dif3 = 0
    Local $dif = 0

    While 2
        Sleep(10)
        $dif = Int(TimerDiff($begin) / 1000)
        If $dif >= (2 * 60) Then
            MyFunction2()
            Crimes()
            $begin = TimerInit()
        EndIf
    WEnd

EndFunc   ;==>myRun

Func MyFunction2()
    $Gta = _IECreate($url1 & "/authenticated/cartheft.aspx", 0, 1, 1, 0)
    _IELoadWait($Gta)
    WinSetState("TMN - Steal a Car - ", "", @SW_MAXIMIZE)
    WinSetState("tmnX - themafianetwork Xclusive Edition - ", "", @SW_MAXIMIZE)
    
    $oUser = _IEGetObjByName($Gta, "Login1$UserName")
    _IEFormElementSetValue($oUser, $A1)
    $oPass = _IEGetObjByName($Gta, "Login1$Password")
    _IEFormElementSetValue($oPass, $P1)
    $oLogIn = _IEGetObjByName($Gta, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($Gta)
    
$oRadio = _IEGetObjById($Gta, "ctl00_MainPageContent_rblCarThefts_1")
    _IEAction($oRadio, "click")
    $oSubmit = _IEGetObjByName($Gta, "ctl00$MainPageContent$btnCommit")
    _IEAction($oSubmit, "click")
    _IELoadWait($Gta)
    Sleep(2000)
    $oVerify = _IEGetObjByName($Gta, "ctl00$MainPageContent$valCartheft$btn1")
    If IsObj($oVerify) Then
        Script1()
    EndIf
    
    _IELoadWait($Gta)
    
    _IENavigate($Gta, $url2 & "/authenticated/cartheft.aspx", 1)
    _IELoadWait($Gta)
    WinSetState("TMN - Steal a Car - ", "", @SW_MAXIMIZE)
    WinSetState("tmnX - themafianetwork Xclusive Edition - ", "", @SW_MAXIMIZE)
    $oUser = _IEGetObjByName($Gta, "Login1$UserName")
    _IEFormElementSetValue($oUser, $A2)
    $oPass = _IEGetObjByName($Gta, "Login1$Password")
    _IEFormElementSetValue($oPass, $P2)
    $oLogIn = _IEGetObjByName($Gta, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($Gta)
    
    $oRadio = _IEGetObjById($Gta, "ctl00_MainPageContent_rblCarThefts_1")
    _IEAction($oRadio, "click")
    $oSubmit = _IEGetObjByName($Gta, "ctl00$MainPageContent$btnCommit")
    _IEAction($oSubmit, "click")
    _IELoadWait($Gta)
    Sleep(2000)
    $oVerify = _IEGetObjByName($Gta, "ctl00$MainPageContent$valCartheft$btn1")
    If IsObj($oVerify) Then
        Script1()
    EndIf
    _IELoadWait($Gta)
    
    
    _IENavigate($Gta, $url3 & "/authenticated/cartheft.aspx", 1)
    _IELoadWait($Gta)
    WinSetState("TMN - Steal a Car - ", "", @SW_MAXIMIZE)
    WinSetState("tmnX - themafianetwork Xclusive Edition - ", "", @SW_MAXIMIZE)
    $oUser = _IEGetObjByName($Gta, "Login1$UserName")
    _IEFormElementSetValue($oUser, $A3)
    $oPass = _IEGetObjByName($Gta, "Login1$Password")
    _IEFormElementSetValue($oPass, $P3)
    $oLogIn = _IEGetObjByName($Gta, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($Gta)
    
    $oRadio = _IEGetObjById($Gta, "ctl00_MainPageContent_rblCarThefts_1")
    _IEAction($oRadio, "click")
    $oSubmit = _IEGetObjByName($Gta, "ctl00$MainPageContent$btnCommit")
    _IEAction($oSubmit, "click")
    _IELoadWait($Gta)
    Sleep(2000)
    $oVerify = _IEGetObjByName($Gta, "ctl00$MainPageContent$valCartheft$btn1")
    If IsObj($oVerify) Then
        Script1()
    EndIf
    _IELoadWait($Gta)
    
    
    _IENavigate($Gta, $url4 & "/authenticated/cartheft.aspx", 1)
    _IELoadWait($Gta)
    WinSetState("TMN - Steal a Car - ", "", @SW_MAXIMIZE)
    WinSetState("tmnX - themafianetwork Xclusive Edition - ", "", @SW_MAXIMIZE)
    $oUser = _IEGetObjByName($Gta, "Login1$UserName")
    _IEFormElementSetValue($oUser, $A4)
    $oPass = _IEGetObjByName($Gta, "Login1$Password")
    _IEFormElementSetValue($oPass, $P4)
    $oLogIn = _IEGetObjByName($Gta, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($Gta)
    
    $oRadio = _IEGetObjById($Gta, "ctl00_MainPageContent_rblCarThefts_1")
    _IEAction($oRadio, "click")
    $oSubmit = _IEGetObjByName($Gta, "ctl00$MainPageContent$btnCommit")
    _IEAction($oSubmit, "click")
    _IELoadWait($Gta)
    Sleep(2000)
    $oVerify = _IEGetObjByName($Gta, "ctl00$MainPageContent$valCartheft$btn1")
    If IsObj($oVerify) Then
        Script1()
    EndIf
    _IELoadWait($Gta)
    
    
    _IENavigate($Gta, $url5 & "/authenticated/cartheft.aspx", 1)
    _IELoadWait($Gta)
    WinSetState("TMN - Steal a Car - ", "", @SW_MAXIMIZE)
    WinSetState("tmnX - themafianetwork Xclusive Edition - ", "", @SW_MAXIMIZE)
    $oUser = _IEGetObjByName($Gta, "Login1$UserName")
    _IEFormElementSetValue($oUser, $A5)
    $oPass = _IEGetObjByName($Gta, "Login1$Password")
    _IEFormElementSetValue($oPass, $P5)
    $oLogIn = _IEGetObjByName($Gta, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($Gta)
    
    $oRadio = _IEGetObjById($Gta, "ctl00_MainPageContent_rblCarThefts_1")
    _IEAction($oRadio, "click")
    $oSubmit = _IEGetObjByName($Gta, "ctl00$MainPageContent$btnCommit")
    _IEAction($oSubmit, "click")
    _IELoadWait($Gta)
    Sleep(2000)
    $oVerify = _IEGetObjByName($Gta, "ctl00$MainPageContent$valCartheft$btn1")
    If IsObj($oVerify) Then
        Script1()
    EndIf
    _IELoadWait($Gta)
    _IENavigate($Gta,"www.tmnx.net/authenticated/cartheft.aspx", 1)
    _IELoadWait($Gta)
    WinSetState("TMN - Steal a Car - ", "", @SW_MAXIMIZE)
    WinSetState("tmnX - themafianetwork Xclusive Edition - ", "", @SW_MAXIMIZE)
    
    $oUser = _IEGetObjByName($Gta, "Login1$UserName")
    _IEFormElementSetValue($oUser, $A11)
    $oPass = _IEGetObjByName($Gta, "Login1$Password")
    _IEFormElementSetValue($oPass, $P11)
    $oLogIn = _IEGetObjByName($Gta, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($Gta)
    
$oRadio = _IEGetObjById($Gta, "ctl00_MainPageContent_rblCarThefts_1")
    _IEAction($oRadio, "click")
    $oSubmit = _IEGetObjByName($Gta, "ctl00$MainPageContent$btnCommit")
    _IEAction($oSubmit, "click")
    _IELoadWait($Gta)
    Sleep(2000)
    $oVerify = _IEGetObjByName($Gta, "ctl00$MainPageContent$valCartheft$btn1")
    If IsObj($oVerify) Then
        Script1()
    EndIf
    
    _IELoadWait($Gta)
    
    _IENavigate($Gta, "tmnx.net/authenticated/cartheft.aspx", 1)
    _IELoadWait($Gta)
    WinSetState("TMN - Steal a Car - ", "", @SW_MAXIMIZE)
    WinSetState("tmnX - themafianetwork Xclusive Edition - ", "", @SW_MAXIMIZE)
    $oUser = _IEGetObjByName($Gta, "Login1$UserName")
    _IEFormElementSetValue($oUser, $A21)
    $oPass = _IEGetObjByName($Gta, "Login1$Password")
    _IEFormElementSetValue($oPass, $P21)
    $oLogIn = _IEGetObjByName($Gta, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($Gta)
    
    $oRadio = _IEGetObjById($Gta, "ctl00_MainPageContent_rblCarThefts_1")
    _IEAction($oRadio, "click")
    $oSubmit = _IEGetObjByName($Gta, "ctl00$MainPageContent$btnCommit")
    _IEAction($oSubmit, "click")
    _IELoadWait($Gta)
    Sleep(2000)
    $oVerify = _IEGetObjByName($Gta, "ctl00$MainPageContent$valCartheft$btn1")
    If IsObj($oVerify) Then
        Script1()
    EndIf
    _IELoadWait($Gta)
    
    
    _IENavigate($Gta, "www.themafianetwork.net/authenticated/cartheft.aspx", 1)
    _IELoadWait($Gta)
    WinSetState("TMN - Steal a Car - ", "", @SW_MAXIMIZE)
    WinSetState("tmnX - themafianetwork Xclusive Edition - ", "", @SW_MAXIMIZE)
    $oUser = _IEGetObjByName($Gta, "Login1$UserName")
    _IEFormElementSetValue($oUser, $A31)
    $oPass = _IEGetObjByName($Gta, "Login1$Password")
    _IEFormElementSetValue($oPass, $P31)
    $oLogIn = _IEGetObjByName($Gta, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($Gta)
    
    $oRadio = _IEGetObjById($Gta, "ctl00_MainPageContent_rblCarThefts_1")
    _IEAction($oRadio, "click")
    $oSubmit = _IEGetObjByName($Gta, "ctl00$MainPageContent$btnCommit")
    _IEAction($oSubmit, "click")
    _IELoadWait($Gta)
    Sleep(2000)
    $oVerify = _IEGetObjByName($Gta, "ctl00$MainPageContent$valCartheft$btn1")
    If IsObj($oVerify) Then
        Script1()
    EndIf
    _IELoadWait($Gta)
    
    
    _IENavigate($Gta, "themafianetwork.net/authenticated/cartheft.aspx", 1)
    _IELoadWait($Gta)
    WinSetState("TMN - Steal a Car - ", "", @SW_MAXIMIZE)
    WinSetState("tmnX - themafianetwork Xclusive Edition - ", "", @SW_MAXIMIZE)
    $oUser = _IEGetObjByName($Gta, "Login1$UserName")
    _IEFormElementSetValue($oUser, $A41)
    $oPass = _IEGetObjByName($Gta, "Login1$Password")
    _IEFormElementSetValue($oPass, $P41)
    $oLogIn = _IEGetObjByName($Gta, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($Gta)
    
    $oRadio = _IEGetObjById($Gta, "ctl00_MainPageContent_rblCarThefts_1")
    _IEAction($oRadio, "click")
    $oSubmit = _IEGetObjByName($Gta, "ctl00$MainPageContent$btnCommit")
    _IEAction($oSubmit, "click")
    _IELoadWait($Gta)
    Sleep(2000)
    $oVerify = _IEGetObjByName($Gta, "ctl00$MainPageContent$valCartheft$btn1")
    If IsObj($oVerify) Then
        Script1()
    EndIf
    _IELoadWait($Gta)
    
    
    _IENavigate($Gta, "209.51.212.50/authenticated/cartheft.aspx", 1)
    _IELoadWait($Gta)
    WinSetState("TMN - Steal a Car - ", "", @SW_MAXIMIZE)
    WinSetState("tmnX - themafianetwork Xclusive Edition - ", "", @SW_MAXIMIZE)
    $oUser = _IEGetObjByName($Gta, "Login1$UserName")
    _IEFormElementSetValue($oUser, $A51)
    $oPass = _IEGetObjByName($Gta, "Login1$Password")
    _IEFormElementSetValue($oPass, $P51)
    $oLogIn = _IEGetObjByName($Gta, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($Gta)
    
    $oRadio = _IEGetObjById($Gta, "ctl00_MainPageContent_rblCarThefts_1")
    _IEAction($oRadio, "click")
    $oSubmit = _IEGetObjByName($Gta, "ctl00$MainPageContent$btnCommit")
    _IEAction($oSubmit, "click")
    _IELoadWait($Gta)
    Sleep(2000)
    $oVerify = _IEGetObjByName($Gta, "ctl00$MainPageContent$valCartheft$btn1")
    If IsObj($oVerify) Then
        Script1()
    EndIf
    _IELoadWait($Gta)
    _IEQuit($Gta)
EndFunc   ;==>MyFunction2

Func Crimes()
    $Crimes = _IECreate($url1 & "/Authenticated/crimes.aspx", 0, 1, 1, 0)
    _IELoadWait($Crimes)
    WinSetState("TMN - Crimes - ", "", @SW_MAXIMIZE)
    WinSetState("tmnX - themafianetwork Xclusive Edition - ", "", @SW_MAXIMIZE)
    $oUser = _IEGetObjByName($Crimes, "Login1$UserName")
    _IEFormElementSetValue($oUser, $A1)
    $oPass = _IEGetObjByName($Crimes, "Login1$Password")
    _IEFormElementSetValue($oPass, $P1)
    $oLogIn = _IEGetObjByName($Crimes, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($Crimes)
    $oRadio = _IEGetObjById($Crimes, "ctl00_MainPageContent_rblCrimes_0")
    _IEAction($oRadio, "click")
    $oSubmit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$btnCommit")
    _IEAction($oSubmit, "click")
    _IELoadWait($Crimes)
    Sleep(2000)
    $oVerify = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn1")
    If IsObj($oVerify) Then
        Script2()
    EndIf
_IELoadWait($Crimes)

    _IENavigate($Crimes,$url2 &  "/Authenticated/crimes.aspx", 1)
    _IELoadWait($Crimes)
    WinSetState("TMN - Crimes - ", "", @SW_MAXIMIZE)
    WinSetState("tmnX - themafianetwork Xclusive Edition - ", "", @SW_MAXIMIZE)
    $oUser = _IEGetObjByName($Crimes, "Login1$UserName")
    _IEFormElementSetValue($oUser, $A2)
    $oPass = _IEGetObjByName($Crimes, "Login1$Password")
    _IEFormElementSetValue($oPass, $P2)
    $oLogIn = _IEGetObjByName($Crimes, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($Crimes)
    $oRadio = _IEGetObjById($Crimes, "ctl00_MainPageContent_rblCrimes_8")
    _IEAction($oRadio, "click")
    $oSubmit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$btnCommit")
    _IEAction($oSubmit, "click")
    _IELoadWait($Crimes)
    Sleep(2000)
    $oVerify = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn1")
    If IsObj($oVerify) Then
        Script2()
    EndIf
    _IELoadWait($Crimes)
    
    _IENavigate($Crimes, $url3 & "/Authenticated/crimes.aspx", 1)
    _IELoadWait($Crimes)
    WinSetState("TMN - Crimes - ", "", @SW_MAXIMIZE)
    WinSetState("tmnX - themafianetwork Xclusive Edition - ", "", @SW_MAXIMIZE)
    $oUser = _IEGetObjByName($Crimes, "Login1$UserName")
    _IEFormElementSetValue($oUser, $A3)
    $oPass = _IEGetObjByName($Crimes, "Login1$Password")
    _IEFormElementSetValue($oPass, $P3)
    $oLogIn = _IEGetObjByName($Crimes, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($Crimes)
    $oRadio = _IEGetObjById($Crimes, "ctl00_MainPageContent_rblCrimes_8")
    _IEAction($oRadio, "click")
    $oSubmit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$btnCommit")
    _IEAction($oSubmit, "click")
    _IELoadWait($Crimes)
    Sleep(2000)
    $oVerify = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn1")
    If IsObj($oVerify) Then
        Script2()
    EndIf
    _IELoadWait($Crimes)
    
    _IENavigate($Crimes, $url4 & "/Authenticated/crimes.aspx", 1)
    _IELoadWait($Crimes)
    WinSetState("TMN - Crimes - ", "", @SW_MAXIMIZE)
    WinSetState("tmnX - themafianetwork Xclusive Edition - ", "", @SW_MAXIMIZE)
    $oUser = _IEGetObjByName($Crimes, "Login1$UserName")
    _IEFormElementSetValue($oUser, $A4)
    $oPass = _IEGetObjByName($Crimes, "Login1$Password")
    _IEFormElementSetValue($oPass, $P4)
    $oLogIn = _IEGetObjByName($Crimes, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($Crimes)
    $oRadio = _IEGetObjById($Crimes, "ctl00_MainPageContent_rblCrimes_8")
    _IEAction($oRadio, "click")
    $oSubmit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$btnCommit")
    _IEAction($oSubmit, "click")
    _IELoadWait($Crimes)
    Sleep(2000)
    $oVerify = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn1")
    If IsObj($oVerify) Then
        Script2()
    EndIf
    _IELoadWait($Crimes)
    
    _IENavigate($Crimes, $url5 & "/Authenticated/crimes.aspx", 1)
    _IELoadWait($Crimes)
    WinSetState("TMN - Crimes - ", "", @SW_MAXIMIZE)
    WinSetState("tmnX - themafianetwork Xclusive Edition - ", "", @SW_MAXIMIZE)
    $oUser = _IEGetObjByName($Crimes, "Login1$UserName")
    _IEFormElementSetValue($oUser, $A5)
    $oPass = _IEGetObjByName($Crimes, "Login1$Password")
    _IEFormElementSetValue($oPass, $P5)
    $oLogIn = _IEGetObjByName($Crimes, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($Crimes)
    $oRadio = _IEGetObjById($Crimes, "ctl00_MainPageContent_rblCrimes_8")
    _IEAction($oRadio, "click")
    $oSubmit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$btnCommit")
    _IEAction($oSubmit, "click")
    _IELoadWait($Crimes)
    Sleep(2000)
    $oVerify = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn1")
    If IsObj($oVerify) Then
        Script2()
    EndIf
    _IELoadWait($Crimes)
    
    _IENavigate($crimes, "www.tmnx.net/Authenticated/crimes.aspx", 1)
    _IELoadWait($Crimes)
    WinSetState("TMN - Crimes - ", "", @SW_MAXIMIZE)
    WinSetState("tmnX - themafianetwork Xclusive Edition - ", "", @SW_MAXIMIZE)
    $oUser = _IEGetObjByName($Crimes, "Login1$UserName")
    _IEFormElementSetValue($oUser, $A11)
    $oPass = _IEGetObjByName($Crimes, "Login1$Password")
    _IEFormElementSetValue($oPass, $P11)
    $oLogIn = _IEGetObjByName($Crimes, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($Crimes)
    $oRadio = _IEGetObjById($Crimes, "ctl00_MainPageContent_rblCrimes_8")
    _IEAction($oRadio, "click")
    $oSubmit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$btnCommit")
    _IEAction($oSubmit, "click")
    _IELoadWait($Crimes)
    Sleep(2000)
    $oVerify = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn1")
    If IsObj($oVerify) Then
        Script2()
    EndIf
_IELoadWait($Crimes)

    _IENavigate($Crimes, "tmnx.net/Authenticated/crimes.aspx", 1)
    _IELoadWait($Crimes)
    WinSetState("TMN - Crimes - ", "", @SW_MAXIMIZE)
    WinSetState("tmnX - themafianetwork Xclusive Edition - ", "", @SW_MAXIMIZE)
    $oUser = _IEGetObjByName($Crimes, "Login1$UserName")
    _IEFormElementSetValue($oUser, $A21)
    $oPass = _IEGetObjByName($Crimes, "Login1$Password")
    _IEFormElementSetValue($oPass, $P21)
    $oLogIn = _IEGetObjByName($Crimes, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($Crimes)
    $oRadio = _IEGetObjById($Crimes, "ctl00_MainPageContent_rblCrimes_8")
    _IEAction($oRadio, "click")
    $oSubmit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$btnCommit")
    _IEAction($oSubmit, "click")
    _IELoadWait($Crimes)
    Sleep(2000)
    $oVerify = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn1")
    If IsObj($oVerify) Then
        Script2()
    EndIf
    _IELoadWait($Crimes)
    
    _IENavigate($Crimes, "www.themafianetwork.net/Authenticated/crimes.aspx", 1)
    _IELoadWait($Crimes)
    WinSetState("TMN - Crimes - ", "", @SW_MAXIMIZE)
    WinSetState("tmnX - themafianetwork Xclusive Edition - ", "", @SW_MAXIMIZE)
    $oUser = _IEGetObjByName($Crimes, "Login1$UserName")
    _IEFormElementSetValue($oUser, $A31)
    $oPass = _IEGetObjByName($Crimes, "Login1$Password")
    _IEFormElementSetValue($oPass, $P31)
    $oLogIn = _IEGetObjByName($Crimes, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($Crimes)
    $oRadio = _IEGetObjById($Crimes, "ctl00_MainPageContent_rblCrimes_8")
    _IEAction($oRadio, "click")
    $oSubmit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$btnCommit")
    _IEAction($oSubmit, "click")
    _IELoadWait($Crimes)
    Sleep(2000)
    $oVerify = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn1")
    If IsObj($oVerify) Then
        Script2()
    EndIf
    _IELoadWait($Crimes)
    
    _IENavigate($Crimes, "themafianetwork.net/Authenticated/crimes.aspx", 1)
    _IELoadWait($Crimes)
    WinSetState("TMN - Crimes - ", "", @SW_MAXIMIZE)
    WinSetState("tmnX - themafianetwork Xclusive Edition - ", "", @SW_MAXIMIZE)
    $oUser = _IEGetObjByName($Crimes, "Login1$UserName")
    _IEFormElementSetValue($oUser, $A41)
    $oPass = _IEGetObjByName($Crimes, "Login1$Password")
    _IEFormElementSetValue($oPass, $P41)
    $oLogIn = _IEGetObjByName($Crimes, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($Crimes)
    $oRadio = _IEGetObjById($Crimes, "ctl00_MainPageContent_rblCrimes_8")
    _IEAction($oRadio, "click")
    $oSubmit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$btnCommit")
    _IEAction($oSubmit, "click")
    _IELoadWait($Crimes)
    Sleep(2000)
    $oVerify = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn1")
    If IsObj($oVerify) Then
        Script2()
    EndIf
    _IELoadWait($Crimes)
    
    _IENavigate($Crimes, "209.51.212.50/Authenticated/crimes.aspx", 1)
    _IELoadWait($Crimes)
    WinSetState("TMN - Crimes - ", "", @SW_MAXIMIZE)
    WinSetState("tmnX - themafianetwork Xclusive Edition - ", "", @SW_MAXIMIZE)
    $oUser = _IEGetObjByName($Crimes, "Login1$UserName")
    _IEFormElementSetValue($oUser, $A51)
    $oPass = _IEGetObjByName($Crimes, "Login1$Password")
    _IEFormElementSetValue($oPass, $P51)
    $oLogIn = _IEGetObjByName($Crimes, "Login1$LoginLinkButton")
    _IEAction($oLogIn, "click")
    _IELoadWait($Crimes)
    $oRadio = _IEGetObjById($Crimes, "ctl00_MainPageContent_rblCrimes_8")
    _IEAction($oRadio, "click")
    $oSubmit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$btnCommit")
    _IEAction($oSubmit, "click")
    _IELoadWait($Crimes)
    Sleep(2000)
    $oVerify = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn1")
    If IsObj($oVerify) Then
        Script2()
    EndIf
    _IELoadWait($Crimes)

    _IEQuit($Crimes)
    
EndFunc   ;==>Crimes





Func Script2()
    Global $aPixSums[10]
    
    $aPixSums[1] = PixelChecksum(526, 281, 526, 281)
    $aPixSums[2] = PixelChecksum(626, 281, 626, 281)
    $aPixSums[3] = PixelChecksum(726, 281, 726, 281)

    $aPixSums[4] = PixelChecksum(526, 381, 526, 381)
    $aPixSums[5] = PixelChecksum(626, 381, 626, 381)
    $aPixSums[6] = PixelChecksum(726, 381, 726, 381)
    
    $aPixSums[7] = PixelChecksum(526, 481, 526, 481)
    $aPixSums[8] = PixelChecksum(626, 481, 626, 481)
    $aPixSums[9] = PixelChecksum(726, 481, 726, 481)

    Global $aCheck = _FindUnique($aPixSums, 1)
    If IsArray($aCheck) Then
        Click2()
    EndIf
EndFunc   ;==>Script2

Func Click2()
    If $aCheck[1] = "1" Then
        $Submit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn1")
        MsgBox(0,"First Box","1")
    ElseIf $aCheck[1] = '2' Then
        $Submit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn2")
        MsgBox(0,"Second Box","2")
    ElseIf $aCheck[1] = '3' Then
        $Submit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn3")
        MsgBox(0,"Third Box","3")
    ElseIf $aCheck[1] = '4' Then
        $Submit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn4")
        MsgBox(0,"Fourth Box","4")
    ElseIf $aCheck[1] = '5' Then
        $Submit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn5")
        MsgBox(0,"Fifth Box","5")
    ElseIf $aCheck[1] = '6' Then
        $Submit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn6")
        MsgBox(0,"Sixth Box","6")
        ElseIf $aCheck[1] = '7' Then
        $Submit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn7")
        MsgBox(0,"Seventh Box","7")
    ElseIf $aCheck[1] = '8' Then
        $Submit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn8")
        MsgBox(0,"eighth","8")
    ElseIf $aCheck[1] = '9' Then
        $Submit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn9")
        MsgBox(0,"nineth Box","9")
    EndIf
EndFunc   ;==>Click2

Func Script1()
    Global $aPixSums[10]

    $aPixSums[1] = PixelChecksum(526, 281, 526, 281)
    $aPixSums[2] = PixelChecksum(626, 281, 626, 281)
    $aPixSums[3] = PixelChecksum(726, 281, 726, 281)

    $aPixSums[4] = PixelChecksum(526, 381, 526, 381)
    $aPixSums[5] = PixelChecksum(626, 381, 626, 381)
    $aPixSums[6] = PixelChecksum(726, 381, 726, 381)
    
    $aPixSums[7] = PixelChecksum(526, 481, 526, 481)
    $aPixSums[8] = PixelChecksum(626, 481, 626, 481)
    $aPixSums[9] = PixelChecksum(726, 481, 726, 481)
    
    Global $aCheck = _FindUnique($aPixSums, 1)
    If IsArray($aCheck) Then
        Click1()
    EndIf
EndFunc   ;==>Script1
Func Click1()
    If $aCheck[1] = "1" Then
        $Submit = _IEGetObjByName($Gta, "ctl00$MainPageContent$valCartheft$btn1")
        MsgBox(0,"First Box","1")
    ElseIf $aCheck[1] = '2' Then
        $Submit = _IEGetObjByName($Gta, "ctl00$MainPageContent$valCartheft$btn2")
        MsgBox(0,"Second Box","2")
    ElseIf $aCheck[1] = '3' Then
        $Submit = _IEGetObjByName($Gta, "ctl00$MainPageContent$valCartheft$btn3")
        MsgBox(0,"Third Box","3")
    ElseIf $aCheck[1] = '4' Then
        $Submit = _IEGetObjByName($Gta, "ctl00$MainPageContent$valCartheft$btn4")
        MsgBox(0,"Fourth Box","4")
    ElseIf $aCheck[1] = '5' Then
        $Submit = _IEGetObjByName($Gta, "ctl00$MainPageContent$valCartheft$btn5")
        MsgBox(0,"Fifth Box","5")
    ElseIf $aCheck[1] = '6' Then
        $Submit = _IEGetObjByName($Gta, "ctl00$MainPageContent$valCartheft$btn6")
        MsgBox(0,"Sixth Box","6")
        ElseIf $aCheck[1] = '7' Then
        $Submit = _IEGetObjByName($Gta, "ctl00$MainPageContent$valCartheft$btn7")
        MsgBox(0,"Seventh Box","7")
    ElseIf $aCheck[1] = '8' Then
        $Submit = _IEGetObjByName($Gta, "ctl00$MainPageContent$valCartheft$btn8")
        MsgBox(0,"Eighth Box","8")
    ElseIf $aCheck[1] = '9' Then
        $Submit = _IEGetObjByName($Gta, "ctl00$MainPageContent$valCartheft$btn9")
        MsgBox(0,"nineth Box","9")
    EndIf
EndFunc   ;==>Click1

;Params:
;       1. Is the array of the sums
;       2. Is the base  you started at (ie... 0 or 1, in this case we started at 1, default is 0
;Return:
;       1 dimensional array
;       array[0] ... [0] = Value that was unique
;       array[1] ... [1] = Number it was found on
Func _FindUnique($aSums, $nBase = 0, $vDelim = "");Quick version, will only find one instance of a unique val
    If $vDelim = "" Then $vDelim = Chr(1)
    Local $sDelim = $vDelim
    $vDelim &= $vDelim
    ; We need to make a string from the array with a delimiter
    Local $sSums = $vDelim
    For $i = $nBase To UBound($aSums) - 1
        $sSums &= $aSums[$i] & $vDelim
    Next

    ;   ConsoleWrite($sSums & @CRLF)

    Local $aReturn[2] ; Our return array
    Local $nUbound
    ;Now we can simply loop through, use StringReplace
    For $i = $nBase To UBound($aSums) - 1
        StringReplace($sSums, $sDelim & $aSums[$i] & $sDelim, "")
        If @extended = 1 Then ; Only 1 replacement means it was unique, no need to go further
            $aReturn[0] = $aSums[$i]
            $aReturn[1] = $i
            Return $aReturn
        EndIf
    Next
    Return SetError(1, 0, "")
EndFunc   ;==>_FindUnique

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 OnAutoitExit()
    _IEQuit($Gta)
    _IEQuit($Crimes)
    $Garage = _IECreate($url1 & "garage.aspx",0,1,1,0)
    RunGarage()
    _IENavigate($Garage, $url2 & "garage.aspx", 1)
    RunGarage()
    _IENavigate($Garage, $url3 & "garage.aspx", 1)
    RunGarage()
    _IENavigate($Garage, $url4 & "garage.aspx", 1)
    RunGarage()
    _IENavigate($Garage, $url5 & "garage.aspx", 1)
    RunGarage()
    _IENavigate($Garage, $url6 & "garage.aspx", 1)
    RunGarage()
    _IENavigate($Garage, $url7 & "garage.aspx", 1)
    RunGarage()
    _IENavigate($Garage, $url8 & "garage.aspx", 1)
    RunGarage()
    _IENavigate($Garage, $url9 & "garage.aspx", 1)
    RunGarage()
    _IENavigate($Garage, $url10 & "garage.aspx", 1)
    RunGarage()
    _IEQuit($Garage)
    Exit
EndFunc


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

Thanks again

Share this post


Link to post
Share on other sites



@Regency....For example...

Before:

Func Click2()
    If $aCheck[1] = "1" Then
        $Submit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn1")
        MsgBox(0,"First Box","1")
    ElseIf $aCheck[1] = '2' Then
        $Submit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn2")
        MsgBox(0,"Second Box","2")
    ElseIf $aCheck[1] = '3' Then
        $Submit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn3")
        MsgBox(0,"Third Box","3")
    ElseIf $aCheck[1] = '4' Then
        $Submit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn4")
        MsgBox(0,"Fourth Box","4")
    ElseIf $aCheck[1] = '5' Then
        $Submit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn5")
        MsgBox(0,"Fifth Box","5")
    ElseIf $aCheck[1] = '6' Then
        $Submit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn6")
        MsgBox(0,"Sixth Box","6")
        ElseIf $aCheck[1] = '7' Then
        $Submit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn7")
        MsgBox(0,"Seventh Box","7")
    ElseIf $aCheck[1] = '8' Then
        $Submit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn8")
        MsgBox(0,"eighth","8")
    ElseIf $aCheck[1] = '9' Then
        $Submit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn9")
        MsgBox(0,"nineth Box","9")
    EndIf
EndFunc  ;==>Click2

After:

Func Click2()

    $Submit = _IEGetObjByName($Crimes, "ctl00$MainPageContent$valCrimes$btn" & $aCheck[1])
    MsgBox(0,"Box","# is " & $aCheck[1])

EndFunc

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