From c54c7a13f2dfe8443a6cd8707005a88ac01b8585 Mon Sep 17 00:00:00 2001 From: Man Nguyen Date: Sun, 13 Sep 2015 16:53:29 +0700 Subject: [PATCH] v1.7.2 (HotFix) - Fixed count down clock of shutdown. - Fixed a bug where when you stop fishing on selected account all the others account would stop with it. - Improve fishing bot (thanks Nippy). - Fixed auto shutdown trove not closing all window of trove running. - Added a timer how long the bot have been running since opened. --- LFBot/GUICreation.ahk | 3 -- LFBot/GUIPreperation.ahk | 4 ++ LFBot/GlobalVariables.ahk | 2 +- LFBot/Tab_BootDeconsBot.ahk | 28 +++++------ LFBot/Tab_FishingBot.ahk | 88 +++++++++++++++++------------------ LFBot/Tab_Misc.ahk | 35 ++++++++------ changelog.txt | 8 +++- data/img/launcher/banner.png | Bin 1856 -> 2022 bytes 8 files changed, 89 insertions(+), 79 deletions(-) diff --git a/LFBot/GUICreation.ahk b/LFBot/GUICreation.ahk index 57d1792..b8ac32a 100644 --- a/LFBot/GUICreation.ahk +++ b/LFBot/GUICreation.ahk @@ -57,9 +57,6 @@ Gui, Main:Add, Text, x30 y490 h20 vBDCDTime, 00:00:00 Gui, Main:Font, S10 Q4, Verdana Gui, Main:Add, StatusBar -SB_SetParts(20, 450, 80) -SB_SetIcon(A_ScriptDir . "/data/img/main.ico", 1, 1) -SB_SetText("By: TaeJim", 3) ; Misc Tab Gui, Tab, 5, 1 diff --git a/LFBot/GUIPreperation.ahk b/LFBot/GUIPreperation.ahk index 156070c..9f2b491 100644 --- a/LFBot/GUIPreperation.ahk +++ b/LFBot/GUIPreperation.ahk @@ -72,5 +72,9 @@ GuiControl, Main:, SDHour, %SDTimeH% GuiControl, Main:, SDMin, %SDTimeM% GuiControl, Main:, SDSec, %SDTimeS% +SB_SetParts(20, 450, 80) +SB_SetIcon(A_ScriptDir . "/data/img/main.ico", 1, 1) +SB_SetText("By: TaeJim", 3) + IniRead, ClientWidth, %A_ScriptDir%/data/configs/loginsystem.ini, ClientSize, Width IniRead, ClientHeight, %A_ScriptDir%/data/configs/loginsystem.ini, ClientSize, Height \ No newline at end of file diff --git a/LFBot/GlobalVariables.ahk b/LFBot/GlobalVariables.ahk index 5ed0091..18135e6 100644 --- a/LFBot/GlobalVariables.ahk +++ b/LFBot/GlobalVariables.ahk @@ -1,4 +1,4 @@ -Global BotVer := "1.7.1" +Global BotVer := "1.7.2" Global BDActive Global ClientWidth Global ClientHeight diff --git a/LFBot/Tab_BootDeconsBot.ahk b/LFBot/Tab_BootDeconsBot.ahk index c1b4839..731e500 100644 --- a/LFBot/Tab_BootDeconsBot.ahk +++ b/LFBot/Tab_BootDeconsBot.ahk @@ -90,15 +90,15 @@ BDStart: IniRead, GetBDTime, %A_ScriptDir%/data/configs/bdsystem.ini, SessionDelay, Time SetTimer, BDUpdateOSD, 200 Periodsec := GetBDTime/1000 - StartTime = %A_Now% - EndTime = %A_Now% - EnvAdd EndTime, Periodsec, seconds - EnvSub StartTime, EndTime, seconds - StartTime := Abs(StartTime) - perc := 0 ; Resets percentage to 0, otherwise this loop never sees the counter reset + BDStartTime = %A_Now% + BDEndTime = %A_Now% + EnvAdd BDEndTime, Periodsec, seconds + EnvSub BDStartTime, BDEndTime, seconds + BDStartTime := Abs(BDStartTime) + BDPercent := 0 ; Resets percentage to 0, otherwise this loop never sees the counter reset Loop { - if perc = 100 + if BDPercent = 100 { break ; Terminate the loop } @@ -113,18 +113,18 @@ Return BDUpdateOSD: if (BDActive = 0) { - perc = 100 + BDPercent = 100 SetTimer, BDUpdateOSD, Off GuiControl, Main:, BDCDTime, 00:00:00 } else { - mysec := EndTime - EnvSub, mysec, %A_Now%, seconds - GuiControl, Main:, BDCDTime, % FormatSeconds(mysec) - perc := ((StartTime-mysec)/StartTime)*100 - perc := Floor(perc) - If (perc = 100) + BDTimeNow := BDEndTime + EnvSub, BDTimeNow, %A_Now%, seconds + GuiControl, Main:, BDCDTime, % FormatSeconds(BDTimeNow) + BDPercent := ((BDStartTime-BDTimeNow)/BDStartTime)*100 + BDPercent := Floor(BDPercent) + If (BDPercent = 100) { SetTimer, BDUpdateOSD, Off } diff --git a/LFBot/Tab_FishingBot.ahk b/LFBot/Tab_FishingBot.ahk index 06e3bde..a1ea28f 100644 --- a/LFBot/Tab_FishingBot.ahk +++ b/LFBot/Tab_FishingBot.ahk @@ -101,34 +101,35 @@ Return FishBiteMemoryScan: for index, element in BotList { - FishingAccountName := BotList[index, 15] + this_index := index ; keep the index static + FishingAccountName := BotList[this_index, 15] ;Setting Current time of scan. Used to compair for bot error hang CurrentTime = %a_now% WinID := ;Checking to make sure the next scan that the client is running. If not found it will auto remove form the list and move on to next. - WinID := BotList[index, 2] + WinID := BotList[this_index, 2] IfWinNotExist, ahk_id %WinID% { log(FishingAccountName . " account no longer found. It will now get remove from fishing.", TimeStamp, LogPath) ModifyListView("FishingList", FishingAccountName, 2, "0") ModifyListView("FishingList", FishingAccountName, 3, "Unknown") ModifyListView("FishingList", FishingAccountName, 4, "Idle") - BotList.Remove(index) + BotList.Remove(this_index) Return } - ; if (BotList[index, 13] = 0) + ; if (BotList[this_index, 13] = 0) ; { ; ModifyListView("FishingList", FishingAccountName, 3, "Unknown") ; ModifyListView("FishingList", FishingAccountName, 4, "Idle") ; } - if (BotList[index, 13] = 0) ; Checking to make sure the fishing flag and the recast flag are both set to 1 being on. + if (BotList[this_index, 13] = 0) ; Checking to make sure the fishing flag and the recast flag are both set to 1 being on. { ModifyListView("FishingList", FishingAccountName, 4, "Fishing") ; Checking last cast on record with current time. CurrentTime := - LastCastTime := BotList[index, 8] + LastCastTime := BotList[this_index, 8] EnvSub, CurrentTime, LastCastTime, Seconds ; Converting last last cast time to Seconds. ; Error handling to check to make sure it is still fishing. @@ -136,35 +137,35 @@ FishBiteMemoryScan: { FishingState := "0" ;Checking all 3 fishing states. - CaughtFishingStateWater := ReadMemory(BotList[index, 1], BotList[index, 9]) - CaughtFishingStateLava := ReadMemory(BotList[index, 1], BotList[index, 10]) - CaughtFishingStateChoco := ReadMemory(BotList[index, 1], BotList[index, 11]) + CaughtFishingStateWater := ReadMemory(BotList[this_index, 1], BotList[this_index, 9]) + CaughtFishingStateLava := ReadMemory(BotList[this_index, 1], BotList[this_index, 10]) + CaughtFishingStateChoco := ReadMemory(BotList[this_index, 1], BotList[this_index, 11]) ; If fishing state = 1 ignores the error logging. 15 If (CaughtFishingStateWater = 1 or CaughtFishingStateLava = 1 or CaughtFishingStateChoco = 1) { FishingState := "1" - BotList[index, 14] := "0" ;Since fishing is detected it will wipe out the Error Count. + BotList[this_index, 14] := "0" ;Since fishing is detected it will wipe out the Error Count. } If (FishingState = 0) { - If (BotList[index, 13] <> 1) ; If recast is not 1 it trigers the Error Report. + If (BotList[this_index, 13] <> 1) ; If recast is not 1 it trigers the Error Report. { SetTimer, Recast, Off - BotList[index, 14] := BotList[index, 14] + 1 ; Adds 1 for each time it is found not fishing. v1.2 Var Cleanup - BotList[index, 13] := 1 ;Turning on the recast flag. + BotList[this_index, 14] := BotList[this_index, 14] + 1 ; Adds 1 for each time it is found not fishing. v1.2 Var Cleanup + BotList[this_index, 13] := 1 ;Turning on the recast flag. SetTimer, Recast, 4000 - if (BotList[index, 14] > 2 && BotList[index, 14] < 9) + if (BotList[this_index, 14] > 2 && BotList[this_index, 14] < 9) { - log("the account: " . BotList[index, 15] . " seems to be not be fishing. Possible causes could be the client/character is frozen, full inventory or no more lures left. Please check on the account.", TimeStamp, LogPath) + log("the account: " . BotList[this_index, 15] . " seems to be not be fishing. Possible causes could be the client/character is frozen, full inventory or no more lures left. Please check on the account.", TimeStamp, LogPath) } - else if (BotList[index, 14] > 9) ; Checking to see if it erros = 10+ if so automatic stop on tht client. + else if (BotList[this_index, 14] > 9) ; Checking to see if it erros = 10+ if so automatic stop on tht client. { ;Automatic Stop - AFKList.Insert(Array(BotList[index, 15], BotList[index, 1])) - log("the account: " . BotList[index, 15] . " had more than 10 errors in a row, it will now be move to Anti-AFK list.", TimeStamp, LogPath) - BotList.Remove(index) + AFKList.Insert(Array(BotList[this_index, 15], BotList[this_index, 1])) + log("the account: " . BotList[this_index, 15] . " had more than 10 errors in a row, it will now be move to Anti-AFK list.", TimeStamp, LogPath) + BotList.Remove(this_index) } } } @@ -173,24 +174,24 @@ FishBiteMemoryScan: ;Memory scan for current client to check for fish bite If (12 < CurrentTime) ;Wont start a memory scan till 12Seconds has passed. This is to Lower cpu usage. { - If (BotList[index, 12] = 1) ;Water type found scan only water type + If (BotList[this_index, 12] = 1) ;Water type found scan only water type { - CaughtWater := ReadMemory(BotList[index, 1], BotList[index, 4]) + CaughtWater := ReadMemory(BotList[this_index, 1], BotList[this_index, 4]) } - Else If (BotList[index, 12] = 2) ;Lava type found scan only lava type + Else If (BotList[this_index, 12] = 2) ;Lava type found scan only lava type { - CaughtLava := ReadMemory(BotList[index, 1], BotList[index, 5]) + CaughtLava := ReadMemory(BotList[this_index, 1], BotList[this_index, 5]) } - Else If (BotList[index, 12] = 3) ;Choco type found only scan Choco type + Else If (BotList[this_index, 12] = 3) ;Choco type found only scan Choco type { - CaughtChoco := ReadMemory(BotList[index, 1], BotList[index, 6]) + CaughtChoco := ReadMemory(BotList[this_index, 1], BotList[this_index, 6]) } Else { ;Unknown type so we can all 3. This will use more cpu. - CaughtWater := ReadMemory(BotList[index, 1], BotList[index, 4]) - CaughtLava := ReadMemory(BotList[index, 1], BotList[index, 5]) - CaughtChoco := ReadMemory(BotList[index, 1], BotList[index, 6]) + CaughtWater := ReadMemory(BotList[this_index, 1], BotList[this_index, 4]) + CaughtLava := ReadMemory(BotList[this_index, 1], BotList[this_index, 5]) + CaughtChoco := ReadMemory(BotList[this_index, 1], BotList[this_index, 6]) } } Else @@ -204,14 +205,14 @@ FishBiteMemoryScan: If (CaughtWater = 1 or CaughtLava = 1 or CaughtChoco = 1) { ;Checking to see if the bot is already recasting. And if so it will ignore below. - If (BotList[index, 13] <> 1) + If (BotList[this_index, 13] <> 1) { SetTimer, Recast, Off - HumanPressButton("f", BotList[index, 1]) + HumanPressButton("f", BotList[this_index, 1]) Sleep 200 - BotList[index, 13] := 1 ;Turning on the recast flag. - BotList[index, 16] := BotList[index, 16] + 1 ;Padding the reeled in Counter. - ReelIn := BotList[index, 16] + BotList[this_index, 13] := 1 ;Turning on the recast flag. + BotList[this_index, 16] := BotList[this_index, 16] + 1 ;Padding the reeled in Counter. + ReelIn := BotList[this_index, 16] ModifyListView("FishingList", FishingAccountName, 2, ReelIn) SetTimer, Recast, 2000 } @@ -374,19 +375,16 @@ FishingStopSelected: ModifyListView("FishingList", LoginName, 3, "Unkown") ModifyListView("FishingList", LoginName, 4, "Idle") - WinGet, PID, PID, %LoginName% - - for index, element in BotList - { - If (BotList[index][1] = PID) - { - log("Stopped fishing for " . BotList[index, 15], TimeStamp, LogPath) - BotList.Remove(index) - Return - } - } - TotalClientsOnList := BotList.MaxIndex() + Loop, %TotalClientsOnList% + { + if (BotList[a_index, 15] = LoginName) + { + log("Stopped fishing for " . BotList[a_index, 15], TimeStamp, LogPath) + BotList.Remove(a_index) + } + } + if (TotalClientsOnList = 0) { CheckSetTimer := 0 diff --git a/LFBot/Tab_Misc.ahk b/LFBot/Tab_Misc.ahk index 46a7af9..2576464 100644 --- a/LFBot/Tab_Misc.ahk +++ b/LFBot/Tab_Misc.ahk @@ -452,15 +452,15 @@ SDStart: SDTimeSec := (SDHour*3600) + (SDMin*60) + SDSec SetTimer, SDUpdateOSD, 200 - StartTime = %A_Now% - EndTime = %A_Now% - EnvAdd EndTime, SDTimeSec, seconds - EnvSub StartTime, EndTime, seconds - StartTime := Abs(StartTime) - perc := 0 ; Resets percentage to 0, otherwise this loop never sees the counter reset + SDStartTime = %A_Now% + SDEndTime = %A_Now% + EnvAdd SDEndTime, SDTimeSec, seconds + EnvSub SDStartTime, SDEndTime, seconds + SDStartTime := Abs(SDStartTime) + SDPercent := 0 ; Resets percentage to 0, otherwise this loop never sees the counter reset Loop { - if perc = 100 + if SDPercent = 100 { break ; Terminate the loop } @@ -479,7 +479,12 @@ SDStart: if (ShutdownType = "Trove") { log("Auto shutdown time's up going to shutdown all Trove window now.", TimeStamp, LogPath) - WinClose, ahk_exe trove.exe + TotalClientToShutdown := BotList.MaxIndex() + Loop, %TotalClientsOnList% + { + SDPID := BotList[a_index, 15] + Process, Close, %SDPID% + } } else { @@ -493,18 +498,18 @@ Return SDUpdateOSD: if (SDActive = 0) { - perc = 100 + SDPercent = 100 SetTimer, SDUpdateOSD, Off GuiControl, Main:, SDCDTime, 00:00:00 } else { - mysec := EndTime - EnvSub, mysec, %A_Now%, seconds - GuiControl, Main:, SDCDTime, % FormatSeconds(mysec) - perc := ((StartTime-mysec)/StartTime)*100 - perc := Floor(perc) - If (perc = 100) + SDTimeNow := SDEndTime + EnvSub, SDTimeNow, %A_Now%, seconds + GuiControl, Main:, SDCDTime, % FormatSeconds(SDTimeNow) + SDPercent := ((SDStartTime-SDTimeNow)/SDStartTime)*100 + SDPercent := Floor(SDPercent) + If (SDPercent = 100) { SetTimer, SDUpdateOSD, Off } diff --git a/changelog.txt b/changelog.txt index 1443675..39276f6 100644 --- a/changelog.txt +++ b/changelog.txt @@ -82,4 +82,10 @@ v1.7: v1.7.1 (HotFix): - Fixed Resize All button. - Fixed a bug where it would clear log file when press Ctrl + F1. -- Change the selected slot image from cross to tick. \ No newline at end of file +- Change the selected slot image from cross to tick. +v1.7.2 (HotFix): +- Fixed count down clock of shutdown. +- Fixed a bug where when you stop fishing on selected account all the others account would stop with it. +- Improve fishing bot (thanks Nippy). +- Fixed auto shutdown trove not closing all window of trove running. +- Added a timer how long the bot have been running since opened. \ No newline at end of file diff --git a/data/img/launcher/banner.png b/data/img/launcher/banner.png index b7a401dcf3130e5f85220505a7a4295f7244908b..d2593b1ab1c6fc366ae6084acf701390b442b968 100644 GIT binary patch delta 1908 zcmY*a2~bnn5{;~rF%uvL44a}R@Q_u(pnz->guIXi!s>tv5~CuB5fMcQ`D{i+r2@-+@CFhAV?2AHiy zSY2lZf+Io%&leE#5BTu0oI->^#77w`^!Aq_9Fl9a&>erG3n^oeP=zRe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