kilrain

DFscript3.ahk

May 17th, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #SingleInstance Force
  2. if not A_IsAdmin
  3. {
  4.    Run *RunAs "%A_ScriptFullPath%"
  5.    ExitApp
  6. }
  7.  
  8. ;;;;;;;;;;;;;;;;;;;;; Text to Speech ;;;;;;;;;;;;;;;;;;;;;;;
  9.  
  10. ttsEnabled = true
  11. ttsVolume = 100
  12.  
  13. SAPI := ComObjCreate("SAPI.SpVoice")
  14. SAPI.volume := 100
  15.  
  16. ;;;;;;;;;;;;;;;;;;;;;;;; Update Process ;;;;;;;;;;;;;;;;;;;;;;;;;
  17.  
  18. update(major, minor)
  19. {
  20.     FileCopy, DFscript.ahk, *.bak
  21.     FileCopy, functions.ahk, *.bak
  22.     URLDownloadToFile, http://dfscript.comuf.com/files/beta/functions.ahk, functions.ahk
  23.     URLDownloadToFile, http://dfscript.comuf.com/files/beta/DFscript.ahk, DFscript.ahk
  24.     ;URLDownloadToFile, http://pastebin.com/raw.php?i=fNJMTXTc, DFscript.ahk
  25.     ;URLDownloadToFile, http://pastebin.com/raw.php?i=HaziAzKp, functions.ahk
  26.     IniWrite, %Nmajor%, c:\DFscript\config.ini, version, major
  27.     IniWrite, %Nminor%, c:\DFscript\config.ini, version, minor
  28.     return
  29. }
  30.  
  31. ;;;;Configuration File;;;;
  32. config=
  33. (
  34. [Hotkeys]
  35. mountLeft=Left
  36. mountRight=Right
  37. Linsta1=0
  38. Linsta2=0
  39. Linsta3=0
  40. Linsta4=0
  41. Linsta5=0
  42. Linsta6=0
  43. Linsta7=0
  44. Linsta8=0
  45. Rinsta1=0
  46. Rinsta2=0
  47. Rinsta3=0
  48. Rinsta4=0
  49. Rinsta5=0
  50. Rinsta6=0
  51. Rinsta7=0
  52. Rinsta8=0
  53.  
  54. [class]
  55. war=1
  56. skirm=0
  57. ele=0
  58. prim=0
  59.  
  60. [version]
  61. major=2
  62. minor=0
  63.  
  64. [Togglekeys]
  65. autoFire=+^LButton
  66. instaCast=+^RButton
  67. insta=0
  68. auto=0
  69.  
  70. [Filepath]
  71. loc=
  72. )
  73.  
  74. IfNotExist, c:\DFscript\config.ini
  75. {
  76.     FileCreateDir, C:\DFscript
  77.     FileAppend %config%, c:\DFscript\config.ini
  78. }
  79.  
  80. ;FileDelete, c:\DFscript\version.ini
  81. ;URLDownloadToFile, http://pastebin.com/raw.php?i=EU0zv5nS, c:\DFscript\version.ini
  82.  
  83. ;global Nmajor := getIni("c:\DFscript\version.ini", "version", "major")
  84. ;global Nminor := getIni("c:\DFscript\version.ini", "version", "minor")
  85. ;global major := getIni("c:\DFscript\config.ini", "version", "major")
  86. ;global minor := getIni("c:\DFscript\config.ini", "version", "minor")
  87.  
  88. Loop, 8 {
  89.     IniRead, Linsta%A_Index% , c:\DFscript\config.ini, Hotkeys, Linsta%A_Index%
  90. }
  91. Loop, 8 {
  92.     IniRead, Rinsta%A_Index% , c:\DFscript\config.ini, Hotkeys, Rinsta%A_Index%
  93. }
  94.  
  95. IniRead, War, c:\DFscript\config.ini, class, war
  96. IniRead, Skirm, c:\DFscript\config.ini, class, skirm
  97. IniRead, Ele, c:\DFscript\config.ini, class, ele
  98. IniRead, Prim, c:\DFscript\config.ini, class, prim
  99.  
  100. ;;;;;;;;;;;;;;;;;;; Update Check ;;;;;;;;;;;;;;;;;;;
  101.  
  102. ;major := getIni("c:\DFscript\config.ini", "version", "major")
  103. ;minor := getIni("c:\DFscript\config.ini", "version", "minor")
  104.  
  105. Menu, Tray, Add, Keybind Options, run
  106.  
  107. ;if (major < Nmajor) or (major = Nmajor and minor < Nminor)
  108. ;{
  109. ;   Gui 2: Add, ActiveX, x0 y0 w980 h600 vWB, Shell.Explorer
  110. ;   WB.Navigate("http://www.ahkgaming.com/changelog.html")
  111. ;   Gui 2: Add, Button, x0 y600 w327 h40 , View Source (2 files)
  112. ;   Gui 2: Add, Button, x654 y600 w327 h40 , Download Update
  113. ;   Gui 2: Add, Button, x327 y600 w327 h40, Cancel
  114. ;
  115. ;   Gui 2: Show, Center h640 w980, New Update Available
  116. ;return
  117. ;}
  118.  
  119. ;;;;;;;;;;;;;;;;;;; Welcome Message ;;;;;;;;;;;;;;;;;;;
  120.  
  121. welcomeMsg = Welcome to Darkfall.
  122. say(welcomeMsg)
  123.  
  124. ;;;;;;;;;;;;;;;;;;;;;;;;; Hotkey Section ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  125.  
  126.  
  127.  
  128. 2ButtonCancel:
  129. Gui, 2: Hide
  130. reloadkeys:
  131. #Include functions.ahk
  132. run:
  133. Gui, Add, GroupBox, x6 y337 w230 h100 , Extra Left/Right keys (Fully Optional)
  134. Gui, Add, Text, x26 y367 w90 h20 , Left:
  135. Gui, Add, Text, x26 y397 w90 h20 , Right:
  136. Gui, Add, Hotkey, x116 y367 w70 h20 vmountLeft, %mountLeft% ;left action
  137. Gui, Add, Hotkey, x116 y397 w70 h20 vmountRight, %mountRight% ;right action
  138. Gui, Add, GroupBox, x6 y437 w260 h160 , Toggle Keys
  139. Gui, Add, Text, x16 y467 w100 h20 , Toggle AutoFire:
  140. Gui, Add, Hotkey, x116 y467 w120 h20 vautoFire, %autoFire%
  141. Gui, Add, Text, x16 y527 w110 h20 , Toggle Inst-Cast:
  142. Gui, Add, Hotkey, x116 y527 w120 h20 vinstaCast, %instaCast%
  143. Gui, Add, Text, x56 y487 w150 h20 , Default: ctrl+shift+Lbutton
  144. Gui, Add, Text, x56 y547 w160 h20 , Default: ctrl+shift+Rbutton
  145. Gui, Add, Text, x10 y7 w300 h25, Your Current Class
  146. Gui, Add, Radio, x16 y25 w55 h30 checked%war% vWar, War
  147. Gui, Add, Radio, x72 y25 w55 h30 checked%skirm% vSkirm, Skirm
  148. Gui Add, Radio, x135 y25 w50 h30 checked%ele% vEle, Ele
  149. Gui Add, Radio, x185 y25 w55 h30 checked%prim% vPrim, Prim
  150. Gui, Add, CheckBox, x16 y77 w100 h30 checked%Linsta1% vLinsta1, Left 1
  151. Gui, Add, CheckBox, x16 y107 w100 h30 checked%Linsta2% vLinsta2, Left 2
  152. Gui, Add, CheckBox, x16 y137 w100 h30 checked%Linsta3% vLinsta3, Left 3
  153. Gui, Add, CheckBox, x16 y167 w100 h30 checked%Linsta4% vLinsta4, Left 4
  154. Gui, Add, CheckBox, x16 y197 w100 h30 checked%Linsta5% vLinsta5, Left 5
  155. Gui, Add, CheckBox, x16 y227 w100 h30 checked%Linsta6% vLinsta6, Left 6
  156. Gui, Add, CheckBox, x16 y257 w100 h30 checked%Linsta7% vLinsta7, Left 7
  157. Gui, Add, CheckBox, x16 y287 w100 h30 checked%Linsta8% vLinsta8, Left 8
  158. Gui, Add, CheckBox, x166 y77 w100 h30 checked%Rinsta1% vRinsta1, Right 1
  159. Gui, Add, CheckBox, x166 y107 w100 h30 checked%Rinsta2% vRinsta2, Right 2
  160. Gui, Add, CheckBox, x166 y137 w100 h30 checked%Rinsta3% vRinsta3, Right 3
  161. Gui, Add, CheckBox, x166 y167 w100 h30 checked%Rinsta4% vRinsta4, Right 4
  162. Gui, Add, CheckBox, x166 y197 w100 h30 checked%Rinsta5% vRinsta5, Right 5
  163. Gui, Add, CheckBox, x166 y227 w100 h30 checked%Rinsta6% vRinsta6, Right 6
  164. Gui, Add, CheckBox, x166 y257 w100 h30 checked%Rinsta7% vRinsta7, Right 7
  165. Gui, Add, CheckBox, x166 y287 w100 h30 checked%Rinsta8% vRinsta8, Right 8
  166. Gui, Add, Text, x16 y57 w250 h25 , Set Insta-cast per key. Checked = On
  167. ; Generated using SmartGUI Creator 4.0
  168. Gui, Show, x614 y225 h599 w271, New GUI Window
  169. Return
  170.  
  171. ~esc::
  172. {
  173.     IniWrite, %auto%, c:\DFscript\config.ini, Togglekeys, auto
  174.     IniWrite, %insta%, c:\DFscript\config.ini, Togglekeys, insta
  175.     goto, reloadkeys
  176. }
  177. return
  178.  
  179. 2ButtonDownloadUpdate:
  180. update(Nmajory, Nminor)
  181. Reload
  182. return
  183.  
  184. 2GuiClose:
  185. ExitApp
  186.  
  187. 2ButtonViewSource(2files):
  188. run http://pastebin.com/raw.php?i=fNJMTXTc
  189. run http://pastebin.com/raw.php?i=HaziAzKp
  190. return
  191.  
  192. GuiClose:
  193. Gui,Submit
  194. IniWrite, %mountLeft%, c:\DFscript\config.ini, Hotkeys, mountLeft
  195. IniWrite, %mountRight%, c:\DFscript\config.ini, Hotkeys, mountRight
  196.  
  197. IniWrite, %autoFire%, c:\DFscript\config.ini, Togglekeys, autoFire
  198. IniWrite, %instaCast%, c:\DFscript\config.ini, Togglekeys, instaCast
  199.  
  200. IniWrite, %war%, c:\DFscript\config.ini, class, war
  201. IniWrite, %skirm%, c:\DFscript\config.ini, class, skirm
  202. IniWrite, %ele%, c:\DFscript\config.ini, class, ele
  203. IniWrite, %prim%, c:\DFscript\config.ini, class, prim
  204.  
  205. Loop, 8 {
  206.     IniWrite, % Linsta%A_Index%, c:\DFscript\config.ini, Hotkeys, Linsta%A_Index%
  207. }
  208. loop, 8 {
  209.     IniWrite, % Rinsta%A_Index%, c:\DFscript\config.ini, Hotkeys, Rinsta%A_Index%
  210. }
  211. Reload
Advertisement
Add Comment
Please, Sign In to add comment