[WoW] FishingBot! (AutoIt)

**CLOSED**
Verfügbare Informationen zu "[WoW] FishingBot! (AutoIt)"

  • Qualität des Beitrags: 0 Sterne
  • Beteiligte Poster: spawn
  • Forum: **CLOSED**
  • Forenbeschreibung: check www.german-coders.tk
  • aus dem Unterforum: [public] Games
  • Antworten: 1
  • Forum gestartet am: Freitag 25.05.2007
  • Sprache: englisch
  • Link zum Originaltopic: [WoW] FishingBot! (AutoIt)
  • Letzte Antwort: vor 16 Jahren, 9 Monaten, 24 Tagen, 16 Stunden, 28 Minuten
  • Alle Beiträge und Antworten zu "[WoW] FishingBot! (AutoIt)"

    Re: [WoW] FishingBot! (AutoIt)

    spawn - 03.06.2007, 01:25

    [WoW] FishingBot! (AutoIt)
    after a while i got annoyed with fishing it felt so pointless, and boring OH SO VERY BORING!! so i figured mleh im gonna hit up my friend google.com and see what i find, i found something quite worthy!

    Here’s an automatic fishing script that automatically casts, detects the splash of the bob sinking, strikes and then collects the items. The code runs in a script for Autoit . Download that first.

    Code: ; FishBOT 2

    ; Globals
    $title = “WoW FishBOT”
    $win_title = “World of Warcraft”

    $top_border_height = 23
    $left_border_width = 4

    $screen_width = 800
    $screen_height = 600

    $time_to_wait = 30000
    dim $start_time

    ; **************************************************
    ; Hot Keys
    HotKeySet("{PAUSE}", “request_end")

    ; **************************************************
    if not WinExists($win_title, “") then
    msg($win_title & ” window must be open.")
    Exit
    endif

    WinActivate($win_title, “")
    WinSetOnTop($win_title, “", 0)
    Sleep(500)

    check_window()

    $win_pos = WinGetPos($win_title, “")
    $win_x = $win_pos[0] + $left_border_width
    $win_y = $win_pos[1] + $top_border_height

    $top = $win_y + (.25 * $screen_height)
    $bottom = $top + (.35 * $screen_height) - 1
    $left = $win_x + (.15 * $screen_width)
    $right = $left + $screen_width - (.15 * 2.0 * $screen_width) - 1

    ; Show a visual confirmation by making the mouse draw the area on the screen
    ; that will be used to scan for the bobber.
    MouseMove($left, $top, 2)
    MouseMove($right, $top, 2)
    MouseMove($right, $bottom, 2)
    MouseMove($left, $bottom, 2)

    cast_pole()
    find_float()

    ; **************************************************
    func find_float()
    $color_dark_purple = 0x463B4D
    $color_dark_blue = 0x283A64
    $color_red = 0xA72C0B
    $color_stormwind_daylight_blue = 0x2B3254
    $color_stormwind_daylight_red = 0x6B1F0C
    $color_beige = 0xBB9B3D
    $color_night_blue = 0x0B1931

    ; this is the color used to pixelsearch for the bobber. change the color to a good color
    ; on the bobber that is prominent on the screen
    $color_to_use = $color_red

    ; this is the search tolerance. In areas where the bobber colors really stand out, you can
    ; use a fairly high threshold. In areas where the bobber colors are fairly muted in with
    ; the background, you will have to lower the values considerably.
    $bobber_search_tolerance = 30

    ; it’s better to use lower values here in favor of accurate searching. This will take more
    ; time for it to detect the bobber, but usually the splash doesn’t occur until at least 30%
    ; of the time has run out, and by that time, it should have detected the bobber (assuming the
    ; color values and tolerance are correct).
    $bobber_search_step = 2

    ; Search for float. In certain lighting, the part of the float may look more purple than
    ; blue. In this case, using $color_red tends to work the best with a tolerance of 20.
    while 1
    if TimerDiff($start_time) >= $time_to_wait then
    cast_pole()
    endif

    $pos = PixelSearch($left, $top, $right, $bottom, $color_to_use, $bobber_search_tolerance, $bobber_search_step)
    if @error then
    SetError(0)
    else
    MouseMove($pos[0], $pos[1], 2)
    find_splash($pos[0], $pos[1] )
    endif
    Sleep(10)
    wend
    endfunc

    ; **************************************************
    func find_splash($float_x, $float_y)
    $search_left = $float_x - 32
    $search_right = $search_left + 52
    $search_top = $float_y - 32
    $search_bottom = $search_top + 64

    ; Usually you do not have to modify the search color for the splash, as the pixels
    ; have a very distinctive, bright color.
    $splash_color = 0xF6F6F6

    ; Sometimes 30 tolerance works well, sometimes 20 is better in lit areas to avoid catching highlights
    ; in other things.
    $splash_tolerance = 30

    ; The search step can be pretty small here (1 to 3) without worries because the search area is
    ; so small once it has been narrowed down - speed isn’t much of an issue.
    $splash_search_step = 2

    ; Search for splash
    while TimerDiff($start_time) < $time_to_wait
    $pos = PixelSearch($search_left, $search_top, $search_right, $search_bottom, $splash_color, $splash_tolerance, $splash_search_step)
    if @error then
    SetError(0)
    else
    ; Click on the splash
    Send("{SHIFTDOWN}")
    Sleep(100)
    MouseClick("right", $pos[0], $pos[1], 1, 2)
    Sleep(100)
    Send("{SHIFTUP}")

    Sleep(5000)

    ExitLoop
    endif
    Sleep(10)
    wend

    ; Cast pole and start all over again.
    cast_pole()
    endfunc

    ; **************************************************
    func cast_pole()
    $start_time = TimerInit()
    Send("1″)
    Sleep(3000)
    endfunc

    ; **************************************************
    func check_window()
    $dimensions = WinGetClientSize($win_title, “")
    if $dimensions[0] <> $screen_width or $dimensions[1] <> $screen_height then
    msg("*****! Wrong window size. You must use ” & $screen_width & “x” & $screen_height & ” resolution in full screen mode.")
    Exit
    endif
    endfunc

    ; **************************************************
    func msg($text)
    MsgBox(0, $title, $text)
    endfunc

    ; **************************************************
    func msg_array($title, $array, $num_elements)
    dim $text
    $text = $array[0]

    for $j = 1 to $num_elements - 1
    $text = $text & “, ” & $array[$j]
    next

    MsgBox(0, $title, $text)
    endfunc

    ; **************************************************
    func request_end()
    $MB_YESNO = 4
    $MB_YES = 6

    if MsgBox($MB_YESNO, $title, “End script?") == $MB_YES then
    Exit
    endif
    endfunc

    ; **************************************************
    func drain_timer()
    Msg("Restart")
    $start_time = $start_time - $time_to_wait
    endfunc

    Copy that into a text file, and name it to something like fishbot.au3 "note the .au3 this is the filetype for AutoIt"

    Launch World of Warcraft, open video options and set your screen size to 800*600. you’re doing this as the script is going to look at each pixel on the screen. If you run at 800*600 there’s a lot less than running at 1920*1200 (my native res). If you don’t change to 800*600 it’ll shout at you.

    The PAUSE key quits the script!

    Equip your fishing pole. Put the fishing skill icon into slot 1 of your spells/actions bar. i.e. bottom left corner of screen so it’s hotkey is 1.

    Run it and sit back.

    This version seems to work much better at day time than night. Also it does miss some (as you might expect so don’t panic when it misses).

    If you want to tailor this for your favourite spot you can set the colours yourself. The important lines are:

    $color_red = 0xA72C0B
    $color_to_use = $color_red
    $splash_tolerance = 30

    (these may be different but hopefully you get the idea. Define a colour of one of the feathers on the bobber (red/blue) and the amount to search either side of the colour set).

    As you may expect the colour of the feathers changes depending upon day and night. The easiest way to make sure it works is to take a screen grab of your bobber wherever your fishing and find the hex value of one of the feathers. Most graphics packages can do it - otherwise just use MS Paint and something like Colour Detector to look up the pixel’s colour.


    I got my fishing up to level 150, gonna head to auction house to get a book to upgrade again, but its mighty better then clicking now, make sure that the window is active, you can't alt tab away and do other stuff, you should watch it like i did, of course i had a tv next to me watching The Man Show! on Comedy Channel

    Anyway i like to contribute!


    ....by spektra



    Mit folgendem Code, können Sie den Beitrag ganz bequem auf ihrer Homepage verlinken



    Weitere Beiträge aus dem Forum **CLOSED**



    Ähnliche Beiträge wie "[WoW] FishingBot! (AutoIt)"