Jump to content

Problem Looping


Recommended Posts

This Is My Script So Far... And I Want The Thing In {} To Loop Forever

And If You See Any Other Errors Let Me Know :whistle:

Thanks In Advance

$Login = IniRead (@ScriptDir & "\Pit_Script.ini","_Info_", "Login","")

$Email = IniRead (@ScriptDir & "\Pit_Script.ini","_Info_", "Email","")

$Pass = IniRead (@ScriptDir & "\Pit_Script.ini","_Info_", "Pass","")

$Click = IniRead (@ScriptDir & "\Pit_Script.ini", "_Delays_", "Click","")

run ("Explorer.exe http://www.alienaa.com","",@SW_MAXIMIZE)

Sleep (5000)

Winactivate("A3 - Awakening - Microsoft Internet Explorer")

Send ("{TAB}")

Sleep (2500)

Send ("www.alienaa.com")

Send("{ENTER}")

Sleep (3000)

WinsetTitle("A3 - Awakening - Microsoft Internet Explorer","","Pit_Script")

Winmove("Pit_Script","", 277,97,831,651)

Send ("{TAB}")

Sleep (2500)

Send ("{TAB}")

Send ($Email)

Sleep (2000)

Send ("{TAB}")

Sleep (2000)

Send ("{ENTER}")

Sleep(3000)

Do

Sleep($Click)

$Side = PixelGetColor (818,604)

If $Side = 16382971 Then

MouseClick("Left", 817, 612, 1, 40)

Sleep($Click)

Endif

Untill $Side = 16568762

MouseClick("Left", 205, 599, 1, 40)

Sleep($Click)

MouseClick("Left", 438, 509, 1, 40)

Sleep($Click)

Do

Sleep($Click)

$Side = PixelGetColor (818,604)

If $Side = 16382971 Then

MouseClick("Left", 817, 612, 1, 40)

Sleep($Click)

Endif

Untill $Side = 16568762

MouseClick("Left", 211, 502, 1, 40)

Sleep(2500)

MouseClick("Left", 277, 331, 1, 40)

Sleep($Click)

{{{{{{{{{{{{{{{{{{

Mouseclick("Left", 359, 235, 1, 40)

Sleep($Click)

Do

$PixMine = PixelGetcolor (208,279)

$PixMine2 = PixelGetColor (206,331)

$Pixest = PixelGetColor (370,221)

$Pixest2 = PixelGetColor (369,250)

If PixMine = 13693136 Then

Mouseclick("Left", 208, 279, 1, 40)

Sleep($Click)

Endif

If $PixMine2 = 13693136 Then

Mouseclick("Left", 206, 331, 1, 40)

Sleep($Click)

Endif

If $Pixest = 13693136 Then

Mouseclick("Left", 370, 221, 1, 40)

Sleep($Click)

Endif

If $Pixest2 = 13693136 Then

Mouseclick("Left", 369, 250, 1, 40)

Sleep($Click)

Endif

Until $Pixest = 16777215

Sleep($Click)

Do

$PixMine = PixelGetcolor (208,279)

$PixMine2 = PixelGetColor (206,331)

$PixWest = PixelGetColor (333,219)

$PixWest2 = PixelGetColor (338,247)

If $PixMine = 13693136 Then

Mouseclick("Left", 208, 279, 1, 40)

Sleep($Click)

Endif

If $PixMine2 = 13693136 Then

Mouseclick("Left", 206, 331, 1, 40)

Sleep($Click)

Endif

If $PixWest = 13693136 Then

Mouseclick("Left", 333, 219, 1, 40)

Sleep($Click)

Endif

If $PixWest2 = 13693136 Then

Mouseclick("Left", 338, 247, 1, 40)

Sleep($Click)

Endif

Until $PixWest = 16777215

Sleep($Click)

Do

$PixNorth = PixelGetColor (353,207)

If $PixNorth = 1677215 Then

Mouseclick("Left" 370, 221, 1, 40)

Sleep($Click)

Endif

Until $PixNorth = 13693136

Sleep($Click)

Mouseclick("Left", 353, 207, 1, 40)

Sleep($Click)

$Stair = PixelGetColor (170,280)

$Stair2 = PixelGetColor (170,332)

If $Stair = 13693136 Then

Mouseclick("Left", 170, 280, 1, 40)

Sleep($Click)

Endif

If $Stair2 = 13693136 Then

Mouseclick("Left", 170, 332, 1, 40)

Sleep($Click)

Endif

MouseClick("Left", 357, 220, 1, 40)

Sleep($Click)

MouseClick("Left", 180, 280, 1, 40)

Sleep($Click)

MouseClick("Left", 360, 220, 1, 40)

Sleep($Click)

}}}}}}}}}}}}}}}

Link to comment
Share on other sites

is it not working as in not looping forever? or giving some error?

EDIT: whats with the DO commmands, what do they do?

woot! im a member :whistle: still a newb at heart tho...

Edited by Wallfire

:cheer: awww...wheres the chick?

Link to comment
Share on other sites

dunno what to tell ya, try debugging it. can it run just once? if not try isolating sections of code untill you find where the error is coming from. you also might find it useful to TAB out your lines of code anytime you have a loopand then TAB back once the loop finishes. that way you can tell if you have any open loops.

like this:

IF $x=1 Then
    ;Do the stuff here, tabed out.
       If $y=1 Then
            ;More stuff tabed more
       Next
Next;come back to the base line

see if that helps, my guess is yo have a DO loop no finishings somewhere

Edited by Wallfire

:cheer: awww...wheres the chick?

Link to comment
Share on other sites

hey lar, how did you do that? i suppose you are using some sort of code writer that auto indents for you?

im using notepad and as my code project is allready 200+ lines long things are getting messy!

also, with notepad every now and then it starts saving my work as name.au3.txt which wont run. why does it do this? and anyway to get it to stop?

and can i find a free-ware code writer that has auoit functions pre-defined so that it will know how to auto indent and such?

EDIT:

Odd, It Gives The Error About The Last Line... Evertime..

thats bc you got a hanging loop somewhere, gets to the end and expects to find a closing loop command.

lol, what does she spell?->:whistle:

Edited by Wallfire

:cheer: awww...wheres the chick?

Link to comment
Share on other sites

hey lar, how did you do that? i suppose you are using some sort of code writer that auto indents for you?

.. it's also a matter of discipline: try indenting as you code .. :whistle: Does wonders for the soul B)
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...