kilrain

Dfscript.ahk

Apr 26th, 2013
260
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.  
  38. [version]
  39. major=2
  40. minor=0
  41.  
  42. [Togglekeys]
  43. autoFire=+^LButton
  44. instaCast=+^RButton
  45. insta=0
  46. auto=0
  47.  
  48. [Filepath]
  49. loc=
  50. )
  51.  
  52. IfNotExist, c:\DFscript\config.ini
  53. {
  54.     FileCreateDir, C:\DFscript
  55.     FileAppend %config%, c:\DFscript\config.ini
  56. }
  57.  
  58. FileDelete, c:\DFscript\version.ini
  59. URLDownloadToFile, http://pastebin.com/raw.php?i=EU0zv5nS, c:\DFscript\version.ini
  60.  
  61. global Nmajor := getIni("c:\DFscript\version.ini", "version", "major")
  62. global Nminor := getIni("c:\DFscript\version.ini", "version", "minor")
  63. global major := getIni("c:\DFscript\config.ini", "version", "major")
  64. global minor := getIni("c:\DFscript\config.ini", "version", "minor")
  65.  
  66. ;;;;;;;;;;;;;;;;;;; Update Check ;;;;;;;;;;;;;;;;;;;
  67.  
  68. major := getIni("c:\DFscript\config.ini", "version", "major")
  69. minor := getIni("c:\DFscript\config.ini", "version", "minor")
  70.  
  71. Menu, Tray, Add, Add Hotkeys, run
  72.  
  73. if (major < Nmajor) or (major = Nmajor and minor < Nminor)
  74. {
  75.     Gui 2: Add, ActiveX, x0 y0 w980 h600 vWB, Shell.Explorer
  76.     WB.Navigate("http://www.ahkgaming.com/changelog.html")
  77.     Gui 2: Add, Button, x0 y600 w327 h40 , View Source (2 files)
  78.     Gui 2: Add, Button, x654 y600 w327 h40 , Download Update
  79.     Gui 2: Add, Button, x327 y600 w327 h40, Cancel
  80.  
  81.     Gui 2: Show, Center h640 w980, New Update Available
  82. return
  83. }
  84.  
  85. ;;;;;;;;;;;;;;;;;;; Welcome Message ;;;;;;;;;;;;;;;;;;;
  86.  
  87. welcomeMsg = Welcome to Darkfall.
  88. say(welcomeMsg)
  89.  
  90. ;;;;;;;;;;;;;;;;;;;;;;;;; Hotkey Section ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  91.  
  92.  
  93.  
  94. 2ButtonCancel:
  95. Gui, 2: Hide
  96. reloadkeys:
  97. #Include functions.ahk
  98. run:
  99. Gui, Add, GroupBox, x56 y47 w190 h110  , Extra Mount Keys (Optional):
  100. Gui, Add, Text, x66 y67 w90 h20 , Mount Left:
  101. Gui, Add, Text, x66 y97 w90 h20 , Mount Right:
  102. Gui, Add, Hotkey, x166 y67 w70 h23 vmountLeft, %mountLeft% ;left action
  103. Gui, Add, Hotkey,  x166 y97 w70 h23 vmountRight, %mountRight% ;right action
  104. Gui, Add, GroupBox, x56 y167 w320 h150 , Toggle Keys
  105. Gui, Add, Text, x66 y197 w110 h20 , Toggle AutoFire:
  106. Gui, Add, Hotkey, x196 y197 w120 h23 vautoFire, %autoFire%
  107. Gui, Add, Text, x66 y257 w110 h20 , Toggle Inst-Cast:
  108. Gui, Add, Hotkey, x196 y257 w120 h23 vinstaCast, %instaCast%
  109. Gui, Add, Text, x76 y220 w150 h20 , Default: ctrl+shift+Lbutton
  110. Gui, Add, Text, x76 y280 w160 h20 , Default: ctrl+shift+Rbutton
  111. Gui, Show
  112. return
  113.  
  114. ~esc::
  115. {
  116.     IniWrite, %auto%, c:\DFscript\config.ini, Togglekeys, auto
  117.     IniWrite, %insta%, c:\DFscript\config.ini, Togglekeys, insta
  118.     goto, reloadkeys
  119. }
  120. return
  121.  
  122. 2ButtonDownloadUpdate:
  123. update(Nmajory, Nminor)
  124. Reload
  125. return
  126.  
  127. 2GuiClose:
  128. ExitApp
  129.  
  130. 2ButtonViewSource(2files):
  131. run http://pastebin.com/raw.php?i=fNJMTXTc
  132. run http://pastebin.com/raw.php?i=HaziAzKp
  133. return
  134.  
  135. GuiClose:
  136. Gui,Submit
  137. IniWrite, %mountLeft%, c:\DFscript\config.ini, Hotkeys, mountLeft
  138. IniWrite, %mountRight%, c:\DFscript\config.ini, Hotkeys, mountRight
  139.  
  140. IniWrite, %autoFire%, c:\DFscript\config.ini, Togglekeys, autoFire
  141. IniWrite, %instaCast%, c:\DFscript\config.ini, Togglekeys, instaCast
  142. Gui, Destroy
Advertisement
Add Comment
Please, Sign In to add comment