Jump to content

Recommended Posts

Posted

Well, I told myself, " I can do this" So.. I tryed the fishing script again, Heres what I need to know

HotKeySet("{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- #
Posted

Since last time I was here. Seems the forum has gotten slow Oo Odd.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Posted

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- #
  • Moderators
Posted

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ÝÝ[[Y
You only get the error you described when you don't do the proper checking for errors :P.

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.

Posted

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ÝÝ[[Y
You only get the error you described when you don't do the proper checking for errors :P.
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- #

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...