vanheartnet

Advance AutoShutdown Server

Oct 8th, 2020 (edited)
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 50.24 KB | None | 0 0
  1. ;@Ahk2Exe-SetCompanyName VANHEARTNET LTD. INC.
  2. ;@Ahk2Exe-SetCopyright All rights reserved © VANHEARTNET
  3. ;@Ahk2Exe-Set FileDescription, Server Advance Auto-Shutdown
  4. ;@Ahk2Exe-Set FileVersion, 1.2.2.0
  5. ;@Ahk2Exe-SetInternalName Advance Auto-Shutdown
  6. ;@Ahk2Exe-SetName Advance Auto-Shutdown
  7. ;@Ahk2Exe-SetOrigFileName Advance Auto-Shutdown
  8. ;@Ahk2Exe-Set ProductName, Advance Auto-Shutdown
  9. ;@Ahk2Exe-Set ProductVersion, 1.2.2.0
  10. ;@Ahk2Exe-Set Description, PISONET-AUTOSHUTDOWN
  11. ;@Ahk2Exe-Set Comments, Software Created by : VANHEARTNET
  12. ;@Ahk2Exe-Obey U_au, = "%A_IsUnicode%" ? 2 : 1 ; Script ANSI or Unicode?
  13. ;@Ahk2Exe-PostExec "BinMod.exe" "%A_WorkFileName%"
  14. ;@Ahk2Exe-Cont "%U_au%2.>AUTOHOTKEY SCRIPT<.01VANHEARTNET "
  15. ;@Ahk2Exe-SetMainIcon icon1.ico
  16. ;@Ahk2Exe-AddResource Icon1.ico, 160 ; Replaces 'H on blue'
  17. ;@Ahk2Exe-AddResource Icon1.ico, 206 ; Replaces 'S on green'
  18. ;@Ahk2Exe-AddResource Icon1.ico, 207 ; Replaces 'H on red'
  19. ;@Ahk2Exe-AddResource Icon1.ico, 208 ; Replaces 'S on red'
  20.  
  21.  
  22. #SingleInstance,Force
  23. #Persistent
  24. #NoEnv
  25. ;~ #NoTrayIcon
  26. Menu,tray, NoStandard
  27. Menu, Tray, Tip, Server
  28. Menu, Tray, Add, Advance Auto Shutdown,Advance1
  29. Menu, Tray, Add, Exit,AUTOSERVERGuiClose
  30. SetWorkingDir, %A_ScriptDir%
  31. SetBatchLines, -1
  32. #MaxHotkeysPerInterval 99000000
  33. #HotkeyInterval 99000000
  34. #KeyHistory 0
  35. ListLines Off
  36. Process, Priority, , A
  37. SetKeyDelay, -1, -1
  38. SetMouseDelay, -1
  39. SetDefaultMouseSpeed, 0
  40. SetWinDelay, -1
  41. SetControlDelay, -1
  42. DetectHiddenWindows, On
  43. SendMode Input
  44. #Include <Class_CustomFont>
  45. #Include <Gdip_All>
  46. #Include <GdipHelper>
  47. if not A_IsAdmin
  48. {
  49. Run, *RunAs "%A_ScriptFullpath%"
  50. ExitApp
  51. }
  52. pToken := Gdip_Startup()
  53.  
  54.  
  55. IfNotExist,%A_Appdata%\Fonts
  56. FileCreateDir,%A_Appdata%\Fonts
  57. IfNotExist,%A_Appdata%\Fonts\Pixel LCD-7.ttf
  58. FileInstall,Pixel LCD-7.ttf,%A_Appdata%\Fonts\Pixel LCD-7.ttf,1
  59. IfNotExist,%A_Appdata%\Fonts\FivoSansModern-ExtBlack-Oblique.otf
  60. FileInstall,FivoSansModern-ExtBlack-Oblique.otf,%A_Appdata%\Fonts\FivoSansModern-ExtBlack-Oblique.otf,1
  61. IfNotExist,%A_Appdata%\Fonts\Money Honey.ttf
  62. FileInstall,Money Honey.ttf,%A_Appdata%\Fonts\Money Honey.ttf
  63. IfNotExist,%A_Appdata%\Fonts\Republiko_PersonalUse.otf
  64. FileInstall,Republiko_PersonalUse.otf,%A_Appdata%\Fonts\Republiko_PersonalUse.otf
  65. IfNotExist,%A_Appdata%\Fonts\Multicolore Pro.otf
  66. FileInstall,Multicolore Pro.otf,%A_Appdata%\Fonts\Multicolore Pro.otf
  67.  
  68. font1 := New CustomFont( A_AppData "\Fonts\Pixel LCD-7.ttf")
  69. font2 := New CustomFont( A_AppData "\Fonts\Money Honey.ttf")
  70. Font3 := New CustomFont( A_AppData "\Fonts\FivoSansModern-ExtBlack-Oblique.otf")
  71. Font4 := New CustomFont( A_AppData "\Fonts\Republiko_PersonalUse.otf")
  72. Font5 := New CustomFont( A_AppData "\Fonts\Multicolore Pro.otf")
  73.  
  74. IfNotExist,\\%A_IPAddress1%\Users\%A_UserName%\Documents\AdvanceAutoshutdown\Auto\Users
  75. {
  76. FileCreateDir,\\%A_IPAddress1%\Users\%A_UserName%\Documents\AdvanceAutoshutdown\Auto\Users
  77. FileSetAttrib,+H,\\%A_IPAddress1%\Users\%A_UserName%\Documents\AdvanceAutoshutdown
  78. }
  79. ifNotexist,VANHEARTNET\PNG\Rewards
  80. FileCreateDir,VANHEARTNET\PNG\Rewards
  81. IfNotExist,VANHEARTNET\PNG\Rewards\RewardDefault.png
  82. FileInstall,DefaultPNG.png,VANHEARTNET\PNG\Rewards\RewardDefault.png
  83. IfExist,%A_Temp%\Rnumb.dat
  84. FileDelete,%A_Temp%\Rnumb.dat
  85. IfNotExist,\\%A_IPAddress1%\Users\%A_UserName%\Documents\AdvanceAutoshutdown\Auto\Member
  86. FileCreateDir,\\%A_IPAddress1%\Users\%A_UserName%\Documents\AdvanceAutoshutdown\Auto\Member
  87. ;~ ################################################################################################################################################################
  88. ;~ ################################################################################################################################################################
  89. ;~ ################################################################################################################################################################
  90.  
  91. FormatTime,TimeNow,%A_Now%,MM-dd-yyyy--hh:mm:ss tt
  92.  
  93. Global HB_Button:=[], Switch1:=[]
  94.  
  95.  
  96. IniRead,POINTSYSTEM,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,POINTSYSTEM
  97. IniRead,AUTOBACKUP,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,AUTOBACKUP
  98. IniRead,AUTOBACKUPPATH,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,AUTOBACKUPPATH
  99. IniRead,SERVERPATH,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,SERVERPATH
  100. IniRead,SECPERPOINTS,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,SECPERPOINTS
  101. IniRead,SERVERPATHFULL,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,SERVERPATHFULL
  102. IniRead,REWARD,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,REWARD
  103. if(SERVERPATHFULL="NONE"){
  104. IniWrite,\\%A_IPAddress1%\Users\%A_UserName%\Documents\AdvanceAutoshutdown\Auto\Member,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,SERVERPATHFULL
  105. SERVERPATHFULL=\\%A_IPAddress1%\Users\%A_UserName%\Documents\AdvanceAutoshutdown\Auto\Member
  106. }
  107. StringReplace,SERVERPATHFULL2,SERVERPATHFULL,Member,Rewards,All
  108. StringReplace,SERVERPATHFULL3,SERVERPATHFULL,\Member,,All
  109. IniRead,ADDPOINTS,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,ADDPOINTS
  110. IniRead,BONUSPOINTS,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,BONUSPOINTS
  111. IniRead,BONUSTIME,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,BONUSTIME
  112. IniRead,REQUSEPOINTS,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,REQUSEPOINTS
  113. IfNotExist,% SERVERPATHFULL2
  114. FileCreateDir,% SERVERPATHFULL2
  115. FileDelete,%A_Temp%\data.file
  116. Loop,VANHEARTNET\PNG\*.png,1
  117. {
  118. NumL1++
  119. USRNME1:=A_LoopFileName
  120. if (NumL1=1)
  121. FileAppend,% USRNME1 "|",%A_Temp%\data.file
  122. else
  123. FileAppend,% "|" USRNME1,%A_Temp%\data.file
  124. }
  125.  
  126. FileRead,WL,%A_Temp%\data.file
  127.  
  128.  
  129. Gui,AUTOSERVER:+AlwaysOnTop -Caption -DPIScale
  130. Gui,AUTOSERVER:Color,333333,aaaaaa
  131. Gui,AUTOSERVER:Add,GroupBox,x5 y1 w790 h590 BackgroundTrans,
  132. HB_Button.Push( New HB_Plain_Rounded_Button_Type_1( x := 250 , y := 120 , w := 200 , h := 50 , Button_Color := "1ad1ff" , Button_Background_Color := "333333" , Text := "SAVE" , Font := "Arial" , Font_Size := 16 , Font_Color_Top := "000000" , Font_Color_Bottom := "AAAAAA" , Window := "AUTOSERVER" , Label := "Save" ) )
  133. HB_Button.Push( New HB_Plain_Rounded_Button_Type_1( x := 250 , y+=50 , w := 200 , h := 65 , Button_Color := "ff471a" , Button_Background_Color := "333333" , Text := "OTHER SETTINGS" , Font := "Arial" , Font_Size := 14 , Font_Color_Top := "000000" , Font_Color_Bottom := "AAAAAA" , Window := "AUTOSERVER" , Label := "POINT_SYSTEM_CONFIG" ) )
  134.  
  135. HB_Button.Push( New HB_Plain_Rounded_Button_Type_1( x := 250 , y:=236 , w := 110 , h := 40 , Button_Color := "FFFF00" , Button_Background_Color := "333333" , Text := "Shutdown" , Font := "Arial" , Font_Size := 14 , Font_Color_Top := "000000" , Font_Color_Bottom := "AAAAAA" , Window := "AUTOSERVER" , Label := "ShutdownPC" ) )
  136. HB_Button.Push( New HB_Plain_Rounded_Button_Type_1( x+=110 , y:=236 , w := 110 , h := 40 , Button_Color := "FFFF00" , Button_Background_Color := "333333" , Text := "Restart" , Font := "Arial" , Font_Size := 14 , Font_Color_Top := "000000" , Font_Color_Bottom := "AAAAAA" , Window := "AUTOSERVER" , Label := "RestartPC" ) )
  137.  
  138. HB_Button.Push( New HB_Plain_Rounded_Button_Type_1( x := 235 , y := 278,w := 110 , h := 40 , Button_Color := "ff66ff" , Button_Background_Color := "333333" , Text := "Add PC" , Font := "Arial" , Font_Size := 16 , Font_Color_Top := "000000" , Font_Color_Bottom := "AAAAAA" , Window := "AUTOSERVER" , Label := "AddPC" ) )
  139. HB_Button.Push( New HB_Plain_Rounded_Button_Type_1( x+=110 , y:=278 ,w := 110 , h := 40 , Button_Color := "ff66ff" , Button_Background_Color := "333333" , Text := "Delete PC" , Font := "Arial" , Font_Size := 16 , Font_Color_Top := "000000" , Font_Color_Bottom := "AAAAAA" , Window := "AUTOSERVER" , Label := "DeletePC" ) )
  140. HB_Button.Push( New HB_Plain_Rounded_Button_Type_1( x := 250 , y+=40 ,w := 200 , h := 40 , Button_Color := "ff66ff" , Button_Background_Color := "333333" , Text := "Add Wallpaper" , Font := "Arial" , Font_Size := 16 , Font_Color_Top := "000000" , Font_Color_Bottom := "AAAAAA" , Window := "AUTOSERVER" , Label := "ADD1" ) )
  141. HB_Button.Push( New HB_Plain_Rounded_Button_Type_1( x := 250 , y+=40 ,w := 200 , h := 40 , Button_Color := "ff66ff" , Button_Background_Color := "333333" , Text := "Delete Wallpaper" , Font := "Arial" , Font_Size := 16 , Font_Color_Top := "000000" , Font_Color_Bottom := "AAAAAA" , Window := "AUTOSERVER" , Label := "DeleteWallpaper" ) )
  142. HB_Button.Push( New HB_Plain_Rounded_Button_Type_1( x := 30, y := 495 , w := 300 , h := 40 , Button_Color := "009900" , Button_Background_Color := "333333" , Text := "Change Backup Folder" , Font := "Arial" , Font_Size := 16 , Font_Color_Top := "000000" , Font_Color_Bottom := "AAAAAA" , Window := "AUTOSERVER" , Label := "ChangeBPath" ) )
  143. Gui,AUTOSERVER:Font,s36 cf2bb24, Republiko
  144. Gui,AUTOSERVER:Add,Text,x55 y20 BackgroundTrans gMove, ADVANCE AUTO-SHUTDOWN
  145. Gui,AUTOSERVER:Add,Progress,x10 y12 w780 h65 cBlack BackgroundBlack
  146. Gui,AUTOSERVER:Add,Text,x55 y20 BackgroundTrans gMove, ADVANCE AUTO-SHUTDOWN
  147. Gui,AUTOSERVER:Font,s36 c666666
  148. Gui,AUTOSERVER:Add,Text,x50 y20 BackgroundTrans, ADVANCE AUTO-SHUTDOWN
  149. Gui,AUTOSERVER:Add,Progress,x15 y80 w300 h30 cff66ff Backgroundff66ff,100
  150. Gui,AUTOSERVER:Font,
  151. Gui,AUTOSERVER:Font,s12 c666666,Money Honey
  152. Gui,AUTOSERVER:Add,Text,x20 y90 BackgroundTrans, C r e a t e d b y : V A N H E A R T N E T
  153. Gui,AUTOSERVER:Font,s12 cLime,Money Honey
  154. Gui,AUTOSERVER:Add,Text,x23 y90 BackgroundTrans, C r e a t e d b y : V A N H E A R T N E T
  155. Gui,AUTOSERVER:Font,
  156. Gui,AUTOSERVER:Font,s12 c33ccff,fivo Sans Modern ExtBlk
  157. Gui,AUTOSERVER:Add,Text,x20 y410 Left BackgroundTrans, ENABLE POINT SYSTEM
  158. Gui,AUTOSERVER:Add,Text,x20 y+10 Left BackgroundTrans, AUTO BACKUP MEMBER
  159.  
  160. Gui,AUTOSERVER:Font,
  161. Gui,AUTOSERVER:Font,s12 bold,Arial Black
  162. Gui,AUTOSERVER:Add,GroupBox,x15 y100 w770 h300 BackgroundTrans,
  163. Gui,AUTOSERVER:Add,Edit, x30 y130 w200 Border Center Disabled vEdit1,%A_IPAddress1%
  164. Gui,AUTOSERVER:Add,Edit, x30 y+10 w200 Border Center Disabled vEdit2,%A_UserName%
  165. Gui,AUTOSERVER:Add,Edit, x30 y+10 w200 -E0x200 Border Center vEdit3,% SERVERPATH
  166. Gui,AUTOSERVER:Add,Edit, x30 y+10 w200 -E0x200 Border Center Hidden vEdit5,
  167. Gui,AUTOSERVER:Font,
  168. Gui,AUTOSERVER:Font,s10 cwhite Bold
  169. Gui,AUTOSERVER:Add,Radio,x70 y295 w60 vRadio1 gRadio1 checked, Main
  170. Gui,AUTOSERVER:Add,Radio,x+10 w60 vRadio2 gRadio2, PC
  171. Gui,AUTOSERVER:Font,s12 bold cblack,Arial Black
  172. Gui,AUTOSERVER:Add,DDL,x30 y+10 w200 Border vDDL1 gDDL1,% WL
  173. Gui,AUTOSERVER:Add,DDL,x30 y+10 w200 Border vDDL2 gDDL2 Disabled,
  174. Gui,AUTOSERVER:Add,Edit, x30 y460 w300 -E0x200 Border LEFT vEdit7,% AUTOBACKUPPATH
  175. Gui,AUTOSERVER:Add,Progress,x10 y540 w780 h40 cBlack BackgroundBlack
  176. Gui,AUTOSERVER:Font,
  177. Gui,AUTOSERVER:Font,s8 c666666,Multicolore Pro
  178. Gui,AUTOSERVER:Add,Text,x20 y545 w765 BackgroundTrans, Advance Auto-Shutdown helps you saves electricity in your Pisonet/Coin Operated computer by shutting down your computer after the countdown timer ended.
  179. Gui,AUTOSERVER:Font,s8 cffff00
  180. Gui,AUTOSERVER:Add,Text,x18 y545 w765 BackgroundTrans, Advance Auto-Shutdown helps you saves electricity in your Pisonet/Coin Operated computer by shutting down your computer after the countdown timer ended.
  181. Gui,AUTOSERVER:Add,Progress,x475 y125 w302 h262 Backgroundc1c1c1,
  182. IfExist,VANHEARTNET\PNG\Wallpaper1.png
  183. Gui,AUTOSERVER:Add,Picture,x480 y130 w290 h250 Border BackgroundTrans vWallpic,VANHEARTNET\PNG\Wallpaper1.png
  184. else{
  185. FileInstall,Wallpaper1.png,VANHEARTNET\PNG\Wallpaper1.png,1
  186. Gui,AUTOSERVER:Add,Picture,x480 y130 w290 h250 Border BackgroundTrans vWallpic,VANHEARTNET\PNG\Wallpaper1.png
  187. }
  188. Switch1[1]:=New Switch_1( x:=260, y:=405, w:= 100, h:= 30, state:=POINTSYSTEM, BG_Color:="333333", Switch_BG_Color:="333333", Switch_F_Color:="404040", Switch_Border:="ffffff", Switch_Border2:="ffffff", Text_Color3:="00FF00", Font_Size:=20, Text1:="SwitchON", Text2:="SwitchOFF", Text_Color1:="FF0000", Text_Color2:="00FF00", Window:="AUTOSERVER", Label:="Switch1")
  189. Switch1[2]:=New Switch_1( x:=260, y+=25, w:= 100, h:= 30, state:=AUTOBACKUP, BG_Color:="333333", Switch_BG_Color:="333333", Switch_F_Color:="404040", Switch_Border:="ffffff", Switch_Border2:="ffffff", Text_Color3:="00FF00", Font_Size:=20, Text1:="SwitchON", Text2:="SwitchOFF", Text_Color1:="FF0000", Text_Color2:="00FF00", Window:="AUTOSERVER", Label:="Switch2")
  190. Gui,AUTOSERVER:Font,
  191. Gui,AUTOSERVER:Font,s12 Bold
  192. Gui,AUTOSERVER:Add,GroupBox,x340 y395 w450 h142 BackgroundTrans,
  193. Gui,AUTOSERVER:Add,Edit, x345 y452 w200 -E0x200 Border Center limit16 vEdit6,
  194. Gui,AUTOSERVER:Add,Edit, x345 y505 w200 -E0x200 Border Center limit16 vEdit8,
  195. Gui,AUTOSERVER:Font,
  196. Gui,AUTOSERVER:Font,s8 Bold cwhite
  197. Gui,AUTOSERVER:Add,Text,x345 y440 w200 BackgroundTrans,USERNAME
  198. Gui,AUTOSERVER:Add,Text,x345 y492 w200 BackgroundTrans,PASSWORD
  199.  
  200. Gui,AUTOSERVER:Font,
  201. Gui,AUTOSERVER:Font,s14 Bold cRed,Multicolore Pro
  202. Gui,AUTOSERVER:Add,Text,x345 y410 w440 Center BackgroundTrans,CREATE MEMBER
  203. Gui,AUTOSERVER:Add,Text,x346 y410 w440 Center BackgroundTrans,CREATE MEMBER
  204. Gui,AUTOSERVER:Font,s10
  205.  
  206. HB_Button.Push( New HB_Plain_Rounded_Button_Type_1( x := 560 , y:=450,w := 200 , h := 80 , Button_Color := "6699ff" , Button_Background_Color := "333333" , Text := "SUBMIT" , Font := "Arial" , Font_Size := 20 , Font_Color_Top := "000000" , Font_Color_Bottom := "AAAAAA" , Window := "AUTOSERVER" , Label := "Create" ) )
  207. Gui,AUTOSERVER:Show,w800 h600,Auto Shutdown Server
  208. Send, {End}
  209.  
  210. if(AUTOBACKUP=1)
  211. SetTimer, AutoBackupFiles, 5000
  212. SetTimer, HB_Button_Hover , 50
  213. return
  214. ShutdownPC:
  215. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  216. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  217. return
  218. SoundBeep, 5000
  219. if(Radio2=1){
  220. if(DDL1="") or (DDL1="ERROR")
  221. return
  222. FileAppend,,%SERVERPATHFULL3%\Users\%DDL1%Shutdown.file
  223. FileSetAttrib,+H,%SERVERPATHFULL3%\Users\%DDL1%Shutdown.file
  224. }
  225. return
  226.  
  227. RestartPC:
  228. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  229. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  230. return
  231. SoundBeep, 5000
  232. if(Radio2=1){
  233. if(DDL1="") or (DDL1="ERROR")
  234. return
  235. FileAppend,,%SERVERPATHFULL3%\Users\%DDL1%Restart.file
  236. FileSetAttrib,+H,%SERVERPATHFULL3%\Users\%DDL1%Restart.file
  237. }
  238. return
  239.  
  240.  
  241. POINT_SYSTEM_CONFIG:
  242. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  243. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  244. return
  245. Gui,AUTOSERVER:Submit,Nohide
  246. ;~ Gui,2:Submit,Nohide
  247. Gui,AUTOSERVER:Hide
  248. Gui,2:Default
  249. SoundBeep, 5000
  250. IfWinNotExist, OTHER SETTINGS
  251. {
  252. Gui,2:-DPIscale +OwnerAUTOSERVER +AlwaysOntop
  253. Gui,2:Color,333333,aaaaaa
  254. Gui,2:Add,Progress,x10 y12 w780 h65 cBlack BackgroundBlack
  255. Gui,2:Font,s36 cf2bb24, Republiko
  256. Gui,2:Add,Text,x55 y20 BackgroundTrans, ADVANCE AUTO-SHUTDOWN
  257. Gui,2:Font,s36 c666666
  258. Gui,2:Add,Text,x50 y20 BackgroundTrans, ADVANCE AUTO-SHUTDOWN
  259.  
  260.  
  261. Gui,2:Font,
  262. Gui,2:Font,s8 bold cLime
  263. Gui,2:Add,GroupBox,x10 y80 w220 h250, POINTS SETTINGS
  264. Gui,2:Font,
  265. Gui,2:Font,s10 bold
  266. Gui,2:Add,Edit,x20 y100 w50 -E0x200 Border Center Number limit3 r1 vEdit01, % ADDPOINTS
  267. Gui,2:Add,Edit,x20 y+10 w50 -E0x200 Border Center Number limit3 r1 vEdit02, % SECPERPOINTS
  268. Gui,2:Add,Edit,x20 y+10 w50 -E0x200 Border Center Number limit3 r1 vEdit03, % BONUSPOINTS
  269. Gui,2:Add,Edit,x20 y+10 w50 -E0x200 Border Center Number limit3 r1 vEdit04, % BONUSTIME
  270. Gui,2:Add,Edit,x20 y+10 w50 -E0x200 Border Center Number limit3 r1 vEdit05, % REQUSEPOINTS
  271.  
  272. Gui,2:Font,
  273. Gui,2:Font,s10 cwhite bold
  274. Gui,2:Add,Text,x+10 y105 Left, Default Points
  275. Gui,2:Add,Text, y+18 Left, MINUTES
  276. Gui,2:Add,Text, y+18 Left, BONUS POINTS
  277. Gui,2:Add,Text, y+18 Left, MINUTES
  278. Gui,2:Add,Text, y+18 Left, USE POINTS
  279. Switch1[3]:=New Switch_1( x:=180, y:=500, w:= 100, h:= 30, state:=REWARD, BG_Color:="333333", Switch_BG_Color:="333333", Switch_F_Color:="404040", Switch_Border:="ffffff", Switch_Border2:="ffffff", Text_Color3:="00FF00", Font_Size:=20, Text1:="SwitchON", Text2:="SwitchOFF", Text_Color1:="FF0000", Text_Color2:="00FF00", Window:="2", Label:="Switch3")
  280. HB_Button.Push( New HB_Plain_Rounded_Button_Type_1( x := 20 , y:=270,w := 180 , h := 50 , Button_Color := "6699ff" , Button_Background_Color := "333333" , Text := "SAVE" , Font := "Arial" , Font_Size := 16 , Font_Color_Top := "000000" , Font_Color_Bottom := "AAAAAA" , Window := "2" , Label := "SaveSet" ) )
  281. HB_Button.Push( New HB_Plain_Rounded_Button_Type_1( x := 655 , y:=380,w := 130 , h := 40 , Button_Color := "6699ff" , Button_Background_Color := "333333" , Text := "SAVE" , Font := "Arial" , Font_Size := 16 , Font_Color_Top := "000000" , Font_Color_Bottom := "AAAAAA" , Window := "2" , Label := "SaveInfo" ) )
  282. HB_Button.Push( New HB_Plain_Rounded_Button_Type_1( x := 655 , y+=45,w := 130 , h := 40 , Button_Color := "6699ff" , Button_Background_Color := "333333" , Text := "Delete Member" , Font := "Arial" , Font_Size := 12 , Font_Color_Top := "000000" , Font_Color_Bottom := "AAAAAA" , Window := "2" , Label := "DeleteMember" ) )
  283. HB_Button.Push( New HB_Plain_Rounded_Button_Type_1( x := 655 , y:=500,w := 130 , h := 40 , Button_Color := "6699ff" , Button_Background_Color := "333333" , Text := "ADD" , Font := "Arial" , Font_Size := 12 , Font_Color_Top := "000000" , Font_Color_Bottom := "AAAAAA" , Window := "2" , Label := "AddReward" ) )
  284. HB_Button.Push( New HB_Plain_Rounded_Button_Type_1( x := 655 , y+=42,w := 130 , h := 40 , Button_Color := "6699ff" , Button_Background_Color := "333333" , Text := "Delete" , Font := "Arial" , Font_Size := 12 , Font_Color_Top := "000000" , Font_Color_Bottom := "AAAAAA" , Window := "2" , Label := "DeleteReward" ) )
  285. HB_Button.Push( New HB_Plain_Rounded_Button_Type_1( x := 655 , y:=610,w := 130 , h := 40 , Button_Color := "6699ff" , Button_Background_Color := "333333" , Text := "SEND" , Font := "Arial" , Font_Size := 12 , Font_Color_Top := "000000" , Font_Color_Bottom := "AAAAAA" , Window := "2" , Label := "SendUser" ) )
  286. HB_Button.Push( New HB_Plain_Rounded_Button_Type_1( x := 655 , y+=45,w := 130 , h := 40 , Button_Color := "6699ff" , Button_Background_Color := "333333" , Text := "SEND" , Font := "Arial" , Font_Size := 12 , Font_Color_Top := "000000" , Font_Color_Bottom := "AAAAAA" , Window := "2" , Label := "SendAll" ) )
  287. HB_Button.Push( New HB_Plain_Rounded_Button_Type_1( x := 15 , y:=535 ,w := 110 , h := 40 , Button_Color := "BCC2CE" , Button_Background_Color := "333333" , Text := "Save USERS" , Font := "Arial" , Font_Size := 10 , Font_Color_Top := "000000" , Font_Color_Bottom := "AAAAAA" , Window := "2" , Label := "SaveAll" ) )
  288. HB_Button.Push( New HB_Plain_Rounded_Button_Type_1( x +=w+5 , y:=535 ,w := 110 , h := 40 , Button_Color := "BCC2CE" , Button_Background_Color := "333333" , Text := "Restore USERS" , Font := "Arial" , Font_Size := 10 , Font_Color_Top := "000000" , Font_Color_Bottom := "AAAAAA" , Window := "2" , Label := "Restore_USERS" ) )
  289.  
  290. Gui,2:Font,
  291. Gui,2:Font,s8 bold cLime
  292. Gui,2:Add,GroupBox,x10 y340 w780 h130,INFORMATION
  293. Gui,2:Font,
  294. Gui,2:Font,s18 bold cRed,Multicolore Pro
  295. Gui,2:Add,Text,x25 y360 Left w250 vName,
  296. Gui,2:Font,
  297. Gui,2:Font,s10 bold
  298. Gui,2:Add,Edit,x20 y400 w150 -E0x200 Border Center Number r1 vEdit06,
  299. Gui,2:Add,Edit,x+10 w150 -E0x200 Border Center Password r1 vEdit07,
  300. Gui,2:Font,s8 bold caqua
  301. Gui,2:Add,Progress,x+10 y400 w150 h22 c222222 Background888888
  302. Gui,2:Add,Progress,x+10 y400 w150 h22 c222222 Background888888
  303. Gui,2:Add,Text,x340 y405 Center w150 vRegdate BackgroundTrans,
  304. Gui,2:Add,Text,x+10 Center w150 vPCLogin BackgroundTrans,
  305. Gui,2:Font,s10 bold c888888
  306. Gui,2:Add,Text,x20 y430 Center w150 Border ,TOTAL POINTS
  307. Gui,2:Add,Text,x+10 y430 Center w150 Border, PASSWORD
  308.  
  309. Gui,2:Add,Text,x+10 y430 Center w150 Border,REGISTERED
  310. Gui,2:Add,Text,x+10 y430 Center w150 Border,PC LOGIN
  311.  
  312.  
  313. Gui,2:Font,
  314. Gui,2:Font,s10 bold c4d0000,
  315. Gui,2:Add,ListView,x260 y85 w520 h245 vList1 Grid AltSubmit -Multi NoSortHdr +ReadOnly +Border gList1,USERNAME|POINTS
  316. Gui,2:+OWndialogs
  317.  
  318. LV_ModifyCol(1,"Center")
  319. LV_ModifyCol(2,"Center")
  320. LV_ModifyCol(1,300)
  321. LV_ModifyCol(2,210)
  322.  
  323. Loop,%SERVERPATHFULL%\*.*,2
  324. {
  325. A++
  326. IniRead,TOTPO,%SERVERPATHFULL%\%A_LoopFileName%\data.ini:VAN:$data,Account,TotalPoints
  327. LV_Add("col1",A_LoopFileName)
  328. LV_Modify(A,"col2",TOTPO)
  329. }
  330. Gui,2:Font,s8 bold cLime
  331. Gui,2:Add,GroupBox,x10 y475 w780 h120,REWARDS SECTION
  332. Gui,2:Font,
  333. Gui,2:Font,s10 bold
  334. if(REWARD=1)
  335. Gui,2:Add,Edit,x500 y508 w150 Border Center Number r1 vEdit08,
  336. else
  337. Gui,2:Add,Edit,x500 y508 w150 Border Center Number r1 Disabled vEdit08,
  338. Loop
  339. {
  340. RewardCount++
  341. IniRead,RewardNum,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,Reward%RewardCount%
  342. if(RewardNum="" || RewardNum="ERROR"){
  343. RewardS++
  344. if(RewardS=50){
  345. RewardCount:=0
  346. Break
  347. }
  348. }
  349. else
  350. {
  351. FileAppend,Reward%RewardCount%|,%A_Temp%\Rnumb.dat:VAN:$data
  352. }
  353. }
  354. FileRead,RewardCC,%A_Temp%\Rnumb.dat:VAN:$data
  355. Gui,2:Font,s12
  356. if(REWARD=1)
  357. Gui,2:Add,Listbox,x500 y+15 w150 h40 Border Center r1 vList2 gList2,% RewardCC
  358. else
  359. Gui,2:Add,Listbox,x500 y+15 w150 h40 Border Center Disabled r1 vList2 gList2,% RewardCC
  360. Gui,2:Font,s8 c999999
  361. Gui,2:Add,Text,x500 y495 Center w150,Reward Points
  362. Gui,2:Font,
  363. Gui,2:Font,s12 c33ccff,fivo Sans Modern ExtBlk
  364. Gui,2:Add,Text,x20 y505 Left w160,REWARD SYSTEM
  365. Gui,2:Font,
  366. Gui,2:Font,s12 Bold
  367. Gui,2:Add,Edit,x250 y495 w230 Border r4 vEdit09,
  368.  
  369. Gui,2:Font,s8 Bold cwhite
  370. Gui,2:Add,Text,x20 y600 Center w150,Send Message to User :
  371. Gui,2:Add,Text,x20 y+35 Center w150,Send Message to All :
  372. Gui,2:Font,s12 Bold cred
  373. Gui,2:Add,Edit,x20 y615 w620 Border limit150 r1 vEdit10,
  374. Gui,2:Add,Edit,x20 y+20 w620 Border limit150 r1 vEdit11,
  375. Gui,2:Show,w800 h700,OTHER SETTINGS
  376. }else{
  377. Gui,AUTOSERVER:Hide
  378. Gui,2:Show
  379. }
  380. return
  381. Restore_USERS:
  382. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  383. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  384. return
  385. SoundBeep, 5000
  386. Gui,2:+OWndialogs
  387. Gui,2:Submit,Nohide
  388. pas1:=0
  389. IfExist,BKUP_USERS.txt
  390. {
  391. MsgBox, 262180, Warning, All Existing Accounts will be overwritten.`nDo you still wants to restore?
  392. IfMsgBox,Yes
  393. {
  394. Loop,read,BKUP_USERS.txt
  395. {
  396. Loop,parse,A_LoopReadLine,`n
  397. {
  398. if A_LoopField contains [,]
  399. {
  400. StringReplace,Bracket1,A_LoopField,[,,All
  401. StringReplace,Bracket2,Bracket1,],,All
  402. FileAppend,% A_LoopField
  403. Name1:=A_LoopField
  404. FileRemoveDir,%SERVERPATHFULL%\%Bracket2%,1
  405. Sleep,100
  406. FileCreateDir,%SERVERPATHFULL%\%Bracket2%
  407. }
  408. else
  409. {
  410. if(pas1=0)
  411. {
  412. IniWrite,%A_LoopField%,%SERVERPATHFULL%\%Bracket2%\data.ini:VAN:$data,Account,passuser
  413. pas1:=1
  414. }
  415. else
  416. {
  417. IniWrite,%A_LoopField%,%SERVERPATHFULL%\%Bracket2%\data.ini:VAN:$data,Account,TotalPoints
  418. IniWrite,0,%SERVERPATHFULL%\%Bracket2%\data.ini:VAN:$data,Account,Logpoints
  419. IniWrite,%TimeNow%,%SERVERPATHFULL%\%Bracket2%\data.ini:VAN:$data,Account,Regdate
  420. IniWrite,%TimeNow%,%SERVERPATHFULL%\%Bracket2%\data.ini:VAN:$data,Account,Lastlog
  421. pas1:=0
  422. }
  423. }
  424. }
  425. }
  426. MsgBox, 262208, Message, All Users are restored!`n`nThank You!!!
  427. }
  428. }
  429.  
  430. return
  431. SaveAll:
  432. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  433. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  434. return
  435. SoundBeep, 5000
  436. Gui,2:Submit,Nohide
  437. IfExist,BKUP_USERS.txt
  438. FileDelete,BKUP_USERS.txt
  439. Loop,%SERVERPATHFULL%\*.*,2
  440. {
  441. IniRead,BKP,%SERVERPATHFULL%\%A_LoopFileName%\data.ini:VAN:$data,Account,passuser
  442. IniRead,BKTP,%SERVERPATHFULL%\%A_LoopFileName%\data.ini:VAN:$data,Account,TotalPoints
  443. FileRead,samp,%SERVERPATHFULL%\%A_LoopFileName%\data.ini:VAN:$data
  444. FileAppend,[%A_LoopFileName%]`n%BKP%`n%BKTP%`n,BKUP_USERS.txt
  445. }
  446. MsgBox, 262208, Message, All Users are Saved!`n`nThank You!!!
  447. return
  448. SendUser:
  449. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  450. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  451. return
  452. SoundBeep, 5000
  453. Gui,2:Submit,Nohide
  454. if(Edit10="")
  455. return
  456. FileAppend,%Edit10%`n,%SERVERPATHFULL%\%TextR1%\Inbx.dat:VAN:$data
  457. GuiControl,2:,Edit10,
  458. return
  459. SendAll:
  460. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  461. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  462. return
  463. SoundBeep, 5000
  464. Gui,2:Submit,Nohide
  465. if(Edit11="")
  466. return
  467. Loop,%SERVERPATHFULL%\*.*,2
  468. {
  469. FileAppend,%Edit11%`n,%SERVERPATHFULL%\%A_LoopFileName%\Inbx.dat:VAN:$data
  470. }
  471. GuiControl,2:,Edit11,
  472. return
  473.  
  474.  
  475. List2:
  476. Gui,2:Submit,Nohide
  477. if(A_GuiEvent="DoubleClick"){
  478. EditL2:=True
  479. IniRead,LL2,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,% List2
  480. FileRead,LL3,%SERVERPATHFULL2%\%List2%.dat:VAN:$data
  481. GuiControl,2:,Edit08, % LL2
  482. GuiControl,2:,Edit09,% LL3
  483. }
  484. return
  485. DeleteReward:
  486. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  487. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  488. return
  489. SoundBeep, 5000
  490. Gui,2:Submit,Nohide
  491. if(List2="" || List2="ERROR")
  492. return
  493. IniDelete,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,%List2%
  494. StringReplace,Rewardtrim,RewardCC,%List2%|,,All
  495. GuiControl,2:,List2,% "|" Rewardtrim
  496. RewardCC:=Rewardtrim
  497. FileDelete,VANHEARTNET\PNG\Rewards\%List2%.png
  498. FileDelete,%SERVERPATHFULL2%\%List2%.dat
  499. return
  500. AddReward:
  501. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  502. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  503. return
  504. SoundBeep, 5000
  505. Gui,2:Submit,Nohide
  506. Gui,2:+OwnDialogs
  507. FileDelete,%A_Temp%\Rnumb.dat
  508. if(EditL2=True){
  509. IniWrite,% Edit08,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,% List2
  510. FileDelete,%SERVERPATHFULL2%\%List2%.dat
  511. Sleep 20
  512. FileAppend,% Edit09,%SERVERPATHFULL2%\%List2%.dat:VAN:$data
  513. GuiControl,2:,Edit08,
  514. GuiControl,2:,Edit09,
  515. EditL2:=False
  516. return
  517. }
  518. else
  519. {
  520. if(Edit08="")
  521. return
  522. if(Edit09=""){
  523. MsgBox, Please Iput RewardCODE
  524. return
  525. }
  526. Loop
  527. {
  528. Jo++
  529. IniRead,RewardNum,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,Reward%Jo%
  530. if(RewardNum="" || RewardNum="ERROR"){
  531. IniWrite,% Edit08,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,Reward%Jo%
  532. FileAppend,% Edit09,%SERVERPATHFULL2%\Reward%Jo%.dat:VAN:$data
  533. FileSelectFile,RewardPNG,,,SELECT REWARD TEMPLATE,All Files 200x150 (*.*)
  534. if(Errorlevel=0)
  535. FileCopy,% RewardPNG,VANHEARTNET\PNG\Rewards\Reward%Jo%.png
  536. else
  537. FileCopy,VANHEARTNET\PNG\Rewards\RewardDefault.png,VANHEARTNET\PNG\Rewards\Reward%Jo%.png
  538.  
  539. Jo:=0
  540. Break
  541. }
  542. }
  543. GuiControl,2:,Edit08,
  544. GuiControl,2:,Edit09,
  545. RewardCount:=0
  546. RewardS:=0
  547. Loop
  548. {
  549. RewardCount++
  550. IniRead,RewardNum,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,Reward%RewardCount%
  551. if(RewardNum="" || RewardNum="ERROR"){
  552. RewardS++
  553. if(RewardS=50){
  554. RewardCount:=0
  555. Break
  556. }
  557. }else
  558. FileAppend,Reward%RewardCount%|,%A_Temp%\Rnumb.dat:VAN:$data
  559. }
  560. FileRead,RewardCC,%A_Temp%\Rnumb.dat:VAN:$data
  561. GuiControl,2:,List2,% "|" RewardCC
  562. FileDelete,%A_Temp%\Rnumb.dat
  563. }
  564. return
  565.  
  566.  
  567. DeleteMember:
  568. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  569. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  570. return
  571. SoundBeep, 5000
  572. Gui,2:Submit,Nohide
  573. if(TextR1="" || TextR1="ERROR")
  574. return
  575. MsgBox, 262180, Message, Member : %TextR1% `n`nDo you really want to remove this member from the List?, 20
  576. IfMsgBox,Yes
  577. {
  578. FileRemoveDir,%SERVERPATHFULL%\%TextR1%,1
  579. if(Errorlevel=1)
  580. return
  581. LV_Delete(GU)
  582. MsgBox, 262208, Message, Delete Member`, Complete!, 10
  583. GuiControl,2:,Edit06,
  584. GuiControl,2:,Edit07,
  585. GuiControl,2:,Regdate,
  586. GuiControl,2:,PCLogin,
  587.  
  588.  
  589. }
  590. return
  591. SaveInfo:
  592. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  593. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  594. return
  595. SoundBeep, 5000
  596. Gui,2:Submit,Nohide
  597. IniWrite,% Edit06,%SERVERPATHFULL%\%TextR1%\data.ini:VAN:$data,Account,TotalPoints
  598. IniWrite,% Edit07,%SERVERPATHFULL%\%TextR1%\data.ini:VAN:$data,Account,passuser
  599. LV_Modify(GU,"Col2",Edit06)
  600. return
  601. List1:
  602. Gui,2:Submit,Nohide
  603. if (A_GuiEvent="DoubleClick")
  604. {
  605. GET := LV_GetText(EVE,A_EventInfo)
  606. GU := A_EventInfo
  607. LV_GetText(TextR1,GU,1)
  608. LV_GetText(TextR2,GU,2)
  609. GuiControl,2:,Name,% TextR1
  610. GuiControl,2:,Edit06,% TextR2
  611. IniRead,Pass1,%SERVERPATHFULL%\%TextR1%\data.ini:VAN:$data,Account,passuser
  612. IniRead,Regdate,%SERVERPATHFULL%\%TextR1%\data.ini:VAN:$data,Account,Regdate
  613. IniRead,PCLOGIN,%SERVERPATHFULL%\%TextR1%\data.ini:VAN:$data,Account,PCLOGIN
  614. GuiControl,2:,Edit07,% Pass1
  615. GuiControl,2:,Regdate,% Regdate
  616. if(PCLOGIN="" || PCLOGIN="ERROR")
  617. PCLOGIN=NONE
  618. GuiControl,2:,PCLogin,% PCLOGIN
  619. }
  620.  
  621. return
  622. SaveSet:
  623. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  624. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  625. return
  626. SoundBeep, 5000
  627. Gui,2:Submit,Nohide
  628. IniWrite,% Edit01,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,ADDPOINTS
  629. IniWrite,% Edit02,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,SECPERPOINTS
  630. IniWrite,% Edit03,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,BONUSPOINTS
  631. IniWrite,% Edit04,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,BONUSTIME
  632. IniWrite,% Edit05,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,REQUSEPOINTS
  633. return
  634. Create:
  635. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  636. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  637. return
  638. Gui,AUTOSERVER:Submit,Nohide
  639. SoundBeep, 5000
  640. if Edit6 contains %A_Space%,?,/,^,@,-,_,+,=,;,.,*,#,!,~,<,>,`,,`%,&,$,`(,`),`{,`},`[,`],|,:,`",``
  641. {
  642. MsgBox, 262160, Error, Illegal characters
  643. return
  644. }
  645. else if Edit8 contains %A_Space%,?,/,^,@,-,_,+,=,;,.,*,#,!,~,<,>,`,,`%,&,$,`(,`),`{,`},`[,`],|,:,`",``
  646. {
  647. MsgBox, 262160, Error, Illegal characters
  648. return
  649. }
  650. else if (Edit6="" || Edit8="")
  651. {
  652. MsgBox, 262160, Error, You must Input Character
  653. return
  654. }
  655. loop,%SERVERPATHFULL%\*.*,2
  656. {
  657. if(A_LoopFilename=Edit6){
  658. MsgBox, 262160, Error, Username is already taken. Please choose another Name., 10
  659. GuiControl,AUTOSERVER:,Edit6,
  660. GuiControl,AUTOSERVER:,Edit8,
  661. return
  662. }
  663. }
  664. FileCreateDir,%SERVERPATHFULL%\%Edit6%
  665. if(Errorlevel=1)
  666. return
  667. IniWrite,%Edit8%,%SERVERPATHFULL%\%Edit6%\data.ini:VAN:$data,Account,passuser
  668. IniWrite,0,%SERVERPATHFULL%\%Edit6%\data.ini:VAN:$data,Account,TotalPoints
  669. IniWrite,0,%SERVERPATHFULL%\%Edit6%\data.ini:VAN:$data,Account,Logpoints
  670. IniWrite,%TimeNow%,%SERVERPATHFULL%\%Edit6%\data.ini:VAN:$data,Account,Regdate
  671. IniWrite,%TimeNow%,%SERVERPATHFULL%\%Edit6%\data.ini:VAN:$data,Account,Lastlog
  672. MsgBox, 262208, Success, Account created., 5
  673. GuiControl,AUTOSERVER:,Edit6,
  674. GuiControl,AUTOSERVER:,Edit8,
  675. IfWinExist,OTHER SETTINGS
  676. {
  677. Gui,2:Default
  678. LV_Add("",Edit6,"0")
  679. }
  680. return
  681. Advance1:
  682. Gui,AUTOSERVER:Show
  683. return
  684. AddPC:
  685. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  686. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  687. return
  688. SoundBeep, 5000
  689. Gui,AUTOSERVER:Submit,Nohide
  690. if (Radio1=1)
  691. return
  692. if Edit5 contains %A_Space%,?,/,^,@,-,_,+,=,;,.,*,#,!,~,<,>,`,,`%,&,$,`(,`),`{,`},`[,`],|,:,`",``
  693. {
  694. MsgBox, 262160, Error, Illegal characters
  695. return
  696. }
  697. if(Edit5="")
  698. {
  699. MsgBox, 262160, Error, Please Input PC name.
  700. GuiControl,AUTOSERVER:Focus,Edit5
  701. GuiControl,AUTOSERVER:,Edit5,Add PC name Here!
  702. ToolTip,Input PC Name Here,60,280
  703. Sleep,5000
  704. ToolTip,
  705. return
  706. }
  707. FileCreateDir,VANHEARTNET\PNG\USERS\%Edit5%
  708. if(Errorlevel=0)
  709. MsgBox, 262208, Success, PC name created!, 5
  710. gosub, Radio2
  711. GuiControl,AUTOSERVER:,Edit5,
  712. return
  713. DeletePC:
  714. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  715. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  716. return
  717. SoundBeep, 5000
  718. Gui,AUTOSERVER:Submit,Nohide
  719. if (Radio1=1)
  720. return
  721. MsgBox, 262180, Warning, Do you really want to remove PC name on the List?, 10
  722. IfMsgBox,Yes
  723. {
  724. If(Radio2=1)
  725. {
  726. FileRemoveDir,VANHEARTNET\PNG\USERS\%DDL1%,1
  727. if(Errorlevel=0)
  728. MsgBox, 262208, Success, PC name Deleted!, 5
  729. gosub, Radio2
  730. }
  731. }
  732. return
  733. DeleteWallpaper:
  734. Gui,AUTOSERVER:Submit,Nohide
  735. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  736. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  737. return
  738. SoundBeep, 5000
  739. if(Radio1=1){
  740. FileDelete,VANHEARTNET\PNG\%DDL1%
  741. gosub, US
  742. Gui,AUTOSERVER:Submit,Nohide
  743. GuiControl,AUTOSERVER:move,Wallpic,w290 h250
  744. GuiControl,AUTOSERVER:,Wallpic,VANHEARTNET\PNG\%DDL1%
  745. }
  746. else{
  747. FileDelete,VANHEARTNET\PNG\USERS\%DDL1%\%DDL2%
  748. gosub, US
  749. Gui,AUTOSERVER:Submit,Nohide
  750. GuiControl,AUTOSERVER:move,Wallpic,w290 h250
  751. GuiControl,AUTOSERVER:,Wallpic,VANHEARTNET\PNG\USERS\%DDL1%\%DDL2%
  752. }
  753. return
  754. DDL1:
  755. Gui,AUTOSERVER:Submit,Nohide
  756. if(Radio1=1)
  757. {
  758.  
  759. Gui,AUTOSERVER:Submit,Nohide
  760. GuiControl,AUTOSERVER:move,Wallpic,w290 h250
  761. GuiControl,AUTOSERVER:,Wallpic,VANHEARTNET\PNG\%DDL1%
  762. }
  763. else
  764. {
  765. gosub, US
  766. Gui,AUTOSERVER:Submit,Nohide
  767. GuiControl,AUTOSERVER:move,Wallpic,w290 h250
  768. GuiControl,AUTOSERVER:,Wallpic,VANHEARTNET\PNG\USERS\%DDL1%\%DDL2%
  769.  
  770. }
  771.  
  772. return
  773. DDL2:
  774. Gui,AUTOSERVER:Submit,Nohide
  775. GuiControl,AUTOSERVER:move,Wallpic,w290 h250
  776. GuiControl,AUTOSERVER:,Wallpic,VANHEARTNET\PNG\USERS\%DDL1%\%DDL2%
  777. return
  778. US:
  779. Gui,AUTOSERVER:Submit,Nohide
  780. FileDelete,%A_Temp%\data.file
  781. if(Radio1=1){
  782. NumL1:=0
  783. Loop,VANHEARTNET\PNG\*.png,1
  784. {
  785. NumL1++
  786. USRNME1:=A_LoopFileName
  787. if (NumL1=1)
  788. FileAppend,% USRNME1 "|",%A_Temp%\data.file
  789. else
  790. FileAppend,% "|" USRNME1,%A_Temp%\data.file
  791. }
  792. FileRead,WL2,%A_Temp%\data.file
  793. Gui,AUTOSERVER:Submit,Nohide
  794. GuiControl,AUTOSERVER:,DDL1,|%WL2%
  795. }Else{
  796. NumL1:=0
  797. Loop,VANHEARTNET\PNG\USERS\%DDL1%\*.png,1
  798. {
  799. NumL1++
  800. USRNME1:=A_LoopFileName
  801. if (NumL1=1)
  802. FileAppend,% USRNME1 "|",%A_Temp%\data.file
  803. else
  804. FileAppend,% "|" USRNME1,%A_Temp%\data.file
  805. }
  806. FileRead,WL2,%A_Temp%\data.file
  807. Gui,AUTOSERVER:Submit,Nohide
  808. GuiControl,AUTOSERVER:,DDL2,|%WL2%
  809. }
  810.  
  811. return
  812.  
  813. Add1:
  814. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  815. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  816. return
  817. SoundBeep, 5000
  818. gui,AUTOSERVER:submit,nohide
  819. gui,AUTOSERVER:+OwnDialogs
  820. If(Radio1=1)
  821. {
  822. NN:=0
  823. FileSelectFile,Main,,,SELECT WALLPAPER,All Files (*.*)
  824. if(Errorlevel=0)
  825. {
  826. Loop
  827. {
  828. NN++
  829. IfExist,VANHEARTNET\PNG\Wallpaper%NN%.png
  830. continue
  831. else{
  832. FileCopy,% Main,VANHEARTNET\PNG\Wallpaper%NN%.png
  833. Break
  834. }
  835. }
  836. }
  837. gosub, US
  838. gui,AUTOSERVER:submit,nohide
  839. GuiControl,AUTOSERVER:,DDL1,|%WL2%
  840.  
  841.  
  842. }
  843. else
  844. {
  845. NN:=0
  846. FileSelectFile,Main,,,SELECT WALLPAPER,All Files (*.*)
  847. if(Errorlevel=0)
  848. {
  849. Loop
  850. {
  851. NN++
  852. IfExist,VANHEARTNET\PNG\USERS\%DDL1%\Wallpaper%NN%.png
  853. continue
  854. else{
  855. FileCopy,% Main,VANHEARTNET\PNG\USERS\%DDL1%\Wallpaper%NN%.png
  856. Break
  857. }
  858. }
  859. }
  860. gosub, US
  861. }
  862. return
  863. Radio1:
  864. GuiControl,AUTOSERVER:Disable,DDL2
  865. gosub, US
  866. GuiControl,AUTOSERVER:Hide,Edit5
  867. GuiControl,AUTOSERVER:,Edit5,
  868. return
  869. Radio2:
  870. gui,AUTOSERVER:submit,nohide
  871. GuiControl,AUTOSERVER:Show,Edit5
  872. GuiControl,AUTOSERVER:Enable,DDL2
  873. FileDelete,%A_Temp%\data.file
  874. NumL1:=0
  875. Loop,VANHEARTNET\PNG\USERS\*.*,2
  876. {
  877. NumL1++
  878. USRNME1:=A_LoopFileName
  879. if (NumL1=1)
  880. FileAppend,% USRNME1 "|",%A_Temp%\data.file
  881. else
  882. FileAppend,% "|" USRNME1,%A_Temp%\data.file
  883. }
  884. FileRead,WL2,%A_Temp%\data.file
  885. gui,AUTOSERVER:submit,nohide
  886. GuiControl,AUTOSERVER:,DDL1,|%WL2%
  887. gosub, US
  888.  
  889. return
  890. Save:
  891. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  892. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  893. return
  894. SoundBeep, 5000
  895. Gui,Submit,Nohide
  896. IniWrite,\\%Edit1%\Users\%Edit2%\Documents\AdvanceAutoshutdown\Auto\%Edit3%,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,SERVERPATHFULL
  897. IniWrite,% Edit3,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,SERVERPATH
  898. return
  899. ChangeBPath:
  900. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  901. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  902. return
  903. SoundBeep, 5000
  904. Gui,AUTOSERVER:+Owndialogs
  905. FileSelectFolder,BACKUPFOLDER,,,SELECT BACKUP FOLDER
  906. if(errorlevel=0)
  907. {
  908. IniWrite,% BACKUPFOLDER,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,AUTOBACKUPPATH
  909. GuiControl,AUTOSERVER:,Edit7,% BACKUPFOLDER
  910. }
  911. return
  912.  
  913.  
  914. Switch1:
  915. if(Switch1[1].state=0){
  916. IniWrite,1,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,POINTSYSTEM
  917. Switch1[1].state:=1
  918. Switch1[1].Draw_Bitmap_ON()
  919. }else{
  920. Switch1[1].Draw_Bitmap_OFF()
  921. IniWrite,0,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,POINTSYSTEM
  922. Switch1[1].state:=0
  923. }
  924. return
  925. Switch2:
  926. if(Switch1[2].state=0){
  927. IniWrite,1,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,AUTOBACKUP
  928. Switch1[2].state:=1
  929. Switch1[2].Draw_Bitmap_ON()
  930. SetTimer, AutoBackupFiles, 5000
  931. }else{
  932. Switch1[2].Draw_Bitmap_OFF()
  933. IniWrite,0,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,AUTOBACKUP
  934. Switch1[2].state:=0
  935. SetTimer, AutoBackupFiles, Off
  936. }
  937. return
  938. Switch3:
  939. if(Switch1[3].state=0){
  940. IniWrite,1,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,REWARD
  941. Switch1[3].state:=1
  942. GuiControl,2:enable,Edit08
  943. GuiControl,2:enable,Edit09
  944. GuiControl,2:Enable,List2
  945. Switch1[3].Draw_Bitmap_ON()
  946. }else{
  947. Switch1[3].Draw_Bitmap_OFF()
  948. IniWrite,0,VANHEARTNET\Config.ini:VAN:$data,SETTINGS,REWARD
  949. Switch1[3].state:=0
  950. GuiControl,2:Disable,Edit08
  951. GuiControl,2:Disable,Edit09
  952. GuiControl,2:Disable,List2
  953. }
  954. return
  955.  
  956. AUTOSERVERGuiContextmenu:
  957. Gui,AUTOSERVER:hide
  958. return
  959. 2GuiContextmenu:
  960. Reload
  961. return
  962.  
  963. ;~ Esc::
  964. AUTOSERVERGuiClose:
  965. Gdip_Shutdown(pToken)
  966. FileDelete,%A_Temp%\Rnumb.dat
  967. ExitApp
  968.  
  969. 2GuiClose:
  970. Gui,AUTOSERVER:Show
  971. Gui,2:hide
  972. return
  973.  
  974. <!<^i::
  975. IfWinActive,OTHER SETTINGS
  976. {
  977. MsgBox, 262208,User's Information, User Name : %TextR1% `nPassword : %Pass1% `nDate Registered : %Regdate% `nTotal Points : %TextR2%
  978. }
  979. return
  980.  
  981.  
  982.  
  983. AutoBackupFiles:
  984. Loop,%SERVERPATHFULL3%\*.*,2
  985. {
  986. FileCopyDir,%SERVERPATHFULL3%\%A_LoopFileName%,%AUTOBACKUPPATH%\%A_LoopFileName%,1
  987. }
  988. return
  989.  
  990.  
  991.  
  992.  
  993. Move:
  994. PostMessage,0xA1,2
  995. While(GetKeystate("LButton")) {
  996. sleep 10
  997. WinGetPos,X,Y,,,A
  998. WinMove,,,%X%,%Y%,
  999. Gui,AUTOSERVER:Show,x%X% y%Y%,
  1000. }
  1001. return
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010.  
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051. Class Switch_1{
  1052. __New( x:=10, y:=10, w:= 100, h:= 30, state:=0, BG_Color:="222222", Switch_BG_Color:="333333", Switch_F_Color:="404040", Switch_Border:="ffffff", Switch_Border2:="ffffff", Text_Color3:="00FF00", Font_Size:=20, Text1:="SwitchON", Text2:="SwitchOFF", Text_Color1:="FF0000", Text_Color2:="00FF00", Window:="1", Label:="SwitchC"){
  1053. This.X:=x
  1054. This.Y:=y
  1055. This.W:=w
  1056. This.H:=h
  1057. This.Window:=Window
  1058. This.State:=state
  1059. This.Font_Size := Font_Size
  1060. This.Text_Color3:= "0xFF" Text_Color3
  1061. This.BG_Color:= "0xFF" BG_Color
  1062. This.Switch_BG_Color:= "0xFF" Switch_BG_Color
  1063. This.Switch_F_Color:= "0xFF" Switch_F_Color
  1064. This.Switch_Border:="0xFF" Switch_Border
  1065. This.Switch_Border2:="0xFF" Switch_Border2
  1066. This.Text1:=Text1
  1067. This.Text2:=Text2
  1068. This.Text_Color1:= "0xFF" Text_Color1
  1069. This.Text_Color2:= "0xFF" Text_Color2
  1070. This.Label:=Label
  1071. This.Create_Switch_OFF()
  1072. This.Create_Switch_ON()
  1073. This.Create_Switch_DISABLED()
  1074. This.Adding_Control()
  1075. sleep 20
  1076. (This.State=0)?(This.Draw_Bitmap_OFF()):(This.State=1)?(This.Draw_Bitmap_ON()):(This.Draw_Bitmap_DISABLED())
  1077. }
  1078. Adding_Control(){
  1079. local
  1080. num := Switch1.Length()+1
  1081. Gui , % This.Window " : Add" , Picture , % "x" This.X " y" This.Y " w" This.W " h" This.H " hwndHwnd v" Num " g" This.Label " 0xE"
  1082. This.Number := Num , This.Hwnd := Hwnd
  1083. }
  1084. Create_Switch_OFF(){
  1085. ;Bitmap Created Using: HB Bitmap Maker
  1086. pBitmap:=Gdip_CreateBitmap( 50 , 20 )
  1087. G := Gdip_GraphicsFromImage( pBitmap )
  1088. Gdip_SetSmoothingMode( G , 2 )
  1089. Brush := Gdip_BrushCreateSolid( This.BG_Color )
  1090. Gdip_FillRectangle( G , Brush , -1 , -1 , 52 , 22 )
  1091. Gdip_DeleteBrush( Brush )
  1092. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  1093. Gdip_FillRoundedRectangle( G , Brush , 1 , 1 , 48 , 18 , 5 )
  1094. Gdip_DeleteBrush( Brush )
  1095. Pen := Gdip_CreatePen( "0xFFFF0000" , 1 )
  1096. Gdip_DrawRoundedRectangle( G , Pen , 1 , 1 , 48 , 18 , 5 )
  1097. Gdip_DeletePen( Pen )
  1098. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFFFF0000" , "0xFF00FF00" , 1 , 1 )
  1099. Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , 20 , 16 , 5 )
  1100. Gdip_DeleteBrush( Brush )
  1101. Pen := Gdip_CreatePen( "0xFFFFFFFF" , 2 )
  1102. Gdip_DrawRoundedRectangle( G , Pen , 2 , 2 , 20 , 16 , 3 )
  1103. Gdip_DeletePen( Pen )
  1104. Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
  1105. Gdip_TextToGraphics( G , "OFF" , "s10 Center vCenter Bold c" Brush " x11 y-4" , "Segoe UI" , 50 , 30 )
  1106. Gdip_DeleteBrush( Brush )
  1107. Gdip_DeleteGraphics( G )
  1108. This.Draw_OFF_Bitmap:= Gdip_CreateHBITMAPFromBitmap(pBitmap)
  1109. Gdip_DisposeImage(pBitmap)
  1110. }
  1111. Create_Switch_ON(){
  1112. ;Bitmap Created Using: HB Bitmap Maker
  1113. pBitmap:=Gdip_CreateBitmap( 50 , 20 )
  1114. G := Gdip_GraphicsFromImage( pBitmap )
  1115. Gdip_SetSmoothingMode( G , 2 )
  1116. Brush := Gdip_BrushCreateSolid( This.BG_Color )
  1117. Gdip_FillRectangle( G , Brush , -1 , -1 , 52 , 22 )
  1118. Gdip_DeleteBrush( Brush )
  1119. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  1120. Gdip_FillRoundedRectangle( G , Brush , 1 , 1 , 48 , 18 , 5 )
  1121. Gdip_DeleteBrush( Brush )
  1122. Pen := Gdip_CreatePen( "0xFF00FF00" , 1 )
  1123. Gdip_DrawRoundedRectangle( G , Pen , 1 , 1 , 48 , 18 , 5 )
  1124. Gdip_DeletePen( Pen )
  1125. Brush := Gdip_BrushCreateSolid( "0xFF00FF00" )
  1126. Gdip_FillRoundedRectangle( G , Brush , 28 , 2 , 20 , 16 , 5 )
  1127. Gdip_DeleteBrush( Brush )
  1128. Pen := Gdip_CreatePen( "0xFFFFFFFF" , 2 )
  1129. Gdip_DrawRoundedRectangle( G , Pen , 28 , 2 , 20 , 16 , 3 )
  1130. Gdip_DeletePen( Pen )
  1131. Brush := Gdip_BrushCreateSolid( "0xFF00FF00" )
  1132. Gdip_TextToGraphics( G , "ON" , "s10 Center vCenter Bold c" Brush " x-9 y-4" , "Segoe UI" , 50 , 30 )
  1133. Gdip_DeleteBrush( Brush )
  1134. Gdip_DeleteGraphics( G )
  1135. This.Draw_ON_Bitmap:= Gdip_CreateHBITMAPFromBitmap(pBitmap)
  1136. Gdip_DisposeImage(pBitmap)
  1137. }
  1138. Create_Switch_DISABLED(){
  1139. ;Bitmap Created Using: HB Bitmap Maker
  1140. pBitmap:=Gdip_CreateBitmap( 50 , 20 )
  1141. G := Gdip_GraphicsFromImage( pBitmap )
  1142. Gdip_SetSmoothingMode( G , 2 )
  1143. Brush := Gdip_BrushCreateSolid( This.BG_Color )
  1144. Gdip_FillRectangle( G , Brush , -1 , -1 , 52 , 22 )
  1145. Gdip_DeleteBrush( Brush )
  1146. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  1147. Gdip_FillRoundedRectangle( G , Brush , 1 , 1 , 48 , 18 , 5 )
  1148. Gdip_DeleteBrush( Brush )
  1149. Pen := Gdip_CreatePen( "0xFF888888" , 1 )
  1150. Gdip_DrawRoundedRectangle( G , Pen , 1 , 1 , 48 , 18 , 5 )
  1151. Gdip_DeletePen( Pen )
  1152. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  1153. Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , 20 , 16 , 5 )
  1154. Gdip_DeleteBrush( Brush )
  1155. Pen := Gdip_CreatePen( "0xFF888888" , 2 )
  1156. Gdip_DrawRoundedRectangle( G , Pen , 2 , 2 , 20 , 16 , 3 )
  1157. Gdip_DeletePen( Pen )
  1158. Brush := Gdip_BrushCreateSolid( "0xFF888888" )
  1159. Gdip_TextToGraphics( G , "OFF" , "s10 Center vCenter Bold c" Brush " x11 y-4" , "Segoe UI" , 50 , 30 )
  1160. Gdip_DeleteBrush( Brush )
  1161. Gdip_DeleteGraphics( G )
  1162. This.Draw_DISABLED_Bitmap:= Gdip_CreateHBITMAPFromBitmap(pBitmap)
  1163. Gdip_DisposeImage(pBitmap)
  1164. }
  1165. Draw_Bitmap_ON(){
  1166. SetImage( This.Hwnd , This.Draw_ON_Bitmap )
  1167. }
  1168. Draw_Bitmap_OFF(){
  1169. SetImage( This.Hwnd , This.Draw_OFF_Bitmap )
  1170. }
  1171. Draw_Bitmap_DISABLED(){
  1172. SetImage( This.Hwnd , This.Draw_DISABLED_Bitmap )
  1173. }
  1174. }
  1175.  
  1176. class HB_Plain_Rounded_Button_Type_1 {
  1177. __New( x := 10 , y := 10 , w := 150 , h := 40 , Button_Color := "FF0000" , Button_Background_Color := "222222" , Text := "Button" , Font := "Arial" , Font_Size := 16 , Font_Color_Top := "000000" , Font_Color_Bottom := "FFFFFF" , Window := "1" , Label := "" ){
  1178. This.Text_Color_Top := "0xFF" Font_Color_Top , This.Text_Color_Bottom := "0xFF" Font_Color_Bottom , This.Font := Font , This.Font_Size := Font_Size , This.Text := Text
  1179. This.X := x , This.Y := y , This.W := w , This.H := h , This.Button_Background_Color := "0xFF" Button_Background_Color , This.Button_Color := "0xFF" Button_Color , This.Window := Window
  1180. This.Label := Label , This.Create_Default_Bitmap() , This.Create_Hover_Bitmap() , This.Create_Pressed_Bitmap() , This.Create_Trigger()
  1181. sleep, 20
  1182. This.Draw_Default()
  1183. }
  1184. Create_Trigger(){
  1185. global
  1186. num := HB_Button.Length() + 1
  1187. Gui , % This.Window ": Add" , Picture , % "x" This.X " y" This.Y " w" This.W " h" This.H " hwndHwnd_" Num " v" Num " g" This.Label " 0xE"
  1188. This.Number := Num , This.Hwnd := Hwnd_%num%
  1189. }
  1190. Create_Default_Bitmap(){
  1191. pBitmap:=Gdip_CreateBitmap( This.W, This.H )
  1192. G := Gdip_GraphicsFromImage( pBitmap )
  1193. Gdip_SetSmoothingMode( G , 2 )
  1194. Brush := Gdip_BrushCreateSolid( This.Button_Background_Color )
  1195. Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+2 , This.H+2 )
  1196. Gdip_DeleteBrush( Brush )
  1197. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  1198. Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , This.W-4 , This.H-3 , 16 )
  1199. Gdip_DeleteBrush( Brush )
  1200. Brush := Gdip_CreateLineBrushFromRect( 2 , -1 , This.W-4 , This.H-3 , "0xFF555555" , "0xFF000000" , 1 , 1 )
  1201. Gdip_FillRoundedRectangle( G , Brush , 2 , 0 , This.W-4 , This.H-3 , 16 )
  1202. Gdip_DeleteBrush( Brush )
  1203. if(This.Button_Color="0xFF000000"||This.Button_Color="0xFF111111")
  1204. Brush := Gdip_CreateLineBrushFromRect( 4 , -1 , This.W-6 , This.H+5 , "0xFF333333" , This.Button_Color , 1 , 1 )
  1205. else
  1206. Brush := Gdip_CreateLineBrushFromRect( 4 , -1 , This.W-6 , This.H+5 , This.Button_Color , "0xFF333333" , 1 , 1 )
  1207. Gdip_FillRoundedRectangle( G , Brush , 3 , 1 , This.W-6 , This.H-5 , 16 )
  1208. Gdip_DeleteBrush( Brush )
  1209. Brush := Gdip_BrushCreateSolid( "0x22F0F0F0" )
  1210. Gdip_FillEllipse( G , Brush , This.W/15 , This.H/13 , This.W-(This.W/15*2) , This.H*0.45 )
  1211. Gdip_DeleteBrush( Brush )
  1212. Brush := Gdip_BrushCreateSolid( This.Text_Color_Bottom )
  1213. Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter Bold c" Brush " x-1 y-1" , This.Font , This.W , This.H )
  1214. Gdip_DeleteBrush( Brush )
  1215. Brush := Gdip_BrushCreateSolid( This.Text_Color_Top )
  1216. Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter Bold c" Brush " x0 y0" , This.Font , This.W , This.H )
  1217. Gdip_DeleteBrush( Brush )
  1218. Gdip_DeleteGraphics( G )
  1219. This.Default_Bitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  1220. Gdip_DisposeImage(pBitmap)
  1221. }
  1222. Create_Hover_Bitmap(){
  1223. pBitmap:=Gdip_CreateBitmap( This.W , This.H )
  1224. G := Gdip_GraphicsFromImage( pBitmap )
  1225. Gdip_SetSmoothingMode( G , 2 )
  1226. Brush := Gdip_BrushCreateSolid( This.Button_Background_Color )
  1227. Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+2 , This.H+2 )
  1228. Gdip_DeleteBrush( Brush )
  1229. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  1230. Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , This.W-4 , This.H-3 , 16 )
  1231. Gdip_DeleteBrush( Brush )
  1232. Brush := Gdip_CreateLineBrushFromRect( 2 , -1 , This.W-4 , This.H-3 , "0xFF555555" , "0xFF000000" , 1 , 1 )
  1233. Gdip_FillRoundedRectangle( G , Brush , 2 , 0 , This.W-4 , This.H-3 , 16 )
  1234. Gdip_DeleteBrush( Brush )
  1235. if(This.Button_Color="0xFF000000"||This.Button_Color="0xFF111111")
  1236. Brush := Gdip_CreateLineBrushFromRect( 4 , -1 , This.W-6 , This.H+10 , "0xFF444444" , This.Button_Color , 1 , 1 )
  1237. else
  1238. Brush := Gdip_CreateLineBrushFromRect( 4 , -1 , This.W-6 , This.H+10 , This.Button_Color , "0xFF444444" , 1 , 1 )
  1239. Gdip_FillRoundedRectangle( G , Brush , 3 , 1 , This.W-6 , This.H-5 , 16 )
  1240. Gdip_DeleteBrush( Brush )
  1241. Brush := Gdip_BrushCreateSolid( "0x22F0F0F0" )
  1242. Gdip_FillEllipse( G , Brush , This.W/15 , This.H/13 , This.W-(This.W/15*2) , This.H*0.45 )
  1243. Gdip_DeleteBrush( Brush )
  1244. Brush := Gdip_BrushCreateSolid( This.Text_Color_Bottom )
  1245. Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter Bold c" Brush " x-1 y-1" , This.Font , This.W , This.H )
  1246. Gdip_DeleteBrush( Brush )
  1247. Brush := Gdip_BrushCreateSolid( This.Text_Color_Top )
  1248. Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter Bold c" Brush " x0 y0" , This.Font , This.W , This.H )
  1249. Gdip_DeleteBrush( Brush )
  1250. Gdip_DeleteGraphics( G )
  1251. This.Hover_Bitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  1252. Gdip_DisposeImage(pBitmap)
  1253. }
  1254. Create_Pressed_Bitmap(){
  1255. pBitmap:=Gdip_CreateBitmap( This.W , This.H )
  1256. G := Gdip_GraphicsFromImage( pBitmap )
  1257. Gdip_SetSmoothingMode( G , 2 )
  1258. Brush := Gdip_BrushCreateSolid( This.Button_Background_Color )
  1259. Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+2 , This.H+2 )
  1260. Gdip_DeleteBrush( Brush )
  1261. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  1262. Gdip_DeleteBrush( Brush )
  1263. Brush := Gdip_CreateLineBrushFromRect( 2 , 0 , This.W-4 , This.H-3 , "0xFF555555" , "0xFF000000" , 1 , 1 )
  1264. Gdip_FillRoundedRectangle( G , Brush , 2 , 0 , This.W-4 , This.H-3 , 16 )
  1265. Gdip_DeleteBrush( Brush )
  1266. Brush := Gdip_CreateLineBrushFromRect( 4 , -1 , This.W-6 , This.H+5 , "0xFF333333" , This.Button_Color , 1 , 1 )
  1267. Gdip_FillRoundedRectangle( G , Brush , 3 , 1 , This.W-6 , This.H-5 , 16 )
  1268. Gdip_DeleteBrush( Brush )
  1269. Brush := Gdip_BrushCreateSolid( This.Text_Color_Bottom )
  1270. Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter Bold c" Brush " x-1 y-2" , This.Font , This.W , This.H )
  1271. Gdip_DeleteBrush( Brush )
  1272. Brush := Gdip_BrushCreateSolid( This.Text_Color_Top )
  1273. Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter Bold c" Brush " x0 y-1" , This.Font , This.W , This.H )
  1274. Gdip_DeleteBrush( Brush )
  1275. Gdip_DeleteGraphics( G )
  1276. This.Pressed_Bitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
  1277. Gdip_DisposeImage( pBitmap )
  1278. }
  1279. Draw_Default(){
  1280. SetImage( This.Hwnd , This.Default_Bitmap )
  1281. }
  1282. Draw_Hover(){
  1283. SetImage( This.Hwnd , This.Hover_Bitmap )
  1284. }
  1285. Draw_Pressed(){
  1286. SetImage( This.Hwnd , This.Pressed_Bitmap )
  1287. SetTimer , HB_Button_Hover , Off
  1288. While( GetKeyState( "LButton" ) )
  1289. sleep , 10
  1290. SetTimer , HB_Button_Hover , On
  1291. MouseGetPos,,,, ctrl , 2
  1292. if( This.Hwnd != ctrl ){
  1293. This.Draw_Default()
  1294. return False
  1295. }else {
  1296. This.Draw_Hover()
  1297. return true
  1298. }
  1299. }
  1300. }
  1301.  
  1302.  
  1303. HB_Button_Hover(){
  1304. Static Index , Hover_On
  1305. MouseGetPos,,,, ctrl , 2
  1306. if( ! Hover_On && ctrl ){
  1307. loop , % HB_Button.Length()
  1308. if( ctrl = HB_Button[ A_Index ].hwnd )
  1309. {
  1310. SoundBeep 1000
  1311. HB_Button[ A_Index ].Draw_Hover(), Index := A_Index , Hover_On := 1 , break
  1312. }
  1313. }else if( Hover_On = 1 )
  1314. if( ctrl != HB_Button[ Index ].Hwnd )
  1315. HB_Button[ Index ].Draw_Default() , Hover_On := 0
  1316. }
  1317.  
  1318.  
Add Comment
Please, Sign In to add comment