- 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
}
|
#
¿
Jul 10, 2015 00:09
|
|
- Adbot
-
ADBOT LOVES YOU
|
|
#
¿
May 15, 2024 22:03
|
|