Jump to content


Photo

WoW Fishing Bot - Working as of 10/10/12


  • Please log in to reply
15 replies to this topic

#1 JustAGuy

JustAGuy
  • Members
  • 4 posts

Posted 21 April 2012 - 04:21 AM

I'll let you figure out how to operate and optimize it.

WinActivate, World of Warcraft
WinGetPos, X, Y, Width, Height, World of Warcraft
SearchBoxTopX := Round(Width / 4)
SearchBoxTopY := Round(Height / 4)
SearchBoxBottomX := Round(Width * 3 / 4)
SearchBoxBottomY := Round(Height * 4 / 7)

;GoSub ShowSearchArea 	;Used to show an rectangle arround 
			;SearchBoxTopX ,SearchBoxTopY,
			;SearchBoxBottomX,SearchBoxBottomY

;GoSub TestSend		;Used to test the send keys function,
			;if its not working, check for admin privilages.

;GoSub testmousecolors	;Used to test for the mouse color in two points
			;if its not the same, you probably got
			;hardware mouse enabled, disable it.

loop ; main loop (infinite)
{
	StartFishing()
	sleep, 2000
	if !MoveToBobber(SearchBoxTopX ,SearchBoxTopY,SearchBoxBottomX,SearchBoxBottomY)
	{
		sleep, 3000
		continue
	}
	if !GoToHotSpot()
	{
		sleep, 3000
		continue
	}
	if WaitForTrigger()
		mouseclick, right
	sleep, 3000
	;msgbox done
	;pause
}

WaitForTrigger()
{
	MouseGetPos, tx, ty
	ttx := tx + 2
	tty := ty + 2
	counter := 0
	PixelGetColor, Color1, %ttx%, %tty%
	loop 
	{
		sleep, 10
		PixelGetColor, Color2, %ttx%, %tty%
		if !CheckTolerance(Color1, Color2, 10)
		{
			;msgbox success
			return true
		}
		counter := counter + 1
		if counter > 280
			return false
	}
}
CheckTolerance(c1,c2,tol)
{
	b1 := (c1 >> 16) & 0xFF
	b2 := (c2 >> 16) & 0xFF
	g1 := (c1 >> 8) & 0xFF
	g2 := (c2 >> 8) & 0xFF
	r1 := c1 & 0xFF
	r2 := c2 & 0xFF
	;ListVars
	;Pause
	if abs(b1-b2) > tol
		return false
	if abs(g1-g2) > tol
		return false
	if abs(r1-r2) > tol
		return false
	return true
}
GoToHotSpot()
{
	MouseGetPos, tx, ty
	ttx := tx + 2
	tty := ty + 2
	PixelGetColor, Color1, %ttx%, %tty%
	ny := ty-7 
	nx := tx
	loop 
	{
		Mousemove, %nx%,%ny%,0
		sleep, 10
		nnx := nx+2
		nny := ny+2
		PixelGetColor, Color2, %nnx%, %nny%
		if !CheckTolerance(Color1, Color2, 100)
		{
			BTopY := ny
			break
		}
		ny := ny-7
		if abs(ny-ty) > 100
			return false
	}
	ny := ty+7
	loop 
	{
		Mousemove, %nx%,%ny%,0
		sleep, 10
		nnx := nx+2
		nny := ny+2
		PixelGetColor, Color2, %nnx%, %nny%
		if !CheckTolerance(Color1, Color2, 100)
		{
			BBottomY := ny
			break
		}
		ny := ny+7
		if abs(ny-ty) > 100
			return false
	}
	BMiddleY := round((BTopY+BBottomY)/2)+15
	;ListVars
	;Pause
	Mousemove, %nx%, %BMiddleY%
	asd := nx+2
	ssd := BMiddleY + 2
	PixelGetColor, Color1, %asd%, %ssd% 
	loop 
	{
		nx := nx-3
		Mousemove, %nx%, %BMiddleY% 
		sleep, 10
		nnx := nx+2
		nny := BMiddleY+2
		PixelGetColor, Color2, %nnx%, %nny%
		if !CheckTolerance(Color1, Color2, 100)
		{
			return true
		}
		if abs(nx-tx) > 100
			return false
	}
}
MoveToBobber(TopX , TopY, BottomX, BottomY)
{
	px:=TopX
	py:=TopY
	
	Mousemove, %px%,%py%,0
	sleep, 50
	nx:=px+2
	ny:=py+2
	PixelGetColor, Color1, %nx%, %ny%

	Loop
	{
		px := px + 30
		Mousemove, %px%,%py%,0
		sleep, 50
		nx:=px+2
		ny:=py+2
		PixelGetColor, Color2, %nx%, %ny%

		if !CheckTolerance(Color1, Color2, 100)
			return true
		if px > %BottomX%
		{
			py := py + 30
			px := TopX
			;return false
		}
		if py > %BottomY%
			return false
	}
}

StartFishing()
{
	sleep, 100
	send, {enter}
	sleep, 100
	send, /use fishing
	sleep, 100
	send, {enter}
}
TestSend:
sleep, 500
send, /sit
sleep, 100
send, {enter}
sleep, 500
return

ShowSearchArea:
settimer, rectangle, 100
Counter := 0
Loop {
Counter := Counter + 1
}
return

