Advertisement
Guest User

Untitled

a guest
May 1st, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.07 KB | None | 0 0
  1. ; ### Environment setup (dont touch this) ###
  2. #SingleInstance,Force
  3. #MaxThreadsPerHotkey 2
  4. #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
  5.  
  6. SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
  7. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
  8.  
  9. ; ### Variables ###
  10. ;Ray Script
  11. ;Set the number of rays you have here
  12. num_rays = 6
  13.  
  14. ;Set your binds here
  15. k_1 = +{f11} ;Insect Swarm
  16. k_2 = +{f8} ;Unholy Caress
  17. k_3 = +{f9} ;Dragonbreath
  18. k_4 = +{f10} ;Frostbite
  19. k_5 = +{f7} ;Impale
  20. k_6 = +{f12} ;Lightening Bolt
  21.  
  22. ;Tweak cooldowns here
  23. cd_1 = 15000 ;Insect Swarm
  24. cd_2 = 15000 ;Unholy Caress
  25. cd_3 = 15000 ;Dragonbreath
  26. cd_4 = 9000 ;Frostbite
  27. cd_5 = 6500 ;Impale
  28. cd_6 = 9000 ;Lightening Bolt
  29.  
  30. ;Set ray priority here, 1 being highest, 6 being lowest
  31. p_1 = 5 ;Insect Swarm
  32. p_2 = 2 ;Unholy Caress
  33. p_3 = 3 ;Dragonbreath
  34. p_4 = 4 ;Frostbite
  35. p_5 = 1 ;Impale
  36. p_6 = 6 ;Lightening Bolt
  37.  
  38. ;Initializes ray availability array to 1 (off cooldown)
  39. While A_Index <= num_rays
  40. {
  41. r_%A_Index% = 1
  42. }
  43.  
  44. ; ### Utils ###
  45. isMouseShown()
  46. {
  47. InfoStruct := ""
  48. StructSize := A_PtrSize + 16
  49. VarSetCapacity(InfoStruct, StructSize)
  50. NumPut(StructSize, InfoStruct)
  51. DllCall("GetCursorInfo", UInt, &InfoStruct)
  52. Result := NumGet(InfoStruct, 8)
  53.  
  54. if Result
  55. return 1
  56. else
  57. return 0
  58. }
  59.  
  60. ; ### Macro Code ###
  61.  
  62. #If !isMouseShown() and #If WinActive( "Darkfall Online" )
  63.  
  64. ;Set your ray HotKey here (currently set to e)
  65. e::
  66. cur_ray := RayLogic(cur_ray, cur_key, cur_cool)
  67. Send , %cur_key%
  68. Send e
  69. While (ErrorLevel = 1)
  70. {
  71. If (GetKeyState("W", "P") = 1)
  72. Return
  73.  
  74. KeyWait, F, T.1
  75. }
  76. r_%cur_ray% = 0
  77. neg_cur_cool := -cur_cool
  78. SetTimer, %cur_ray%, %neg_cur_cool%
  79. Return
  80.  
  81. ;Subroutine group to reset ray cds
  82. 1:
  83. 2:
  84. 3:
  85. 4:
  86. 5:
  87. 6:
  88. r_%A_ThisLabel% = 1
  89. Return
  90.  
  91. RayLogic(cur_ray, ByRef cur_key, ByRef cur_cool)
  92. {
  93. global
  94.  
  95. /*Initiates cur_ray to your highest priority ray
  96. in the case of all rays being off cooldown
  97. */
  98. cur_ray := p_1
  99.  
  100. /*Assigns the value of cur_ray to the first available
  101. ray according to priority
  102. */
  103. While A_Index <= num_rays
  104. {
  105. ray_number := p_%A_Index%
  106. if (r_%ray_number% = 1)
  107. {
  108. cur_ray := ray_number
  109. Break
  110. }
  111. }
  112.  
  113. ;Sets the ray's corresponding key and cooldown
  114. cur_key := k_%cur_ray%
  115. cur_cool := cd_%cur_ray%
  116.  
  117. Return cur_ray
  118. }
  119. ;End Ray Script
  120.  
  121. ~l::
  122. if (fiftycycle = "0")
  123. {
  124. sendinput {f9}
  125. fiftycycle = 1
  126. SetTimer, KeyWinl, 4000
  127. } ELSE if (fiftycycle = "1")
  128. {
  129. sendinput {f10}
  130. fiftycycle = 0
  131. } ELSE {
  132. fiftycycle = 0
  133. }
  134. return
  135.  
  136. KeyWinl:
  137. SetTimer, KeyWinl, off
  138. If (fiftycycle = "1")
  139. {
  140. fiftycycle = 0
  141. }ELSE IF (fiftycycle > 1)
  142. {
  143. fiftycycle = 0
  144. }ELSE{
  145. fiftycycle = 0
  146. }
  147. return
  148.  
  149.  
  150.  
  151.  
  152. ~j::
  153. if (healcycle = "0")
  154. {
  155. sendinput {f11}
  156. healcycle = 1
  157. SetTimer, KeyWinj, 4000
  158. } ELSE if (healcycle = "1")
  159. {
  160. sendinput {f12}
  161. healcycle = 0
  162. } ELSE {
  163. healcycle = 0
  164. }
  165. return
  166.  
  167. KeyWinj:
  168. SetTimer, KeyWinj, off
  169. If (healcycle = "1")
  170. {
  171. healcycle = 0
  172. }ELSE IF (healcycle > 1)
  173. {
  174. healcycle = 0
  175. }ELSE{
  176. healcycle = 0
  177. }
  178. return
  179.  
  180.  
  181.  
  182.  
  183. ~numpad2::
  184. if (debuffcycle = "0")
  185. {
  186. sendinput {f7}
  187. debuffcycle = 1
  188. SetTimer, KeyWinnumpad2, 7000
  189. } ELSE if (debuffcycle = "1")
  190. {
  191. sendinput {f8}
  192. debuffcycle = 0
  193. } ELSE {
  194. debuffcycle = 0
  195. }
  196. return
  197.  
  198. KeyWinnumpad2:
  199. SetTimer, KeyWinnumpad2, off
  200. If (debuffcycle = "1")
  201. {
  202. debuffcycle = 0
  203. }ELSE IF (debuffcycle > 1)
  204. {
  205. debuffcycle = 0
  206. }ELSE{
  207. debuffcycle = 0
  208. }
  209. return
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216. ~numpad3::
  217. if (debufffcycle = "0")
  218. {
  219. sendinput +{[}
  220. debufffcycle = 1
  221. SetTimer, KeyWinnumpad3, 7000
  222. } ELSE if (debufffcycle = "1")
  223. {
  224. sendinput +{]}
  225. debufffcycle = 0
  226. } ELSE {
  227. debufffcycle = 0
  228. }
  229. return
  230.  
  231. KeyWinnumpad3:
  232. SetTimer, KeyWinnumpad3, off
  233. If (debufffcycle = "1")
  234. {
  235. debufffcycle = 0
  236. }ELSE IF (debufffcycle > 1)
  237. {
  238. debufffcycle = 0
  239. }ELSE{
  240. debufffcycle = 0
  241. }
  242. return
  243.  
  244.  
  245. k::
  246. Send {numpad7}
  247. Sleep 500
  248. Send {numpad8}
  249. return
  250.  
  251. ; leave this as last line
  252. #IfWinActive6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement