Jump to content

Not finding the right color


Recommended Posts

I made this fishbot for WoW yesterday but it's not working. It won't click the color I tell it to. Any suggestions on it?

;<--Variables
$wow = "World of Warcraft"
$title = "Fishbot"
$time_to_wait = 30000 
$MB_YESNO = 4 
$MB_YES = 6 
;<--Globals
dim $start_time
;<--Hotkeys
HotKeySet("{PAUSE}", "request_end") 
;<--Script Start
winSetState($wow, "", @SW_MAXIMIZE)
While 1
if TimerDiff($start_time) >= $time_to_wait then 
cast_pole() 
endif 
Local $Pix1 = PixelSearch(0, 0, @DesktopWidth - 1, @DesktopHeight - 1, 0xFFFFFF, 10)
Local $Pix2 = PixelSearch(0, 0, @DesktopWidth - 1, @DesktopHeight - 1, 0xE0ECE8, 10)
If $Pix1 <> 1 Or $Pix2 <> 1 Or $Pix3 <> 1 Or $Pix4 <> 1 Or $Pix5 <> 1  Then
    If IsArray($Pix1) Then 
    Send("{LShift Down}")
    MouseClick('Right', $Pix1[0], $Pix1[1], 1, 0)
    Send("{LShift Up}")
    endif
    If IsArray($Pix2) Then
    Send("{LShift Down}")
    MouseClick('Right', $Pix2[0], $Pix2[1], 1, 0)
    Send("{LShift Up}")
endif
EndIf
Sleep(2000)
Wend
;<--Functions
func cast_pole() 
$start_time = TimerInit() 
Send("1") 
Sleep(1000) 
endfunc 
func drain_timer() 
$start_time = $start_time - $time_to_wait 
endfunc 
func request_end() 
if MsgBox($MB_YESNO, $title, "Are you sure you want to exit?") == $MB_YES then 
Exit 
endif 
endfunc
Link to comment
Share on other sites

what does control send do?

Straight from the help file

Remarks

ControlSend works in a similar way to Send but it can send key strokes directly to a window/control, rather than just to the active window.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

I've seen other fishbots work like this.

; AutoIt Version: 3.0
; Language:    English
; Platform:    WinXP
; Author:        Mibz (Pantless Krab) (Edited)
;
; Script Function:
;   WoW FishBot.
;
; Wow Window Title - World of Warcraft
; WoW Window Size - w1032 x h795
; classname=GxWindowClassD3d
; Colour of splash - 0xA2A67D
;          0xC1AD7A
;          0xD0C08D
; Position of item -        x:44  y:226 (holds shift to loot)
; Position of hotkey 0 -    x:409 y:768 (types the key)


; Initial stuff
$time = MsgBox(3, "FishBot - Time of Day?", "Is it daytime?")
If $time = 2 Then Exit
WinActivate("World of Warcraft")
HotKeySet("{ESC}", "Terminate")
opt("SendKeyDownDelay", Random(10, 25, 1))
opt("MouseClickDownDelay", Random(10, 25, 1))

; Script Start
While 1
    Send("=")
    $start = TimerInit()
    While 1
        If $time = 6 Then
            $coord = PixelSearch(5, 300, 1024, 560, 0xF6F6F6, 30, 4)
        Else
            $coord = PixelSearch(5, 300, 1024, 560, 0xEEEEEE, 55, 3)
        EndIf
        
; 5, 300 - 1024, 560 can be changed if you want to search a wider area.
; Not recommended though since you can just adjust your view to fit all
; the water in that space. The bigger the area, the less likely it is to
; detect it.
; If the splash isn't getting detected then change the hex colour to
; something a bit closer. Top one is day, bottom is night.
        
        If UBound($coord) > 1 Then
            Send("{SHIFTDOWN}")
            MouseClick("right", $coord[0], $coord[1], 1, 3)
            Send("{SHIFTUP}")
            Sleep(Random(750, 1750, 1))
            ExitLoop
        Else
            Sleep(Random(350, 500, 1))
            $dif = TimerDiff($start)
            If $dif > Random(30200, 30700, 1) Then
                ExitLoop
            EndIf
        EndIf
    WEnd
WEnd


; Function to exit script
Func Terminate()
    Exit
EndFunc ;==>Terminate
Not sure if it works right now. This is the script that started me on AutoIt, :P. I added a few Random()s to make it harder to catch if Blizzard started looking for them or anything. Edited by gamerman2360
Link to comment
Share on other sites

Well, I think the only problem is that it can't tell where/when to click. So there will have to be another way to trigger it. I'm thinking either sound or fine tuning the color of the splash. If you want to follow the subject with sound go to http://www.autoitscript.com/forum/index.ph...wtopic=4298&hl=. But you would still have to find out where the bobber is and turn off all sound except the bobber sound. I think its possible to turn off all sound except for the bobber and the whisper click.

Edited by gamerman2360
Link to comment
Share on other sites

  • Moderators

If $Pix1 <> 1 Or $Pix2 <> 1 Or $Pix3 <> 1 Or $Pix4 <> 1 Or $Pix5 <> 1 Then

Where is the search for $Pix3/$Pix4/$Pix5?

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

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