johnspartan Posted March 2, 2008 Share Posted March 2, 2008 Hi, I just have a quick question on how to improve a fish bot I have for WOW that has been working great but is falling short on the fishing level max. I have 400 max but i need to apply lures to stop the 1 out of 5 catches. If somone can post an idea on how to add a 10 min timer to my script so that it hits a macro button i made and set on my tool bar or something that can type a macro of /cast lure it would be greatly appreciated. Here is my macro and all the feedbak is greatly appreciated (macro i use not made btw.) Thanks ; <AUT2EXE VERSION: 3.1.0.4> ; ---------------------------------------------------------------------------- ; <AUT2EXE INCLUDE-START: C:\Documents and Settings\Home\My Documents\fishing.au3> ; ---------------------------------------------------------------------------- ; **************************************************************************************************** **** ; Fishing by the sexylilwitch ; Globals $title = "WoW Fishing" $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_stormwind_daylight_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 = 20 ; 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 = 20 ; 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("Idiot! 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 ; **************************************************************************************************** **** Link to comment Share on other sites More sharing options...
MuffettsMan Posted March 2, 2008 Share Posted March 2, 2008 create an ingame macro to apply the lure set it to a seperate key on your hotbar - create a new timer to countdown 10 min then after that timer expires call a seperate function to hit that second hotkey and reset the timer - search my old posts i'm pretty sure some of the fishbots i posted on here have an example. basicly.... ; at the top... set variables $time_to_wait = 30000 $time_for_bobber = 4500 $time_for_loot = 1000 $time_for_trans = 610000 dim $trans_time dim $start_time dim $bobber_time dim $search_loot_time ; while 1 <added at the start of my loop if TimerDiff($trans_time) >= $time_for_trans then Sleep(3000) Send("3") Sleep(3000) reset_trans_timer() ; at the bottom... func reset_trans_timer() $trans_time = TimerInit() endfunc I even added a second timer to look for the bobber... i figured if it can't find the bobber in 5 seconds... its not going to find it at all thus recast and start over... oh at one time i was burning the 10 min primal fire transmute as an alchemest on that too but the same logic works for a bobber Don't let that status fool you, I am no advanced memeber! Link to comment Share on other sites More sharing options...
Tvern Posted March 2, 2008 Share Posted March 2, 2008 (edited) Hmm this looks allot like a script I got send by a friend ages ago. Since then I changed allot about it (made a GUI and it can now retrieve the color of the bobber in game, supports alternative colors if the first doesn't match, set the searchfield ingame, set up and store new profiles for different locations and attach lures)The I used to have an addon that applied lures, but that was no longer possible since 2.0. Instead I made a crude but effective workaround:I made the macro:/stopcasting (Applying a lure will stop your current cast 9/10 times. This line just reduces the chance of an error) /cast Bright Baubles (or another type of lure) /script PickupInventoryItem(16); (use it on your main hand)And made the script send the hotkey about 300ms after casting fishing.If a lure is still attached, you will get a pop-up box asking if you want to replace the current lure.If your lure expired it will reapply a lure.After that I have my script check if the bobber is still there and if so, wait for the splash. If it isn't (because you attached a lure) it returns to the start.I preferred this method over a second timer because it allows you to start and stop the script multiple times without applying a lure every time and because it was hard to make it 100% reliable so you didn't end up applying the lure to soon, or too late.Used to have:Func attach_lure() Send("hotkey for the above macro here") $Luretimer = timerinit() cast_pole() find_float() EndFuncand addedIf $Luretimer > 60000 Then attach_lure() EndIfto the top of "Func cast_pole()"Edit:I just came across a problem using PixelSearch and PixelGetColor in wow on my new laptop with windows Vista. Have you had any succes using your script under Vista?P.S. If you want a look at my script I can mail it to you. It's about 450 lines now and I don't realy want to post it on public forums. Edited March 2, 2008 by Tvern Link to comment Share on other sites More sharing options...
johnspartan Posted March 2, 2008 Author Share Posted March 2, 2008 Hmm this looks allot like a script I got send by a friend ages ago. Since then I changed allot about it (made a GUI and it can now retrieve the color of the bobber in game, supports alternative colors if the first doesn't match, set the searchfield ingame, set up and store new profiles for different locations and attach lures) The I used to have an addon that applied lures, but that was no longer possible since 2.0. Instead I made a crude but effective workaround: I made the macro: /stopcasting (Applying a lure will stop your current cast 9/10 times. This line just reduces the chance of an error) /cast Bright Baubles (or another type of lure) /script PickupInventoryItem(16); (use it on your main hand) And made the script send the hotkey about 300ms after casting fishing. If a lure is still attached, you will get a pop-up box asking if you want to replace the current lure. If your lure expired it will reapply a lure. After that I have my script check if the bobber is still there and if so, wait for the splash. If it isn't (because you attached a lure) it returns to the start. I preferred this method over a second timer because it allows you to start and stop the script multiple times without applying a lure every time and because it was hard to make it 100% reliable so you didn't end up applying the lure to soon, or too late. Used to have: Func attach_lure() Send("hotkey for the above macro here") $Luretimer = timerinit() cast_pole() find_float() EndFunc and added If $Luretimer > 60000 Then attach_lure() EndIf to the top of "Func cast_pole()" Edit: I just came across a problem using PixelSearch and PixelGetColor in wow on my new laptop with windows Vista. Have you had any succes using your script under Vista? P.S. If you want a look at my script I can mail it to you. It's about 450 lines now and I don't realy want to post it on public forums. I have had success usuing my script with vista basically i turn the res 800x600 and crank down all the graphics so the color blocks are huge and blockey and then turn off MSN messenger and it usually goes good cept for teh skil too low and missing the lures. I thank you for your imput but please forgive my ignorance here, but where would I imput this on the scipt? towards the top bottm? I have no expereirnce in writting scripts. If you want some more scripts for vista i can email you my other 2 i use on my laptop snyperwolf3d@yahoo.com Link to comment Share on other sites More sharing options...
Tvern Posted March 2, 2008 Share Posted March 2, 2008 I thank you for your imput but please forgive my ignorance here, but where would I imput this on the scipt? towards the top bottm? I have no expereirnce in writting scripts.Havn't tested it yet, but I think it would work like this: expandcollapse popup; **************************************************************************************************** **** ; Fishing by the sexylilwitch ; Globals $title = "WoW Fishing" $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) ;*********start the new function********:) attach_lure() ;*********done*************** ; **************************************************************************************************** **** 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_stormwind_daylight_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 = 20 ; 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 = 20 ; 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 ; **************************************************************************************************** **** ;***********new code!************:) func cast_pole() If $Luretimer > 60000 Then attach_lure() EndIf ;**********end of new code!************ $start_time = TimerInit() Send("1") Sleep(3000) find_float() endfunc ; **************************************************************************************************** **** func check_window() $dimensions = WinGetClientSize($win_title, "") if $dimensions[0] <> $screen_width or $dimensions[1] <> $screen_height then msg("Idiot! 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 ; **************************************************************************************************** **** ; ************New function************:) Func attach_lure() Send("2") Sleep(5000) $Luretimer = timerinit() cast_pole() EndFunc I have marked the new bits with a because it stand out nicely in the script. Presume the hotkey "2" for the lure macro (you'll have to set that one up in game. Link to comment Share on other sites More sharing options...
johnspartan Posted March 2, 2008 Author Share Posted March 2, 2008 Havn't tested it yet, but I think it would work like this: expandcollapse popup; **************************************************************************************************** **** ; Fishing by the sexylilwitch ; Globals $title = "WoW Fishing" $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) ;*********start the new function********:) attach_lure() ;*********done*************** ; **************************************************************************************************** **** 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_stormwind_daylight_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 = 20 ; 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 = 20 ; 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 ; **************************************************************************************************** **** ;***********new code!************:) func cast_pole() If $Luretimer > 60000 Then attach_lure() EndIf ;**********end of new code!************ $start_time = TimerInit() Send("1") Sleep(3000) find_float() endfunc ; **************************************************************************************************** **** func check_window() $dimensions = WinGetClientSize($win_title, "") if $dimensions[0] <> $screen_width or $dimensions[1] <> $screen_height then msg("Idiot! 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 ; **************************************************************************************************** **** ; ************New function************:) Func attach_lure() Send("2") Sleep(5000) $Luretimer = timerinit() cast_pole() EndFunc I have marked the new bits with a because it stand out nicely in the script. Presume the hotkey "2" for the lure macro (you'll have to set that one up in game. awesome thanks for the imput ill test it after work tonight Link to comment Share on other sites More sharing options...
johnspartan Posted March 3, 2008 Author Share Posted March 3, 2008 This is what i made it into and its giving me this error Line 147 if $luretimer > 60000 then if ^ ERROR Error: Variable used without being declared If anyone can check this over to see what i did wrong it would be greatly appreciated. ; <AUT2EXE VERSION: 3.1.0.4> ; ---------------------------------------------------------------------------- ; <AUT2EXE INCLUDE-START: C:\Documents and Settings\Home\My Documents\fishing.au3> ; ---------------------------------------------------------------------------- ; **************************************************************************************************** **** ; Fishing by the sexylilwitch ; Globals $title = "WoW Fishing" $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) attach_lure() 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_stormwind_daylight_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 = 20 ; 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 = 20 ; 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() If $Luretimer > 60000 Then attach_lure() EndIf $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("Idiot! 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 ; **************************************************************************************************** **** Func attach_lure() Send("2") Sleep(5000) $Luretimer = timerinit() cast_pole() endfunc ; **************************************************************************************************** **** Link to comment Share on other sites More sharing options...
Tvern Posted March 3, 2008 Share Posted March 3, 2008 This is what i made it into and its giving me this errorLine 147if $luretimer > 60000 thenif ^ ERRORError: Variable used without being declaredIf anyone can check this over to see what i did wrong it would be greatly appreciated.Ah didn't think of that one. just try to add$luretimer = 0under where it says "Globals" Should have expected that error. Link to comment Share on other sites More sharing options...
au3scr Posted March 3, 2008 Share Posted March 3, 2008 @johnspartan It seems like spam here. most people at here are not game freaks. reapeats in every 10 minutes AdlibEnable("Function", 10*60*1000) func function () code goes here end func Link to comment Share on other sites More sharing options...
johnspartan Posted March 6, 2008 Author Share Posted March 6, 2008 @johnspartan It seems like spam here.most people at here are not game freaks.reapeats in every 10 minutesAdlibEnable("Function", 10*60*1000)func function ()code goes hereend funcI cant get it to work ATM with everything imputted all thats happening is it casts a lure and doesnt cast the fishing pole.It just cycles over and over Link to comment Share on other sites More sharing options...
Fir3Fox Posted March 16, 2008 Share Posted March 16, 2008 I need it to ... 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