-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChatPrefix_main.ahk
105 lines (90 loc) · 2.03 KB
/
ChatPrefix_main.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#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.
#Singleinstance force
#Persistent
DetectHiddenWindows, On
global Edit
global Aktywny
Menu, Tray, NoStandard
Gui Font, s18, Impact
Gui Add, Text, x8 y8 w107 h23 +0x200, ChatPrefix
Gui Font
Gui Add, Edit, x8 y40 w107 h21 vEdit, % "Zmień mnie!"
Gui Add, Text, x8 y64 w107 h24 +0x200, Wpisz prefix chatu
Gui Add, Text, x8 y88 w107 h23 +0x200, np. &&3
Gui Add, Button, x8 y120 w42 h23 gOdpal, % "Odpal"
Gui Add, Button, x64 y120 w42 h23 gStop, % "Stop"
Gui Add, Button, x8 y150 w98 h23 gLast, % "Ost. konfig"
Gui Show, w120 h182, ChatPrefix v. 3.1
Return
Quit:
{
CloseScript("ChatPrefix_core.exe")
ExitApp
}
GuiClose:
{
Zminimalizuj()
}
Success:=CloseScript("Case insensitive script name")
return
CloseScript(Name)
{
DetectHiddenWindows On
SetTitleMatchMode RegEx
IfWinExist, i)%Name%.* ahk_class AutoHotkey
{
WinClose
WinWaitClose, i)%Name%.* ahk_class AutoHotkey, , 2
If ErrorLevel
return "Unable to close " . Name
else
return "Closed " . Name
}
else
return Name . " not found"
}
;funkcja: usuwanie procesów ahk z tła
;Creditsy do Rijul Ahuja z forum autohotkey
Stop:
{
CloseScript("ChatPrefix_core.exe")
GuiControl, Hide, Aktywny
GuiControl, Show, Edit
}
Odpal:
{
Gui, Submit, NoHide
global Edit
GuiControl, Hide, Edit
ShowActive()
FileDelete, code.txt
FileAppend, %Edit%, code.txt
Run, ChatPrefix_core.exe
Zminimalizuj()
Return
}
Last:
{
FileRead, Edit, code.txt
GuiControl, Hide, Edit
ShowActive()
Run, ChatPrefix_core.exe
Zminimalizuj()
Return
}
ShowActive()
{
Gui Add, Text, x8 y40 w107 h21 +0x80 vAktywny, Aktywny: %Edit%
GuiControlGet, Aktywny
global Aktywny
}
Zminimalizuj()
{
Gui, Submit
Menu, Tray, NoStandard,
Menu, Tray, Add, Zamknij, Quit
MsgBox Program będzie działał jako zminimalizowany w zasobniku
}