AzKay Posted August 15, 2006 Share Posted August 15, 2006 Well, I told myself, " I can do this" So.. I tryed the fishing script again, Heres what I need to know expandcollapse popupHotKeySet("{F1}", "_PS") Opt("PixelCoordMode", 2) Opt("MouseCoordMode", 2) AdlibEnable("_OnHook") Global $OnHook $Center = 381 While 1 Sleep(100) WEnd Func _OnHook() $OnHook = PixelGetColor(464, 318) EndFunc Func _PS() MouseClick("Left", 381, 363, 1) Sleep(800) MouseClick("Left", 381, 363, 1) While 1 If $OnHook = Dec("F8D914") Then MsgBox(0, "OnHook", "OnHook!") While 1 $PixelSearch = PixelSearch(317, 296, 442, 437, 0x9A3B3B, 25) If $PixelSearch = > $Center Then MsgBox(0, "", "Went Right") ElseIf $PixelSearch = < $Center Then MsgBox(0, "", "Went Left") EndIf Sleep(5) WEnd ElseIf $OnHook = Dec("B92222") Then MsgBox(0, "OnHook", "Missed!") Sleep(15000) ExitLoop EndIf WEnd EndFunc How would I do it, for the $Pixelsearch = > $center then etc.etc... I mean like, how would I say, "If its right of the middle, msgbox saying "right" if its left from the middle, msgbox with "left" That is all ^^ ...For now. # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
AzKay Posted August 16, 2006 Author Share Posted August 16, 2006 Since last time I was here. Seems the forum has gotten slow Oo Odd. # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Valuater Posted August 16, 2006 Share Posted August 16, 2006 maybe... If $PixelSearch > (@DesktopWidth / 2) Then MsgBox(0, "", "Went Right") Else MsgBox(0, "", "Went Left") EndIf 8) Link to comment Share on other sites More sharing options...
AzKay Posted August 16, 2006 Author Share Posted August 16, 2006 Hmm, I just tryed: If $PixelSearch[0] > $Center Then MsgBox(0, "", "Went Right") ElseIf $PixelSearch[0] < $Center Then MsgBox(0, "", "Went Left") EndIf Because, I remembered that, it returns the 2 different coordinates, but, now I get this error: C:\Documents and Settings\Asus\My Documents\My Received Files\Defragmentieren.au3 (26) : ==> Subscript used with non-Array variable.: If $PixelSearch[0] > $Center Then If $PixelSearch^ ERROR # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 16, 2006 Moderators Share Posted August 16, 2006 Make sure it's an Array before doing any other calling.... We've gone over this before:$pos = PixelSearch(ladeeedah) If IsArray($pos) Then ;Do whatever from here Else ;Do what you would do if it wan't found EndIfoÝ÷ ØêÚºÚ"µÍÌÍÜÜÈH^[ÙXÚ YYYYZ BYÝÜ[ÓÝH]ÝHXÝH[HØ[Ü^[ÙXÚ BÑÈÚ]]ÛHB[ÙBÑÈÚ][ÝHÛÝ[ÈY]Ø[ÌÎNÝÝ[[YYou only get the error you described when you don't do the proper checking for errors . Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
AzKay Posted August 16, 2006 Author Share Posted August 16, 2006 Make sure it's an Array before doing any other calling.... We've gone over this before:$pos = PixelSearch(ladeeedah) If IsArray($pos) Then ;Do whatever from here Else ;Do what you would do if it wan't found EndIfoÝ÷ ØêÚºÚ"µÍÌÍÜÜÈH^[ÙXÚ YYYYZ BYÝÜ[ÓÝH]ÝHXÝH[HØ[Ü^[ÙXÚ BÑÈÚ]]ÛHB[ÙBÑÈÚ][ÝHÛÝ[ÈY]Ø[ÌÎNÝÝ[[YYou only get the error you described when you don't do the proper checking for errors .Thanks once again ^^. Yay, Finnished it ^^. Ive only one problem now, it stacks. because of all the loops in it. # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now