Jump to content
Sign in to follow this  
spkiller

Can someone help me with this script

Recommended Posts

spkiller

i want this script to go to a url given by the user and to keep going until they press stop or until the number of times they want it to go ends and i also want it to stop for a period of time also given by the user this is what i have so far

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include<XProTec.au3>
Opt("TrayAutoPause", 0)
$Form1 = GUICreate("App Automator", 751, 447)
$Tab = GUICtrlCreateTab(8, 8, 737, 425)
;~ ------------------------------------------------------------------------------------
$tab1 = GUICtrlCreateTabItem("Bot 1")
$browser1 = _IECreateEmbedded()
$GUIActiveX1 = GUICtrlCreateObj($browser1, 300, 150, 430, 250)
$URL1 = GUICtrlCreateInput("", 32, 104, 481, 21)
$UrlLabel1 = GUICtrlCreateLabel("Url", 32, 80, 17, 17)
$PointsLabel1 = GUICtrlCreateLabel("Points Needed per action?", 16, 136, 130, 17)
$pointsin1 = GUICtrlCreateInput("", 32, 160, 89, 21)
$TimeLabel1 = GUICtrlCreateLabel("Time needed to regain point in miliseconds?", 160, 136, 142, 17)
$timein1 = GUICtrlCreateInput("", 176, 160, 105, 21)
$start1 = GUICtrlCreateButton("Start", 104, 288, 97, 33, $WS_GROUP)
$stop1 = GUICtrlCreateButton("stop", 104, 325, 97, 33, $WS_GROUP)
$points1 = GUICtrlRead($pointsin1)
$times1 = GUICtrlCreateInput("", 32, 220, 89, 21)
$Timesx1 = GUICtrlCreateLabel("Times to do it? -1 = inf", 32, 200, 142, 17)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
;     Case $stop1
;        ExitLoop
        Case $start1
            $time1 = GUICtrlRead($times1)
            $math1 = GUICtrlRead($pointsin1) * GUICtrlRead($timein1)
            If GUICtrlRead($URL1) <> "" Then
                If GUICtrlRead($pointsin1) <> "" Then
                    If GUICtrlRead($timein1) <> "" Then
;                 _IENavigate($browser1, GUICtrlRead($URL1), 1)
;                 Sleep($math1)
;                 $time1 = $time1 - 1
                        $Url = GUICtrlRead($URL1)
                        $Timer = TimerInit()
                        $Update = True
                        Do
                            Switch $nMsg
                                Case $GUI_EVENT_CLOSE
                                    Exit
                                Case $stop1
                                    ExitLoop
                            EndSwitch
                            If $Update Then
                                _IENavigate($browser1, $Url, 1)
                                $time1 = $time1 - 1
                                $Update = False
                            EndIf
                            If (TimerDiff($Timer) > $math1) Then
                                $Timer = TimerInit()
                                $Update = True
                            EndIf
                        Until $time1 = 0
                    Else
                        MsgBox(0, "Your missing stuff", "please put the time it takes to regain a point")
                    EndIf
                Else
                    MsgBox(0, "Your missing stuff", "Please put the amount of points")
                EndIf
            Else
                MsgBox(0, "Your missing stuff", "please put the url of the action you wish to do")
            EndIf
    EndSwitch
WEnd

any help is greatly appreciated

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.