1. #cs ----------------------------------------------------------------------------
  2.  
  3.  AutoIt Version: 3.2.11.0 (beta)
  4.  Author: myName
  5.  
  6.  Script Function:
  7. Template AutoIt script.
  8.  
  9. #ce ----------------------------------------------------------------------------
  10.  
  11. ; Script Start - Add your code below here
  12.  
  13. #include <GUIConstants.au3>
  14.  
  15. Global $thisprogram = "MixamAO Gui"
  16. Global $fullredvexpath, $redvexpath, $redvexname
  17.  
  18. #Region ### START Koda GUI section ### Form=E:\Desktop\MixamAO Gui\MixamAO.kxf
  19. $MixamAO_Gui = GUICreate("MixamAO", 469, 569, 246, 123)
  20. $MixamAO = GUICtrlCreateTab(8, 8, 449, 521)
  21. GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
  22. $TabSheet1 = GUICtrlCreateTabItem("MixamAO.ini")
  23. $Group1 = GUICtrlCreateGroup("Options", 28, 49, 145, 97)
  24. $CBRefreshTray = GUICtrlCreateCheckbox("Refresh Tray", 44, 73, 97, 17)
  25. GUICtrlSetState(-1, _IniToGui(IniRead($thisprogram & ".ini", "Settings", "RefreshTray", 1)))
  26. GUICtrlSetTip(-1, "Check for on unchecked for of")
  27. $CBrd = GUICtrlCreateCheckbox("R/D Prevention", 44, 97, 97, 17)
  28. GUICtrlSetState(-1, _IniToGui(IniRead($thisprogram & ".ini", "Settings", "RDprevention", 1)))
  29. GUICtrlSetTip(-1, "Check for on unchecked for of")
  30. $CBLogs = GUICtrlCreateCheckbox("Manage Logs", 44, 120, 97, 17)
  31. GUICtrlSetState(-1, _IniToGui(IniRead($thisprogram & ".ini", "Settings", "ManageLogs", 1)))
  32. GUICtrlSetTip(-1, "Check for on unchecked for of")
  33. GUICtrlCreateGroup("", -99, -99, 1, 1)
  34. $Group2 = GUICtrlCreateGroup("Settings", 28, 169, 249, 121)
  35. $LabelMaxGameLength = GUICtrlCreateLabel("MaxGameLength", 36, 201, 85, 17)
  36. GUICtrlSetTip(-1, "If a game is not made in this long, restart redvex")
  37. $InputMaxGameMin = GUICtrlCreateInput(Int(IniRead($thisprogram & ".ini", "Settings", "MaxGameLength", 600)/60), 132, 193, 56, 21)
  38. $UDMaxGameMinutes = GUICtrlCreateUpdown($InputMaxGameMin)
  39. GUICtrlSetLimit(-1, 60, 2)
  40. GUICtrlSetTip(-1, "Minutes")
  41. $InputMaxGameSec = GUICtrlCreateInput(mod(IniRead($thisprogram & ".ini", "Settings", "MaxGameLength", 600), 60), 200, 193, 56, 21)
  42. $UDMaxGameSeconds = GUICtrlCreateUpdown($InputMaxGameSec)
  43. GUICtrlSetLimit(-1, 59, 0)
  44. GUICtrlSetTip(-1, "Seconds")
  45. $LabelSleepTime = GUICtrlCreateLabel("Sleep Time", 36, 225, 57, 17)
  46. GUICtrlSetTip(-1, "How often to check for crash (in ms)")
  47. $InputSleep = GUICtrlCreateInput("" & IniRead($thisprogram & ".ini", "Settings", "Sleep", 1000) & "", 132, 217, 123, 21)
  48. $UDSleepTime = GUICtrlCreateUpdown($InputSleep)
  49. GUICtrlSetLimit(-1, 30000, 0)
  50. GUICtrlSetTip(-1, "Milliseconds")
  51. $LabelBanWaitTime = GUICtrlCreateLabel("BanWaitTime", 36, 249, 68, 17)
  52. GUICtrlSetTip(-1, "How long to wait before restarting after a ban")
  53. $InputBanWaitHour = GUICtrlCreateInput(Int(IniRead($thisprogram & ".ini", "Settings", "BanWaitTime", 3605)/60), 132, 241, 56, 21)
  54. $UDWaitTimeHour = GUICtrlCreateUpdown($InputBanWaitHour)
  55. GUICtrlSetLimit(-1, 24, 0)
  56. GUICtrlSetTip(-1, "Hours")
  57. $InputBanWaitMin = GUICtrlCreateInput(mod(IniRead($thisprogram & ".ini", "Settings", "BanWaitTime", 3605), 60), 199, 241, 56, 21)
  58. $UDWaitTimeMin = GUICtrlCreateUpdown($InputBanWaitMin)
  59. GUICtrlSetLimit(-1, 59, 0)
  60. GUICtrlSetTip(-1, "Minutes")
  61. GUICtrlCreateGroup("", -99, -99, 1, 1)
  62. $Group3 = GUICtrlCreateGroup("RedVex Files", 28, 321, 385, 113)
  63. $LabelRedvexBrowse = GUICtrlCreateLabel("Locate your Redvex.exe file", 44, 349, 136, 17)
  64. $ButtonBrowse = GUICtrlCreateButton("Browse", 184, 344, 75, 25, 0)
  65. $LabelRedvexFolder = GUICtrlCreateLabel("Redvex Folder:", 44, 376, 76, 17)
  66. $InputRedvexFolder = GUICtrlCreateInput(IniRead($thisprogram & ".ini", "Settings", "RedVexDir", """RedvexFolder"""), 123, 372, 280, 21)
  67. $LabelRedvexName = GUICtrlCreateLabel("Redvex Name:", 44, 400, 75, 17)
  68. $InputRedvexName = GUICtrlCreateInput(IniRead($thisprogram & ".ini", "Settings", "RedVex", """Redvex"""), 123, 395, 280, 21)
  69. GUICtrlCreateGroup("", -99, -99, 1, 1)
  70. $TabSheet2 = GUICtrlCreateTabItem("Awesom-O.ini")
  71. $Label5 = GUICtrlCreateLabel("Not yet added in Beta5", 162, 223, 113, 17)
  72. $TabSheet3 = GUICtrlCreateTabItem("Bot.ini")
  73. $Label6 = GUICtrlCreateLabel("Not yet added in Beta5", 162, 223, 113, 17)
  74. $TabSheet4 = GUICtrlCreateTabItem("About")
  75. $Label9 = GUICtrlCreateLabel("This is MixamAO Beta5 and this tab is also under construction", 76, 223, 294, 17)
  76. GUICtrlCreateTabItem("")
  77. $ButtonOK = GUICtrlCreateButton("OK", 200, 536, 75, 25, 0)
  78. $ButtonApply = GUICtrlCreateButton("Apply", 280, 536, 75, 25, 0)
  79. $ButtonCancel = GUICtrlCreateButton("Cancel", 360, 536, 75, 25, 0)
  80. GUISetState(@SW_SHOW)
  81. #EndRegion ### END Koda GUI section ###
  82.  
  83. While 1
  84. $nMsg = GUIGetMsg()
  85. Switch $nMsg
  86. Case $ButtonBrowse
  87. $fullredvexpath = FileOpenDialog("Locate your Redvex.exe file:", @DesktopDir & "\", "Executable (*.exe)", 1 + 2, "RedVex 3.exe")
  88.  
  89. If @error Then
  90. MsgBox(4096,"","No File(s) chosen")
  91. Else
  92. $redvexname = StringTrimLeft($fullredvexpath, StringInStr($fullredvexpath, "\", 0, -1))
  93. $redvexname = StringTrimRight($redvexname, 4)
  94. GUICtrlSetData($InputRedvexName, $redvexname)
  95. $redvexpath = StringTrimRight($fullredvexpath, StringLen($fullredvexpath) - StringInStr($fullredvexpath, "\", 0, -1))
  96. GUICtrlSetData($InputRedvexFolder, $redvexpath)
  97. EndIf
  98.  
  99. Case $ButtonCancel
  100. Exit
  101.  
  102. Case $ButtonApply
  103. _SaveChanges()
  104.  
  105. Case $ButtonOK
  106. _SaveChanges()
  107. Exit
  108.  
  109. Case $GUI_EVENT_CLOSE
  110. Exit
  111.  
  112. EndSwitch
  113. WEnd
  114.  
  115. Func _SaveChanges()
  116. Local $refreshTray, $rdPrevention, $manageLogs
  117.  
  118. $refreshTray = GUICtrlRead ($CBRefreshTray)
  119. $rdPrevention = GUICtrlRead ($CBrd)
  120. $manageLogs = GUICtrlRead ($CBLogs)
  121.  
  122. If $refreshTray = $GUI_CHECKED Then
  123. IniWrite($thisprogram & ".ini", "Settings", "RefreshTray", 1)
  124. Else
  125. IniWrite($thisprogram & ".ini", "Settings", "RefreshTray", 0)
  126. EndIf
  127.  
  128. If $rdPrevention = $GUI_CHECKED Then
  129. IniWrite($thisprogram & ".ini", "Settings", "RDprevention", 1)
  130. Else
  131. IniWrite($thisprogram & ".ini", "Settings", "RDprevention", 0)
  132. EndIf
  133.  
  134. If $manageLogs = $GUI_CHECKED Then
  135. IniWrite($thisprogram & ".ini", "Settings", "ManageLogs", 1)
  136. Else
  137. IniWrite($thisprogram & ".ini", "Settings", "ManageLogs", 0)
  138. EndIf
  139.  
  140. IniWrite($thisprogram & ".ini", "Settings", "Sleep", GUICtrlRead($InputSleep))
  141. IniWrite($thisprogram & ".ini", "Settings", "MaxGameLength", GUICtrlRead($InputMaxGameMin)*60 + GUICtrlRead($InputMaxGameSec))
  142. IniWrite($thisprogram & ".ini", "Settings", "BanWaitTime", GUICtrlRead($InputBanWaitHour)*60 + GUICtrlRead($InputBanWaitMin))
  143. IniWrite($thisprogram & ".ini", "Settings", "RedVex", '""' & GUICtrlRead($InputRedvexName) & '""')
  144. IniWrite($thisprogram & ".ini", "Settings", "RedVexDir", '""' & GUICtrlRead($InputRedvexFolder) & '""')
  145. EndFunc
  146.  
  147. Func _IniToGui($a)
  148. If $a = 1 Then
  149. Return $GUI_CHECKED
  150. Else
  151. Return $GUI_UNCHECKED
  152. EndIf
  153. EndFunc
  154.  
  155.