-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPackage.ahk
84 lines (77 loc) · 2.44 KB
/
Package.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
;@Ahk2Exe-SetName 로다 플러그인
;@Ahk2Exe-SetDescription 팟플레이어 플러그인
;@Ahk2Exe-SetVersion 0.3.9
;@Ahk2Exe-SetCopyright Copyright (c) 2015`, 로다 &예지력
;@Ahk2Exe-SetOrigFileName 로다 플러그인
;@Ahk2Exe-SetCompanyName Copyright (c) 2015`, 로다 &예지력
FileCreateDir, % A_Temp . "\LodaPlugin\"
FileInstall, Resource\Resource.zip, % A_Temp . "\LodaPlugin\LodaPlugin.zip"
#SingleInstance Off
#KeyHistory 0
SetKeyDelay, 20, 10
SetWinDelay, 0
SetControlDelay, 0
ListLines Off
SetBatchLines, -1
ComObjError(0)
ShowGa := Func("ShowGa"), Terminate := Func("Terminate")
Menu, Tray, NoStandard
Menu, Tray, Add, 가가라이브 채팅, % ShowGa
Menu, Tray, Add,
Menu, Tray, Add, 종료하기, % Terminate
LoadResource()
global Resizer := DynaCall("MoveWindow", ["tiiiii", 1, 2, 3, 4, 5], _dHwnd := "", _dX := "", _dY := "", _dW := "", _dH := "", True)
global pVersion := "0.3.9"
global RsrcPath := A_Temp . "\LodaPlugin\"
global jXon := JSON.Load("https://goo.gl/z0b7GM",, True)
global ParsePos := {"PD": jXon.parse["Position_PD"]
, "Title": jXon.parse["Position_Title"]
, "TwitchPos": jXon.parse["Position_Twitch"]
, "TwitchPD": jXon.parse["Position_TwitchPD"]}
global __Noti := new CleanNotify("로다 플러그인", "팟플레이어 애드온`n" , (A_ScreenWidth / 3) + 10, (A_ScreenHeight / 6) - 10, "vc hc", "P")
global __Main := new LodaPlugin()
global __GaGa := new Browser("가가라이브 채팅", "http://goo.gl/zlBZPF")
__Main.RegisterCloseCallback(Func("Destruction"))
Win.Top(__Main.hPlugin)
Return
Destruction() {
Critical
If FileExist(RsrcPath . "hosts") {
FileRead, Backup, % RsrcPath . "hosts"
FileRead, Recent, C:\Windows\System32\Drivers\etc\hosts
If (Backup != Recent)
FileOpen("C:\Windows\System32\Drivers\etc\hosts", "w", "UTF-8").Write(Backup).Close()
}
DllCall("CoUninitialize")
ExitApp
}
LoadResource() {
If !FileExist(A_Temp . "\LodaPlugin\PD.png") {
zip := new ZipFile(A_Temp . "\LodaPlugin\LodaPlugin.zip")
zip.Unpack("", A_Temp . "\LodaPlugin\")
}
}
Terminate() {
If WinExist("ahk_id " . __Noti.hNotify)
Destruction()
Else
Win.Kill(__Main.PotPlayer["Hwnd"])
}
ShowGa() {
__GaGa.Show()
}
#Include <Functor>
#Include <Browser>
#Include <CleanNotify>
#Include <MsgBox>
#Include <JSON>
#Include <Input>
#Include <WinEvents>
#Include <Win>
#Include <SetWinEventHook>
#Include <Thread>
#Include <Zip>
#Include <DaumPotPlayer>
#Include <LodaPlugin>
;#Include <TVClose>
;#Include <ExecScript>