version = 0.0.2.1 beta InstallMethod = Default||Steam RiftLogfile_Default = %A_MyDocuments%\RIFT\log.txt RiftLogfile_Steam = %A_MyDocuments%\appdata\roaming\rift\log.txt OutputLog = %A_MyDocuments%\Rlog_Output.txt RiftWindowName = RIFT RiftWindowClass = TWNClientFramework ;RiftWindowClass = CabinetWClass CoordMode, ToolTip, Screen LanguageList = English||German EnglishList = has decayed|The fish got away|You stop fishing|You received GermanList = ist vom|Der Fisch ist entwischt|Ihr fischt nicht mehr|Ihr erhaltet CastingMethodList = Single Location||Multi Location (specified)|Multi Location (random) Loop, parse, LanguageList, | { CurrentLang = %A_loopField% loop, parse, %CurrentLang%List, | { %CurrentLang%_var%A_Index% = %A_LoopField% } } goto, Gui Gui: Gui, Add, Text, Section, Select Rift Install Method : Gui, Add, DropDownList, ys vInstallMethodSelection, %InstallMethod% Gui, Add, Text, Section xs, Select Logfile Language : Gui, Add, DropDownList, ys vLangSelection, %LanguageList% Gui, Add, Text, Section xs, Select Casting Method : Gui, Add, DropDownList, ys vCastingMethodSelection, %CastingMethodList% Gui, Add, Checkbox, xs vGenerateLog, Enable Logging? Gui, Add, Button, h30 gSetMouseLoc, START FISHING Gui, Show, ,Rift Fishing Assistant v%version% return 2GuiClose: GuiClose: ExitApp SetMouseLoc: gui, Submit RiftLogfile := RiftLogfile_%InstallMethodSelection% Gui, Info:Add, Text,, ----------------HOTKEYS----------------`n [ = Pause`n ] = Reload`n Esc = Exit Gui, Info:Add, Text,, Gui, Info:Add, Text, vStatusField h100 w150 border, ------------------STATUS------------------ Gui, Info:+AlwaysOnTop -Border Disabled Gui, Info:Show, x0 y0, InfoWindow Gui Info:Default GameID := WinExist(RiftWindowName " ahk_class " RiftWindowClass) If (GameID = "0x0") { MsgBox, , Error, There was a problem with locating Rift.`nPlease confirm that Rift is running before re-runing this program. ExitApp } IfWinNotActive, ahk_id %GameID% { WinActivate WinWaitActive } gosub, ConfirmLogEnabled IfWinActive, ahk_id %GameID% { SetTimer, ScanActiveWindow, On if (CastingMethodSelection = "Single Location") { GuiControl, Info:, StatusField, ----------------STATUS----------------`nMove Mouse to Fishing Location then Press and Release ALT one time KeyWait, Alt, D MouseGetPos, FishLocX, FishLocY KeyWait, Alt, U GuiControl, Info:, StatusField, ----------------STATUS----------------`nFishing Location set`nX%FishLocX% Y%FishLocY% Sleep, 2000 } else if (CastingMethodSelection = "Multi Location (specified)") { Loop, 4 { GuiControl, Info:, StatusField, ----------------STATUS----------------`nMove Mouse to Fishing Location %A_Index%/4 then Press and Release ALT one time KeyWait, Alt, D MouseGetPos, FishLoc_%A_Index%X, FishLoc_%A_Index%Y KeyWait, Alt, U GuiControl, Info:, StatusField, % "------------------STATUS------------------`nFishing Location " A_Index "/4 set`nx" FishLoc_%A_Index%X " y" FishLoc_%A_Index%Y Sleep, 2000 } } else if (CastingMethodSelection = "Multi Location (random)") { Loop, 2 { if (A_Index = "1") LocationName = TopLeft if (A_Index = "2") LocationName = BottomRight GuiControl, Info:, StatusField, ----------------STATUS----------------`nMove Mouse to %LocationName% of Fishing Location then Press and Release ALT one time KeyWait, Alt, D MouseGetPos, FishLoc_%A_Index%X, FishLoc_%A_Index%Y KeyWait, Alt, U GuiControl, Info:, StatusField, % "------------------STATUS------------------`nFishing Location " LocationName " set`nx" FishLoc_%A_Index%X " y" FishLoc_%A_Index%Y Sleep, 2000 } } GuiControl, Info:, StatusField, ----------------STATUS----------------`nMove Mouse to Pole Location then Press and Release ALT one time KeyWait, Alt, D MouseGetPos, PoleLocX, PoleLocY KeyWait, Alt, U GuiControl, Info:, StatusField, ----------------STATUS----------------`nPole Location set`nX%PoleLocX% Y%PoleLocY% Sleep, 2000 loadbait = 0 } Loop, 4 CheckVar%A_index% = % %LangSelection%_var%A_index% goto, StartFishing return ConfirmLogEnabled: FileDelete, %RiftLogfile% sleep, 200 Loop { Send, / sleep, 200 Send, log sleep, 200 Send, {enter} sleep, 200 IfExist, %RiftLogfile% break } return StartFishing: FileDelete, %RiftLogfile% GuiControl, Info:, StatusField, ----------------STATUS----------------`nCasting Line... last_line :=0 sleep, 1000 Send, - sleep, 400 if (CastingMethodSelection = "Single Location") { MouseMove, %FishLocX%, %FishLocY% sleep, 200 If (ValidClickCode = "") ValidClickCode := QueryMouseCursor() MouseClick, left, %FishLocX%, %FishLocY% } else if (CastingMethodSelection = "Multi Location (specified)") { Random, CurrentRandom, 1, 4 MouseMove, % FishLoc_%CurrentRandom%X, % FishLoc_%CurrentRandom%Y sleep, 200 If (ValidClickCode = "") ValidClickCode := QueryMouseCursor() MouseClick, left, % FishLoc_%CurrentRandom%X, % FishLoc_%CurrentRandom%Y } else if (CastingMethodSelection = "Multi Location (random)") { Random, RandomX, %FishLoc_1X%, %FishLoc_2X% Random, RandomY, %FishLoc_1Y%, %FishLoc_2Y% MouseMove, %RandomX%, %RandomY% sleep, 200 If (ValidClickCode = "") ValidClickCode := QueryMouseCursor() MouseClick, left, %RandomX%, %RandomY% } LogData("Sending Leftclick = x" FishLocX " y" FishLocY "`n") Sleep, 1000 CurrentMouseCode := QueryMouseCursor() LogData("Setting CurrentMouseCode = " CurrentMouseCode "`n") Timer := A_TickCount if (FishMouseCode = "") { LogData("FishMouseCode = Blank - starting set for FishMouseCode`n") GuiControl, Info:, StatusField, ----------------STATUS----------------`nScanning for First Bite... While (FishMouseCode = "") { if (QueryMouseCursor() != CurrentMouseCode) FishMouseCode := QueryMouseCursor() sleep, 100 LogData("Scanning for First Bite - FishMouseCode = " FishMouseCode " CurrentMouseCode = " CurrentMouseCode "`n") } LogData("FishMouseCode = " FishMouseCode " - completing set FishMouseCode`n") GuiControl, Info:, StatusField, ----------------STATUS----------------`nFirst bite found - Code Set LogData("sending leftclick to x" FishLocX " y" FishLocY "`n") } SetTimer, ScanFish, 500 SetTimer, ScanRiftLog, 1000 return ScanRiftLog: LogData("Trying to locate file : " RiftLogfile "`n") IfNotExist, %RiftLogfile% return FileRead, last_line, %RiftLogfile% LogData("Reading File : " RiftLogfile " : " last_line_replaced "`n") If last_line Contains %CheckVar1% { loadbait = 1 } If last_line Contains %CheckVar2%,%CheckVar3%,%CheckVar4% { SetTimer, ScanFish, Off SetTimer, ScanRiftLog, Off if (loadbait = "1") gosub, bait goto StartFishing } GuiControlGet, StatusOutput, , StatusField if (StatusOutput != "----------------STATUS----------------`nWaiting for Bite....") GuiControl, Info:, StatusField, ----------------STATUS----------------`nWaiting for Bite.... LogData("clearing values of last_line") last_line :=0 return ScanFish: if (QueryMouseCursor() = FishMouseCode) { MouseClick, left, %FishLocX%, %FishLocY% LogData("Bite Found - sending leftclick to x" FishLocX " y" FishLocY "`n") GuiControl, Info:, StatusField, ----------------STATUS----------------`nBITING FOUND!! sleep, 500 } return bait: If (loadbait = "0") return LogData("Reseting Bait to 0") loadbait = 0 sleep, 300 LogData("Sending key 0") Send, 0 sleep, 300 LogData("Moving Mouse to x" PoleLocX " y" PoleLocY "`n") MouseMove, %PoleLocX%, %PoleLocY% sleep, 300 Logdata("checking ValidClickCode = " ValidClickCode " - QueryMouseCursor = " QueryMouseCursor() "`n") if (ValidClickCode = QueryMouseCursor()) { LogData("Sending Leftclick to x" PoleLocX " y" PoleLocY "`n") MouseClick, left, %PoleLocX%, %PoleLocY% LogData("Pausing for 4secs and going back to Start") sleep, 4000 } return QueryMouseCursor(byRef numP=0) { NumPut(VarSetCapacity(CurrentCursorStruct, A_PtrSize + 16), CurrentCursorStruct, "uInt") DllCall("GetCursorInfo", "ptr", &CurrentCursorStruct) return (numP:=NumGet(CurrentCursorStruct, 8)) } ScanActiveWindow: { IfWinNotActive, ahk_id %GameID% { Pause GuiControl, Info:, StatusField, ----------------STATUS----------------`nWaiting for Bite.... } } LogData(Data) { global GenerateLog, OutputLog If (GenerateLog = "0") return FileAppend, %Data%, %OutputLog% } \::loadbait = 1 [::Pause ]::Reload Escape::ExitApp