rectangle:
drawrect(SearchBoxTopX ,SearchBoxTopY,SearchBoxBottomX,SearchBoxBottomY)
return

drawrect(x1,y1,x2,y2,color=0x0000ff)
{

   guiID := WinExist()
   hdc := DllCall("GetDC", "UInt", guiID, "UInt")
   ps_Dash:=0
   hPen := DllCall("CreatePen", "Int",PS_DASH, "Int", 4, "Int", color, "UInt")
   objB := DllCall("SelectObject", "UInt", hdc, "UInt", brush, "UInt")
   objP := DllCall("SelectObject", "UInt", hdc, "UInt", hPen, "UInt")
   DllCall("Rectangle", "UInt", hdc, "Int", x1, "Int", y1, "Int", x2, "Int", y2)
}

testmousecolors:
loop {
MouseGetPos, tx, ty
nnx := tx + 12
nny := ty + 12
PixelGetColor, Color11, %nnx%, %nny%
msgbox %color11%
sleep, 5000
}
return


#2 bigtiger

bigtiger
  • Guests

Posted 03 May 2012 - 10:35 PM

The mouse only moves around when the wow's window is not selected. What am I doing wrong?

#3 JustAGuy

JustAGuy
  • Members
  • 4 posts

Posted 07 May 2012 - 07:36 AM

The mouse only moves around when the wow's window is not selected. What am I doing wrong?

It should select WoW window automatically.
You should put WoW in windowed 800x600 for optimal performance.

#4 salasa

salasa
  • Guests

Posted 08 May 2012 - 10:52 AM

Where should i put the code?..

#5 JustAGuy

JustAGuy
  • Members
  • 4 posts

Posted 09 May 2012 - 09:04 AM

Where should i put the code?..

download ahk and put the script in a text (txt) file, right click and run script.
you can run the exe instead tough..

#6 Guests

  • Guests

Posted 09 May 2012 - 03:12 PM

Exactly what I was looking for. Thx! If you can URL more WoW scripts, that would be awesome. Love my mage, but game takes too much time to maintain. Fish for Gold, and automate those boring RAIDS.

#7 lilMousten

lilMousten
  • Members
  • 1 posts

Posted 14 May 2012 - 12:58 AM

First of all when i try to put exe part 1 in a file it just says that i cant put it in it because i need a CD or something.

Then, when i just run it with exe part 2 it just dont work and my arrow go crazy in game so i can't close it in anyway, i need to ctrl alt delete and close my session.
Plus when my guy is fishing... he just recast the fishing pole midway channeling, and when a wild fish appear he just wont catch it, he would continue channeling then recast the pole without even catching any fish...

Can you help me???

#8 JustAGuy

JustAGuy
  • Members
  • 4 posts

Posted 21 May 2012 - 05:25 AM

First of all when i try to put exe part 1 in a file it just says that i cant put it in it because i need a CD or something.

Then, when i just run it with exe part 2 it just dont work and my arrow go crazy in game so i can't close it in anyway, i need to ctrl alt delete and close my session.
Plus when my guy is fishing... he just recast the fishing pole midway channeling, and when a wild fish appear he just wont catch it, he would continue channeling then recast the pole without even catching any fish...

Can you help me???


The exe is split to 2 files, u should extract both of them to one file and run it.
The mouse should go crazy, this is the bobber scan, It has a period of about 5 seconds between each cast where the script pauses and u can move the mouse around (to stop the script for example).

#9 Guests

  • Guests

Posted 22 May 2012 - 05:15 PM

Exactly what I was looking for. Thx! If you can URL more WoW scripts, that would be awesome. Love my mage, but game takes too much time to maintain. Fish for Gold, and automate those boring RAIDS.

Lol your doing it wrong if raids are boring for you....

#10 bowen666

bowen666
  • Members
  • 3 posts

Posted 27 May 2012 - 10:45 AM

The mouse only moves around when the wow's window is not selected.
How do you determine?

#11 CharlieBoii

CharlieBoii
  • Guests

Posted 27 May 2012 - 06:06 PM

The bot doesnt work... I drag part 1 into part 2 to start it. (i had wow open while i did it) and it starts to fish. and the mouse goes from left to right, but after awhile it stops and re casts fishing. why doesnt it loot?

#12 usernamenumber348383

usernamenumber348383
  • Members
  • 2 posts

Posted 14 July 2012 - 08:19 AM

The bot doesnt work... I drag part 1 into part 2 to start it. (i had wow open while i did it) and it starts to fish. and the mouse goes from left to right, but after awhile it stops and re casts fishing. why doesnt it loot?



I agree with CharlieBoii, I see the mouse moving across the screen, but it doesnt stop on the bobber when it hits it, it keeps doing the scanning movement. So obviously when you get a fish, it cant reel it in.

Script is broken as it is right now

#13 Simme

Simme
  • Guests

Posted 23 August 2012 - 02:55 PM

Hey can somone tell me how this bot works pls:)!!!

#14 JamixZol

JamixZol
  • Members
  • 54 posts

Posted 18 September 2012 - 04:29 AM

Found this on my backup drive

#15 dracula004

dracula004
  • Members
  • 2 posts

Posted 24 November 2012 - 10:32 AM

It's like my fishing script...

But my script could work with the WOW window not active...

I used Gdip to get the image from back window.