Need Assistance Improving a Script to Automate Fishing on a Game in the browser.

Ask gaming related questions (AHK v1.1 and older)
batfan
Posts: 1
Joined: 16 Mar 2022, 09:15

Re: Need Assistance Improving a Script to Automate Fishing on a Game in the browser.

Post by batfan » 16 Mar 2022, 09:19

Drknyss wrote:
24 Jan 2022, 15:35
That was it! Everything is working properly now! Thank you so much. I totally missed that.

I really appreciate your help and back and forth on all this. I'm still learning a lot here but It feels great to have something finally work like it should!

Thank you again!
What were the changes you did to get it to work? I've tried for a while and can't get it to recognize the moving object

chukyloboff
Posts: 1
Joined: 04 Jun 2022, 02:41

Re: Need Assistance Improving a Script to Automate Fishing on a Game in the browser.

Post by chukyloboff » 04 Jun 2022, 02:44

Drknyss wrote:
24 Jan 2022, 15:35
That was it! Everything is working properly now! Thank you so much. I totally missed that.

I really appreciate your help and back and forth on all this. I'm still learning a lot here but It feels great to have something finally work like it should!

Thank you again!
You don't mind dropping the script?

kutayfun
Posts: 1
Joined: 19 Aug 2022, 04:40

Re: Need Assistance Improving a Script to Automate Fishing on a Game in the browser.

Post by kutayfun » 19 Aug 2022, 04:43

can you share the final code?

kelyn
Posts: 1
Joined: 17 Sep 2022, 02:53

Re: Need Assistance Improving a Script to Automate Fishing on a Game in the browser.

Post by kelyn » 17 Sep 2022, 02:56

Hey, could you please share the script? I've been trying to edit it, but the script only detects first fish and then breaks, however blue circle detection works just fine.

Code: Select all

CoordMode, Mouse, Screen
CoordMode, Pixel, Screen
xpos1=
xpos2=
SetMouseDelay,-1
SetBatchLines, -1
Process, Priority,, High

InputBox, howmuchbait, Bait Amount,How much bait to use?, ; Input Amount of Bait to Use
tooltip, Put mouse in top left corner of pond and press F1
Return
f1::
If xpos1 =  
	{
	MouseGetPos, xpos1, ypos1
	tooltip, Put mouse in bottom right corner of pond and press F1
	Return
	}
If xpos2 =  
	{
	MouseGetPos, xpos2, ypos2
	; tooltip, Put mouse in the Left Middle of pond and press F1
	; Return
	}
tooltip, fishing will begin in 3 seconds. Press F2 to end early
sleep 3000
tooltip
loop	{
	loop	{
		PixelSearch, 1Px, 1Py, %xpos1%, %ypos1%, %xpos2%, %ypos2%, 0x50452F, 20, Fast ; Find Fish
			if (ErrorLevel = 1)	
				{
				tooltip, No Fish Found
				}
			else if (ErrorLevel = 0)	
				{
				1Py := 1Py + 30
				MouseClick, left, %1Px%, %1Py% ; Click on Fish
				tooltip, Fish Found, Click
				fishcount++	; Increase Fish Count
				break
				}
		}
			sleep 500
	loop	{
		loopcount++ ; Displays a count on screen to verify search is progressing
		PixelSearch, 2Px, 2Py, %xpos1%, %ypos1%, %xpos2%, %ypos2%, 0xFF0000, 5, Fast ; Find Blue Button
			if (ErrorLevel = 1)	
				{
				tooltip, No Circle Found. Attempt %loopcount%
				}
			else if (ErrorLevel = 0)
				{
				tooltip, I found the Circle! 
				2Py := 2Py + 50	
				MouseMove, %2Px%, %2Py%	; Used to test Mouse Click Position
				MouseClick, left, %2Px%, %2Py% ; Click on Blue Button
				; tooltip, I tried to click the Circle!
				break
				}
			sleep 500
		}
	if fishcount = %howmuchbait%	; End Fishing if Fishcount = Bait Wanted to Use
	break
	}	
	
f2::
Msgbox, I got you %fishcount% fish ; Display number of fish caught
reload	;exitapp

Gronho
Posts: 1
Joined: 10 Oct 2023, 11:18

Re: Need Assistance Improving a Script to Automate Fishing on a Game in the browser.

Post by Gronho » 10 Oct 2023, 11:23

Hi all
Can anyone share the code for this script, mine is allways clicking at the very top of my display for the fish after first try.

Code: Select all

xpos1=
xpos2=
SetMouseDelay,-1
SetBatchLines, -1
CoordMode, Mouse, Screen
CoordMode, Pixel, Screen
Process, Priority,, High

InputBox, howmuchbait, Bait Amount,How much bait to use?, ; Input Amount of Bait to Use
tooltip, Put mouse in top left corner of pond and press F1
Return
f1::
If xpos1 =  
	{
	MouseGetPos, xpos1, ypos1
	tooltip, Put mouse in bottom right corner of pond and press F1
	Return
	}
If xpos2 =  
	{
	MouseGetPos, xpos2, ypos2
	tooltip, Put mouse in the Left Middle of pond and press F1
	Return
	}
tooltip, fishing will begin in 3 seconds. Press F2 to end early
sleep 3000
tooltip
loop	{
	loop	{
		PixelSearch, 1Px, 1Py, %xpos1%, %ypos1%, %xpos2%, %ypos2%, 0x50452F, 20, Fast ; Find Fish
			if (ErrorLevel = 1)	
				{
				tooltip, No Fish Found
				}
			else if (ErrorLevel = 0)	
				{
				1Py := 1Py + 30
				MouseClick, left, %1Px%, %1Py% ; Click on Fish
				tooltip, Fish Found, Click
				fishcount++	; Increase Fish Count
				break
				}
		}
			sleep 500
	loop	{
		loopcount++ ; Displays a count on screen to verify search is progressing
		PixelSearch, 2Px, 2Py, %xpos1%, %ypos1%, %xpos2%, %ypos2%, 0xFF0000, 5, Fast ; Find Blue Button
			if (ErrorLevel = 1)	
				{
				tooltip, No Circle Found. Attempt %loopcount%
				}
			else if (ErrorLevel = 0)
				{
				tooltip, I found the Circle! 
				2Py := 2Py + 50	
				MouseMove, %2Px%, %2Py%	; Used to test Mouse Click Position
				MouseClick, left, %2Px%, %2Py% ; Click on Blue Button
				; tooltip, I tried to click the Circle!
				break
				}
			sleep 500
		}
	if fishcount = %howmuchbait%	; End Fishing if Fishcount = Bait Wanted to Use
	break
	}	
	
f2::
Msgbox, I got you %fishcount% fish ; Display number of fish caught
reload	;exitapp

THANKS

Post Reply

Return to “Gaming Help (v1)”