Skip to content
This repository has been archived by the owner on Jun 12, 2022. It is now read-only.

Commit

Permalink
v1.7.2 (HotFix)
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
mannguyen0107 committed Sep 13, 2015
1 parent 906bd4b commit c54c7a1
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 79 deletions.
3 changes: 0 additions & 3 deletions LFBot/GUICreation.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions LFBot/GUIPreperation.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion LFBot/GlobalVariables.ahk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Global BotVer := "1.7.1"
Global BotVer := "1.7.2"
Global BDActive
Global ClientWidth
Global ClientHeight
Expand Down
28 changes: 14 additions & 14 deletions LFBot/Tab_BootDeconsBot.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down
88 changes: 43 additions & 45 deletions LFBot/Tab_FishingBot.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -101,70 +101,71 @@ 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.
If (8 < CurrentTime && CurrentTime < 11 or 45 < CurrentTime)
{
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)
}
}
}
Expand All @@ -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
Expand All @@ -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
}
Expand Down Expand Up @@ -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
Expand Down
35 changes: 20 additions & 15 deletions LFBot/Tab_Misc.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
{
Expand All @@ -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
}
Expand Down
8 changes: 7 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
- 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.
Binary file modified data/img/launcher/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c54c7a1

Please sign in to comment.