Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
the glow
May 31, 2009
Alright mates, me and a friend have been playing HC Expert and it's so difficult that you end up fishing a lot to gear up safely. Fishing is boring and not challenging so I wrote a short AHK script to automatically fish as rapidly as possible:



The script casts the line, then pixel colour checks the float to see if it's moving, with a bit of tolerance so that you don't get false positives when the float is gradually changing colour due to transitions between day/night. I've tested it in the ocean and various underground biomes and it seems to work ok.

How to use:
  • run the script with AHK
  • position the cursor just above the water's surface in such a way that when you cast the line, the cursor is over the float (this will be directly below your feet so you need a platform over the water)
  • toggle autofishing with the F2 key

here's the code

code:
#MaxThreadsPerHotkey 2
Pause::Pause
	
F2::
	if (fishing == 1) {
		fishing = 0
		return
	} else fishing = 1

	Loop {
		if (fishing == 1) {			
			manualClick()
			Sleep, 1000
			MouseGetPos xpos, ypos
			PixelGetColor, colorA, xpos, ypos-2
			
			Loop {
				PixelGetColor, colorB, xpos, ypos-2
				if (compare(colorA, colorB) > 5) {
					if (fishing == 1) {
						manualClick()
					}
					break
				} else PixelGetColor, colorA, xpos, ypos-2
			}
		} else break
	}
return

manualClick() {
	Click down
	Sleep, 50
	Click up
	Sleep, 50
}

compare(c1, c2) {
    rdiff := Abs((c1 >> 16) & 0xFF - (c2 >> 16) & 0xFF)
    gdiff := Abs((c1 >> 8) & 0xFF - (c2 >> 8) & 0xFF)
    bdiff := Abs(c1 & 0xFF - c2 & 0xFF)

    return rdiff + gdiff + bdiff
}

Adbot
ADBOT LOVES YOU

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply