Guest User

Untitled

a guest
Jan 24th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.81 KB | None | 0 0
  1. -- To use this script
  2. -- 1) copy and paste this body into the script editor window and save it.
  3. -- 2) Set each G Key in each M mode (that you want to use) to "script"
  4.  
  5. -- NOTE: Only G1 - G6 are configured since I am using the orange G15,
  6. -- Extending this to 18 is just copy and paste.
  7.  
  8. -- If you are trying to record macros and they are not working, make sure you have
  9. -- the record delay checkbox checked, however I find this script works better and
  10. -- is more flexible than recording each macro by hand and adjusting the delay.
  11.  
  12. --Keybindings for the elements
  13. WATER_KEY = "q"
  14. LIFE_KEY = "w"
  15. SHIELD_KEY = "e"
  16. COLD_KEY = "r"
  17. LIGHTNING_KEY = "a"
  18. SPIRIT_KEY = "s"
  19. EARTH_KEY = "d"
  20. FIRE_KEY = "f"
  21.  
  22. --How long to keep the keydown
  23. RELEASE_DELAY_TIME = 60
  24.  
  25. function tap_key(key)
  26. PressKey(key);
  27. Sleep(RELEASE_DELAY_TIME);
  28. ReleaseKey(key);
  29. Sleep(RELEASE_DELAY_TIME);
  30. end
  31.  
  32. function cast()
  33. tap_key("spacebar");
  34. end
  35.  
  36. function range_attack(charge_time)
  37. PressMouseButton(3); -- Right Click
  38. Sleep(charge_time);
  39. ReleaseMouseButton(3);
  40. end
  41.  
  42. --Basic elements
  43. function fire()
  44. tap_key(FIRE_KEY);
  45. end
  46.  
  47. function water()
  48. tap_key(WATER_KEY);
  49. end
  50.  
  51. function life()
  52. tap_key(LIFE_KEY);
  53. end
  54.  
  55. function earth()
  56. tap_key(EARTH_KEY);
  57. end
  58.  
  59. function spirit()
  60. tap_key(SPIRIT_KEY);
  61. end
  62.  
  63. function lightning()
  64. tap_key(LIGHTNING_KEY);
  65. end
  66.  
  67. function shield()
  68. tap_key(SHIELD_KEY);
  69. end
  70.  
  71. function cold()
  72. tap_key(COLD_KEY);
  73. end
  74.  
  75. --Composite elements
  76. function ice()
  77. Sleep(RELEASE_DELAY_TIME);
  78. water();
  79. cold();
  80. Sleep(RELEASE_DELAY_TIME);
  81. end
  82.  
  83. function steam()
  84. Sleep(RELEASE_DELAY_TIME);
  85. fire();
  86. water();
  87. Sleep(RELEASE_DELAY_TIME);
  88. end
  89.  
  90.  
  91. -- Spells
  92. function teleport()
  93. lightning();
  94. spirit();
  95. lightning();
  96. cast();
  97. end
  98.  
  99. function thunder_bolt()
  100. steam();
  101. lightning();
  102. spirit();
  103. lightning();
  104. cast();
  105. end
  106.  
  107. function grease()
  108. water();
  109. earth();
  110. life();
  111. cast();
  112. end
  113.  
  114. function meteor_shower()
  115. fire();
  116. earth();
  117. steam();
  118. earth();
  119. fire();
  120. cast();
  121. end
  122.  
  123. -- Broken, Queues 3 steam?
  124. function conflagration()
  125. steam();
  126. fire();
  127. steam();
  128. fire();
  129. steam();
  130. cast();
  131. end
  132.  
  133. function time_warp()
  134. cold()
  135. shield();
  136. cast();
  137. end
  138.  
  139. function rezz()
  140. life()
  141. lightning();
  142. cast();
  143. end
  144.  
  145. function haste()
  146. lightning();
  147. spirit();
  148. fire();
  149. cast();
  150. end
  151.  
  152. function invisibility()
  153. spirit();
  154. shield();
  155. steam();
  156. spirit();
  157. cast();
  158. end
  159.  
  160. function fear()
  161. cold();
  162. spirit();
  163. shield();
  164. cast();
  165. end
  166.  
  167. function charm()
  168. life();
  169. shield();
  170. earth();
  171. cast();
  172. end
  173.  
  174. function rain()
  175. water();
  176. steam();
  177. cast();
  178. end
  179.  
  180. function vortex()
  181. ice();
  182. spirit();
  183. ice();
  184. shield();
  185. ice();
  186. cast();
  187. end
  188.  
  189. function raise_dead()
  190. ice();
  191. earth();
  192. spirit();
  193. cold();
  194. cast();
  195. end
  196.  
  197. function summon_elemental()
  198. spirit();
  199. shield();
  200. earth();
  201. steam();
  202. spirit();
  203. cast();
  204. end
  205.  
  206. -- Broken
  207. function summon_death()
  208. spirit();
  209. cold();
  210. ice();
  211. cold();
  212. spirit();
  213. cast();
  214. end
  215.  
  216. function summon_pheonix()
  217. life();
  218. lightning();
  219. fire();
  220. cast();
  221. end
  222.  
  223. function nullify()
  224. spirit();
  225. shield();
  226. cast();
  227. end
  228.  
  229. function corporealize()
  230. spirit();
  231. steam();
  232. lightning();
  233. shield();
  234. spirit();
  235. cast();
  236. end
  237.  
  238.  
  239. -- Useful Combos
  240. function lazer_ice(charge_time)
  241. ice();
  242. ice();
  243. ice();
  244. spirit();
  245. lightning();
  246. range_attack(charge_time);
  247. end
  248.  
  249.  
  250. -- M mode delegate functions
  251. function m1_mode(event,arg)
  252. if (event == "G_PRESSED") then
  253. if(arg == 18) then -- G1 key
  254. teleport();
  255. elseif(arg == 17) then -- G2 key
  256. haste();
  257. elseif(arg == 16) then -- G2 key
  258. rezz();
  259. elseif(arg == 15) then -- G3 key
  260. grease();
  261. elseif(arg == 1) then
  262. summon_death();
  263. elseif(arg == 2) then
  264. raise_dead();
  265. elseif(arg == 3) then
  266. summon_pheonix();
  267. elseif(arg == 4) then
  268. thunder_bolt();
  269. elseif(arg == 5) then
  270. lazer_ice(300);
  271. end
  272.  
  273. end
  274. if (event == "G_RELEASED" and arg == 1) then
  275. -- G1 has been released
  276. end
  277. end
  278.  
  279.  
  280. -- Main
  281. function OnEvent(event, arg)
  282. current_mkey = GetMKeyState(); -- Get which M key is active on the keyboard
  283. if(current_mkey == 1) then -- M1
  284. m1_mode(event,arg);
  285. elseif(current_mkey == 2) then -- M2
  286. m2_mode(event,arg);
  287. else -- M3 (future proof if they add M4...)
  288. m3_mode(event,arg);
  289. end
  290. end
Add Comment
Please, Sign In to add comment