Code:
#include <NomadMemory2.au3>
#include <Array.au3>
HotKeySet("{esc}", "myExit")
$x = WinActivate("~snip~")
Global $walk = 200()
Global $fish = 10000()
Global $stall = 50()
Global $food = 0x00FFF7()
Global $t2 = 0x00423B()
Global $mainwindow = "~snip~"
Global $pid = WinGetProcess($mainwindow)
Global $iHD = 0
Global $address = "0x06021F04" ;Change this every time you reload the game
Global $MemArray = _Memoryopen($pid)
Global $out = _MemoryRead($address, $MemArray)
;MsgBox(0,"test",$out)
_Memoryclose($pid)
If WinExists("~snip~") = 0 Then
MsgBox(0, "", "Application is not running. Please run it before starting this app.")
Exit
EndIf
while(1)
WalkBack() ;Calls the start of walking back to the fishing spot
For $fishCount = 1 To 9 ;Calls all the functions for the fishing run, does this 9 times.
Fish()
fMove1()
fMove2()
fMove3()
fMove4()
fMove5()
fMove6()
fMove7()
Next
For $lastFish = 1 To 1 ;Does the last run, skips the buff/wait time for the fish to respawn
Fish()
fMove1()
fMove2()
fMove3()
fMove4()
fMove5()
fMove6()
Next
Bank()
WEnd
Func WalkBack()
If $out = 4113 Then
Send("{s down}")
Sleep(550)
Send("{s up}")
Sleep($stall)
Call(wMove1)
Else
Send("{s down}")
Sleep(550)
Send("{s up}")
Sleep($stall)
Call(wMove1)
EndIf
EndFunc
Func wMove1()
$out = _MemoryRead($address, $MemArray)
If $out = 70417 Then
Send("{d down}")
Sleep(3000)
Send("{d up}")
Sleep($stall)
Call(wMove2)
Else
MsgBox(0, "Error", "wMove1")
Exit
EndIf
EndFunc
Func wMove2()
$out = _MemoryRead($address, $MemArray)
If $out = 201501 Then
Send("{s down}")
Sleep(4200)
Send("{s up}")
Sleep($stall)
Call(wMove3)
Else
MsgBox(0, "Error", "wMove2")
Exit
EndIf
EndFunc
Func wMove3()
$out = _MemoryRead($address, $MemArray)
If $out = 74781 Then
Send("{a down}")
Sleep(3900)
Send("{a up}")
Sleep($stall)
Call(wMove4)
Else
MsgBox(0, "Error", "wMove3")
Exit
EndIf
EndFunc
Func wMove4()
$out = _MemoryRead($address, $MemArray)
If $out = 140301 Then
Send("{s down}")
Sleep($walk)
Send("{s up}")
Sleep($stall)
Else
MsgBox(0, "Error", "wMove4")
Exit
EndIf
EndFunc
Func Fish() ;First function for fishing
$out = _MemoryRead($address, $MemArray)
If $out = 74765 Then
Send("{f down}")
Sleep($fish)
Send("{f up}")
Sleep($stall)
Else
MsgBox(0, "Error", "Fish")
Exit
EndIf
EndFunc
Func fMove1()
$out = _MemoryRead($address, $MemArray)
If $out = 74765 Then
Send("{a down}")
Sleep($walk)
Send("{a up}")
Sleep($stall)
Send("{s down}")
Sleep($walk)
Send("{s up}")
Sleep($stall)
Else
MsgBox(0, "Error", "fMove1")
Exit
EndIf
EndFunc
Func fMove2()
$out = _MemoryRead($address, $MemArray)
If $out = 74764 Then
Send("{f down}")
Sleep($fish)
Send("{f up}")
Sleep($stall)
Else
MsgBox(0, "Error", "fMove2")
Exit
EndIf
EndFunc
Func fMove3()
$out = _MemoryRead($address, $MemArray)
If $out = 74764 Then
Send("{a down}")
Sleep(700)
Send("{a up}")
Sleep($stall)
Else
MsgBox(0, "Error", "fMove3")
Exit
EndIf
EndFunc
Func fMove4()
$out = _MemoryRead($address, $MemArray)
If $out = 140297 Then
Send("{s down}")
Sleep($walk)
Send("{s up}")
Sleep($stall)
Else
MsgBox(0, "Error", "fMove4")
Exit
EndIf
EndFunc
Func fMove5()
$out = _MemoryRead($address, $MemArray)
If $out = 74761 Then
Send("{f down}")
Sleep($fish)
Send("{f up}")
Sleep($stall)
Else
MsgBox(0, "Error", "fMove5")
Exit
EndIf
EndFunc
Func fMove6()
$out = _MemoryRead($address, $MemArray)
If $out = 74761 Then
Send("{d down}")
Sleep(860)
Send("{d up}")
Sleep($stall)
Else
MsgBox(0, "Error", "fMove6")
Exit
EndIf
EndFunc
Func fMove7()
$out = _MemoryRead($address, $MemArray)
If $out = 205837 Then
Send("{s down}")
Sleep($walk)
Send("{s up}")
Sleep(2000)
CastBuffs()
Else
MsgBox(0, "Error", "fMove7")
Exit
EndIf
EndFunc
Func Bank()
Send("{d down}")
Sleep(4600)
Send("{d up}")
Sleep($stall)
Call(bMove1)
EndFunc
Func bMove1()
$out = _MemoryRead($address, $MemArray)
If $out = 205855 Then
Send("{w down}")
Sleep(3700)
Send("{w up}")
Sleep($stall)
Call(bMove2)
Else
MsgBox(0, "Error", "bMove1")
Exit
EndIf
EndFunc
Func bMove2()
$out = _MemoryRead($address, $MemArray)
If $out = 5151 Then
Send("{a down}")
Sleep(3800)
Send("{a up}")
Sleep($stall)
Call(bMove3)
Else
MsgBox(0, "Error", "bMove2")
Exit
EndIf
EndFunc
Func bMove3()
$out = _MemoryRead($address, $MemArray)
If $out = 136209 Then
Send("{w down}")
Sleep(850)
Send("{w up}")
Sleep($stall)
EndIf
$checkIfInvIsOpen = PixelSearch(1345, 625, 1350, 630, 0xCFAD94, 0)
If Not(@error) Then
Call(BankFish)
Else
MouseClick("left", 1089, 825, 1, 10)
Call(BankFish)
EndIf
EndFunc
Func BankFish()
$checkInvForFood = PixelSearch(1105, 626, 1351, 797, $food, 0)
If Not(@error) Then
MouseClick("left", $checkInvForFood[0], $checkInvForFood[1], 1, 15)
Send("{9}")
Sleep($stall)
Send("{9}")
Sleep($stall)
Send("{9}")
Sleep($stall)
Send("{enter}")
Call(T2)
Else
Call(T2)
EndIf
EndFunc
Func T2()
$checkForT2Crate = PixelSearch(1105, 626, 1351, 797, $t2, 0)
If Not(@error) Then
MouseClick("left", $checkForT2Crate[0], $checkForT2Crate[1], 1, 15)
Send("{9}")
Sleep($stall)
Send("{9}")
Sleep($stall)
Send("{9}")
Sleep($stall)
Send("{enter}")
Else
EndIf
EndFunc
Func CastBuffs()
Send("{-}")
Sleep(400)
Send("{0}")
Sleep(400)
Send("{9}")
Sleep(400)
Send("{8}")
EndFunc
Func Tele()
$CheckForTele = PixelSearch(1142, 696, 1172, 725, 0xFFBC44, 0)
If Not(@error) Then
MouseClick("left", $CheckForTele[0], $CheckForTele[1], 2, 15)
Sleep(13500)
MouseClick("left", 1090, 827, 2, 15)
CastBuffs()
Call(Bank)
Else
MouseClick("left", 1128, 827, 1, 15)
Call(Tele)
EndIf
EndFunc
Func myExit()
msgbox(0,"Exiting", "Bot is quitting")
Exit
EndFunc
I'm still new to coding so excuse my EXTREMELY sloppy way of doing this, that's why im here. Trying to figure out a proper way to move the character to the position even if it gets off track or something gets in the way. How the characters position works is a little weird. It reads from left to right just like a book. and it also has 4 values per tile, depending if your character is facing north, west, south or east. Anyway if there's anything else you need or any tips please comment below.