Sign in to follow this  
Followers 0
Gursky

Running a loop

4 posts in this topic

I have managed to write my very first script successfully. By successfully I mean that I have been able to start the internet, go to a website, log in, go to a forum, and post a reply.

My question is; How do i get my AutoIt to loop the post reply command? I dont want it to start from the beginning. Please keep in mind that my scripting is horrible and very basic but it does what I need it to do. If you help me out, i personally give you permission to laugh at me...

Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE")

;Start Internet Explorer

WinWaitActive("Adelphia.net - Home - Microsoft Internet Explorer")

Controlclick("Adelphia.net - Home - Microsoft Internet Explorer","","Edit3")

;click address bar

Send("http://www.gaiaonline.com")

Send("{ENTER}")

WinWaitActive("Gaia :: Welcome to Gaia Online - Microsoft Internet Explorer")

Sleep(5000)

;tab 7

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("MYUSERNAME")

Send("{TAB}")

Send("MYPASSWORD")

Send("{ENTER}")

Sleep(5000)

WinWaitActive("Gaia :: Welcome to Gaia - Microsoft Internet Explorer")

Controlclick("Gaia :: Welcome to Gaia - Microsoft Internet Explorer","","Edit3")

Send("http://www.gaiaonline.com/forum/viewtopic.php?t=15189099")

Send("{ENTER}")

WinWaitActive("Gaia :: BUMP MANIA - Microsoft Internet Explorer")

Sleep(5000)

Controlclick("Gaia :: BUMP MANIA - Microsoft Internet Explorer","","Edit3")

Send("{ctrl+a}")

Send("{BACKSPACE}")

Send("http://www.gaiaonline.com/forum/posting.php?mode=reply&tc=" & int(Random ( 100, 999 )) & "&t=15189099")

Send("{ENTER}")

WinWaitActive("Gaia :: Forums - Post a Reply - Microsoft Internet Explorer")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("bump")

;tab 83

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{ENTER}")

Sleep(10000)

Share this post


Link to post
Share on other sites



maybe

While 1
    $pid = Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE")
    ;Start Internet Explorer
    WinWaitActive("Adelphia.net - Home - Microsoft Internet Explorer")
    ControlClick("Adelphia.net - Home - Microsoft Internet Explorer", "", "Edit3")
    ;click address bar
    Send("http://www.gaiaonline.com")
    Send("{ENTER}")
    WinWaitActive("Gaia :: Welcome to Gaia Online - Microsoft Internet Explorer")
    Sleep(5000)
    Send("{TAB 7}")
    Send("MYUSERNAME")
    Send("{TAB}")
    Send("MYPASSWORD")
    Send("{ENTER}")
    Sleep(5000)
    WinWaitActive("Gaia :: Welcome to Gaia - Microsoft Internet Explorer")
    ControlClick("Gaia :: Welcome to Gaia - Microsoft Internet Explorer", "", "Edit3")
    Send("http://www.gaiaonline.com/forum/viewtopic.php?t=15189099")
    Send("{ENTER}")
    WinWaitActive("Gaia :: BUMP MANIA - Microsoft Internet Explorer")
    Sleep(5000)
    ControlClick("Gaia :: BUMP MANIA - Microsoft Internet Explorer", "", "Edit3")
    Send("{ctrl+a}")
    Send("{BACKSPACE}")
    Send("http://www.gaiaonline.com/forum/posting.php?mode=reply&tc=" & Int(Random(100, 999)) & "&t=15189099")
    Send("{ENTER}")
    WinWaitActive("Gaia :: Forums - Post a Reply - Microsoft Internet Explorer")
    Send("{TAB 5}")
    Send("bump")
    For $x = 1 To 84
        Send("{TAB}")
    Next
    Send("{ENTER}")
    Sleep(10000)
    ProcessClose($pid)
WEnd

******* not tested

8)


NEWHeader1.png

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