Jump to content

can someone look this script over


Recommended Posts

what i want it to do is loop the whole thing, do the first part, then set $run = 1 so the 2nd part knows to run something once, then the second part sets $run = 0 until the colors for the first part come again and set $run = 1.

but its not working, the 2nd part isnt running at all and i wonder if my syntax is wrong.

Sleep(10000)
while 1
$icon = PixelSearch(619, 17, 619, 17, 0x08148C)    
$exit = PixelSearch(637, 674, 638, 675, 0x760300)     
$queue = PixelSearch(1145, 147, 1146, 148, 0xDFC933) 
If IsArray($icon) = 0 and IsArray($queue) = 1 Then
MouseClick ( "Left", 14, 623, 1, 1 )
Sleep(120000)
else
EndIf
If IsArray($icon) = 0 and IsArray($queue) = 0 Then
[b]$run = 1
Send("{LSHIFT down}")
MouseClick ( "right", 200, 457, 1, 1 )
Sleep(500)
MouseClick ( "right", 400, 457, 1, 1 )
Sleep(500)
MouseClick ( "right", 600, 457, 1, 1 )
Sleep(500)
MouseClick ( "right", 800, 457, 1, 1 )
Sleep(500)
MouseClick ( "right", 1000, 457, 1, 1 )
Sleep(500)
MouseClick ( "right", 1200, 457, 1, 1 )
Sleep(500)
MouseClick ( "right", 1280, 457, 1, 1 )
Sleep(500)
Send("{LSHIFT up}")
;Send("{right down}")
;Sleep(250)
;Send("{right up}")
Sleep(5000)
else[/b]
EndIf
MouseMove(637,675)
$icon = PixelSearch(619, 17, 619, 17, 0x08148C)   
$exit = PixelSearch(637, 674, 638, 675, 0x760300)
$queue = PixelSearch(1145, 147, 1146, 148, 0xDFC933)
If IsArray($icon) = 1 and IsArray($queue) = 1 and IsArray($exit) = 1 Then
Sleep(5000)
else
EndIf
If IsArray($icon) = 1 and IsArray($queue) = 1 and IsArray($exit) = 0 Then
Sleep(120000)
else
EndIf
MouseClick ( "left", 655, 682, 1, 1 )
[b]If IsArray($icon) = 1 and IsArray($queue) = 1 and $run = 1 Then
MouseClick ( "left", 655, 682, 1, 1 )
MouseClick ( "left", 655, 682, 1, 1 )
Sleep(500)
Send("{F6}")
Send("{Up down}")
Sleep(4500)
Send("{Up up}")
MouseMove(696,991)
MouseDown("Left")
MouseUp("Left")
Sleep(5000)
Send("{Up down}")
Sleep(18000)
Send("{Up up}")
Send("{Left Down}")
Sleep(500)
Send("{Left Up}")
Send("{Up Down}")
Sleep(4000)
Send("{Up up}")
Sleep(3000)
Send("{right Down}")
Sleep(500)
Send("{right Up}")
Send("{Up Down}")
Sleep(3000)
Send("{Up up}")
Send("{Left Down}")
Sleep(500)
Send("{Left Up}")
Send("{Right Down}")
Sleep(250)
Send("{Right Up}")
Send("{Up Down}")
Sleep(8000)
Send("{Up up}")
Send("{Right Down}")
Sleep(250)
Send("{Right Up}")
Send("{Up Down}")
Sleep(3000)
Send("{Up up}")
Send("{Left Down}")
Sleep(250)
Send("{Left Up}")
Send("{Up Down}")
Sleep(3000)
Send("{Up up}")
Send("{Left Down}")
Sleep(170)
Send("{Left Up}")
Send("{Up Down}")
Sleep(3000)
Send("{Up up}")
MouseMove(1154,149)
MouseDown("Left")
MouseUp("Left")
MouseMove(692,983)
MouseDown("left")
MouseUp("left")
Send("{SPACE}")
MouseMove(13,592)
MouseDown("left")
MouseUp("left")
$run = 0[/b]
;Send("{Up up}")
MouseClick ( "left", 15, 621, 1, 1 )
Sleep(12000)
MouseClick ( "left", 15, 621, 1, 1 )
MouseClick ( "left", 636, 675, 1, 1 )
Sleep(120000)
MouseClick ( "left", 15, 621, 1, 1 )
MouseClick ( "left", 636, 675, 1, 1 )
Sleep(120000)
else

EndIf



wend
Link to comment
Share on other sites

that code is so hard to follow(Just because its all one big glob of code) Your best bet is to Download SciTE4Autoit3 It will save you SO much time and tell you if you syntax is wrong, plus it sorts the code into understandable chunks

Get SciTE4Autoit3

HERE

Link to comment
Share on other sites

Presumably you mean the section between the Bold codes? If none of that section is running then one or more of your If conditions is not true you don't need the = 1 for IsArray() either

If IsArray($icon) and IsArray($queue) and $run = 1 Then

Link to comment
Share on other sites

Presumably you mean the section between the Bold codes? If none of that section is running then one or more of your If conditions is not true you don't need the = 1 for IsArray() either

If IsArray($icon) and IsArray($queue) and $run = 1 Then

Chris is correct. that is very likely a potential problem. Also with the = 1 for IsArray(), IsArray() is a 'boolean' function. It either returns True (1) or False (0). So there's no need to add the = 1, by doing that you are basically saying "If True == True Then" instead of "If True Then". Both ways are logically correct, but the latter looks much cleaner. :D

Nomad :D

Link to comment
Share on other sites

Chris is correct. that is very likely a potential problem. Also with the = 1 for IsArray(), IsArray() is a 'boolean' function. It either returns True (1) or False (0). So there's no need to add the = 1, by doing that you are basically saying "If True == True Then" instead of "If True Then". Both ways are logically correct, but the latter looks much cleaner. :D

Nomad :D

well if i remove all the $run = 1 parts then the 2nd half loops, im trying something different with that scite thing, thx.

ill let everyone know how it turns out.

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...