This repository has been archived by the owner on Jun 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
LazyFishing.ahk
68 lines (55 loc) · 1.7 KB
/
LazyFishing.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
CoordMode, Mouse, Relative
EnvGet, LOCALAPPDATA, LOCALAPPDATA
; Showing Loading image.
SplashImage, %A_ScriptDir%/data/img/launcher/loadingstart.png, B, , , loading
WinSet, TransColor, White, loading
BotPID := DllCall("GetCurrentProcessId")
SetTimer, CheckCPU, 500
#Include %A_ScriptDir%/LFBot/LFB First Launch.ahk
#Include %A_ScriptDir%/LFBot/LFB Global Variables.ahk
#Include %A_ScriptDir%/LFBot/LFB GUI Design.ahk
#Include %A_ScriptDir%/LFBot/LFB GUI Loading Data.ahk
SplashImage, Off
; Show Main GUI.
Gui, Main:Show, x0 y0 w730 h430, LazyFishing v%BotVer%
; Prepare log file.
FormatTime, LogFileName, A_Now, dd.MM.yyyy-HH.mm.ss
LogPath := % A_ScriptDir . "\data\log\" . LogFileName . ".txt"
log("Started LazyFishing Bot v" . BotVer, LogPath)
Loop, %A_ScriptDir%\data\log\*
{
LogFileCount++
}
if (LogFileCount > 10)
{
log("Log folder has more than 10 log files. Auto clean log folder will be active.", LogPath)
Loop, %A_ScriptDir%\data\log\*
{
CurrentLogFileName := LogFileName . ".txt"
if (A_LoopFileName = CurrentLogFileName)
{
Continue
}
else
{
FileDelete, %A_ScriptDir%\data\log\%A_LoopFileName%
}
}
log("Log folder is cleaned.", LogPath)
}
return
CheckCPU:
CPU := Round(GetProcessTimes(BotPID), 1)
GuiControl, Main:, CPU, %CPU%`%
Return
#Include %A_ScriptDir%/LFBot/LFB Tab Controls.ahk
#Include %A_ScriptDir%/LFBot/LFB Functions.ahk
^+R::
Reload
Return
MainGuiClose:
ExitApp