Advertisement
Guest User

Magicka g510 Macro

a guest
Jan 20th, 2013
421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.76 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) bind all your G keys for each M key you want to use.
  4.  
  5. --Keybindings for the elements
  6. WATER_KEY = "q"
  7. LIFE_KEY = "w"
  8. SHIELD_KEY = "e"
  9. COLD_KEY = "r"
  10. LIGHTNING_KEY = "a"
  11. SPIRIT_KEY = "s"
  12. EARTH_KEY = "d"
  13. FIRE_KEY = "f"
  14.  
  15. --How long to keep the keydown
  16. RELEASE_DELAY_TIME = 40
  17.  
  18. function tap_key(key)
  19. PressKey(key);
  20. Sleep(RELEASE_DELAY_TIME);
  21. ReleaseKey(key);
  22. Sleep(RELEASE_DELAY_TIME);
  23. end
  24.  
  25. function cast()
  26. Sleep(RELEASE_DELAY_TIME);
  27. tap_key("spacebar");
  28. end
  29.  
  30. function range_attack(charge_time)
  31. PressMouseButton(3); -- Right Click
  32. Sleep(charge_time);
  33. ReleaseMouseButton(3);
  34. end
  35.  
  36. function aoe_attack()
  37. tap_key("LeftShift");
  38. tap_key("Shift");
  39. tap_key("MouseButton(3)");
  40. tap_key("MouseButton3");
  41. tap_key("MouseButton")(3);
  42. end
  43.  
  44. --Basic elements
  45. function fire()
  46. tap_key(FIRE_KEY);
  47. end
  48.  
  49. function water()
  50. tap_key(WATER_KEY);
  51. end
  52.  
  53. function life()
  54. tap_key(LIFE_KEY);
  55. end
  56.  
  57. function earth()
  58. tap_key(EARTH_KEY);
  59. end
  60.  
  61. function spirit()
  62. tap_key(SPIRIT_KEY);
  63. end
  64.  
  65. function lightning()
  66. tap_key(LIGHTNING_KEY);
  67. end
  68.  
  69. function shield()
  70. tap_key(SHIELD_KEY);
  71. end
  72.  
  73. function cold()
  74. tap_key(COLD_KEY);
  75. end
  76.  
  77. --Composite elements
  78. function ice()
  79. Sleep(RELEASE_DELAY_TIME);
  80. water();
  81. cold();
  82. Sleep(RELEASE_DELAY_TIME);
  83. end
  84.  
  85. function steam()
  86. Sleep(RELEASE_DELAY_TIME);
  87. fire();
  88. water();
  89. Sleep(RELEASE_DELAY_TIME);
  90. end
  91.  
  92.  
  93. -- Spells
  94. function teleport()
  95. lightning();
  96. spirit();
  97. lightning();
  98. cast();
  99. end
  100.  
  101. function thunder_bolt()
  102. steam();
  103. lightning();
  104. spirit();
  105. lightning();
  106. cast();
  107. end
  108.  
  109. function grease()
  110. water();
  111. earth();
  112. life();
  113. cast();
  114. end
  115.  
  116. function meteor_shower()
  117. fire();
  118. earth();
  119. steam();
  120. earth();
  121. fire();
  122. cast();
  123. end
  124.  
  125. function crash_to_desktop()
  126. lightning();
  127. lightning();
  128. lightning();
  129. fire();
  130. life();
  131. cast();
  132. end
  133.  
  134. function conflagration()
  135. steam();
  136. Sleep(15)
  137. fire();
  138. Sleep(15)
  139. steam();
  140. Sleep(15)
  141. fire();
  142. Sleep(15)
  143. steam();
  144. Sleep(15)
  145. cast();
  146. end
  147.  
  148. function time_warp()
  149. cold()
  150. shield();
  151. cast();
  152. end
  153.  
  154. function haste()
  155. lightning();
  156. spirit();
  157. fire();
  158. cast();
  159. end
  160.  
  161. function invisibility()
  162. spirit();
  163. shield();
  164. steam();
  165. spirit();
  166. cast();
  167. end
  168.  
  169. function fear()
  170. cold();
  171. spirit();
  172. shield();
  173. cast();
  174. end
  175.  
  176. function charm()
  177. life();
  178. shield();
  179. earth();
  180. cast();
  181. end
  182.  
  183. function rain()
  184. water();
  185. steam();
  186. cast();
  187. end
  188.  
  189. function vortex()
  190. ice();
  191. spirit();
  192. ice();
  193. shield();
  194. ice();
  195. cast();
  196. end
  197.  
  198. function raise_dead()
  199. ice();
  200. earth();
  201. spirit();
  202. cold();
  203. cast();
  204. end
  205.  
  206. function summon_elemental()
  207. spirit();
  208. shield();
  209. earth();
  210. steam();
  211. spirit();
  212. cast();
  213. end
  214.  
  215. -- Experimental
  216. function summon_death()
  217. spirit();
  218. cold();Sleep(60);
  219. ice();Sleep(60);
  220. cold();Sleep(60);
  221. spirit();
  222. cast();
  223. end
  224.  
  225. function summon_pheonix()
  226. life();
  227. lightning();
  228. fire();
  229. cast();
  230. end
  231.  
  232. function nullify()
  233. spirit();
  234. shield();
  235. cast();
  236. end
  237.  
  238. function corporealize()
  239. spirit();
  240. steam();Sleep(60);
  241. lightning();
  242. shield();
  243. spirit();
  244. cast();
  245. end
  246.  
  247. function confuse()
  248. spirit();
  249. shield();
  250. lightning();
  251. cast();
  252. end
  253.  
  254. function tornado()
  255. earth();
  256. fire();Sleep(60);
  257. water();Sleep(60);
  258. water();Sleep(60);
  259. water();Sleep(60);
  260. fire();Sleep(60);
  261. cast();
  262. end
  263.  
  264. function blizzard()
  265. cold();Sleep(50);
  266. cold();Sleep(50);
  267. water();Sleep(50);
  268. cold();Sleep(50);
  269. cast();
  270. end
  271.  
  272. function thunder_storm()
  273. fire();Sleep(50);
  274. fire();Sleep(50);
  275. water();Sleep(50);
  276. water();Sleep(50);
  277. lightning();
  278. spirit();
  279. lightning();
  280. cast();
  281. end
  282.  
  283. function levitation()
  284. steam();
  285. spirit();
  286. steam();
  287. cast();
  288. end
  289.  
  290. function chain_lightning()
  291. lightning();
  292. lightning();
  293. lightning();
  294. cast();
  295. end
  296.  
  297. function napalm()
  298. steam();
  299. earth();
  300. life();
  301. fire();
  302. fire();
  303. fire();
  304. cast();
  305. end
  306.  
  307. function party_plasma()
  308. fire();
  309. fire();
  310. steam();
  311. spirit();
  312. cast();
  313. end
  314.  
  315. -- Useful Combos
  316. function lighting_beam()
  317. steam();
  318. spirit();
  319. lightning();
  320. lightning();
  321. lightning();
  322. lightning();
  323. lightning();
  324. end
  325.  
  326. function tazer()
  327. steam();
  328. shield();
  329. lightning();
  330. lightning();
  331. lightning();
  332. lightning();
  333. range_attack();
  334. end
  335.  
  336. function lazer_ice(charge_time)
  337. ice();
  338. ice();
  339. ice();
  340. spirit();
  341. range_attack(charge_time);
  342. end
  343.  
  344. function steam_beam(charge_time)
  345. steam();
  346. steam();
  347. steam();
  348. lightning();
  349. spirit();
  350. end
  351.  
  352.  
  353. -- M mode delegate functions
  354. function m1_mode(event,arg)
  355. if (event == "G_PRESSED") then
  356. if(arg == 1) then -- G1 key
  357. meteor_shower();
  358. elseif(arg == 2) then -- G2 key
  359. thunder_storm();
  360. elseif(arg == 3) then -- G3 key
  361. vortex();
  362. elseif(arg == 4) then -- G4 key
  363. tornado();
  364. elseif(arg == 5) then -- G5 Key
  365. blizzard();
  366. elseif(arg == 6) then -- G6 Key
  367. napalm();
  368. elseif(arg == 7) then -- G7 key
  369. confuse();
  370. elseif(arg == 8) then -- G8 key
  371. summon_pheonix();
  372. elseif(arg == 9) then -- G9 key
  373. teleport();
  374. elseif(arg == 10) then -- G10 key
  375. time_warp();
  376. elseif(arg == 11) then -- G11 Key
  377. grease();
  378. elseif(arg == 12) then -- G12 Key
  379. haste();
  380. elseif(arg == 13) then -- G13 key
  381. conflagration();
  382. elseif(arg == 14) then -- G14 key
  383. thunder_bolt();
  384. elseif(arg == 15) then -- G15 key
  385. party_plasma();
  386. elseif(arg == 16) then -- G16 key
  387. tazer();
  388. elseif(arg == 17) then -- G17 Key
  389. steam_beam();
  390. elseif(arg == 18) then -- G18 Key
  391. lazer_ice(250);
  392. end
  393. end
  394. if (event == "G_RELEASED" and arg == 1) then
  395. -- G1 has been released
  396. end
  397. end
  398.  
  399.  
  400. -- Main
  401. function OnEvent(event, arg)
  402. current_mkey = GetMKeyState(); -- Get which M key is active on the keyboard
  403. if(current_mkey == 1) then -- M1
  404. m1_mode(event,arg);
  405. elseif(current_mkey == 2) then -- M2
  406. m2_mode(event,arg);
  407. else -- M3 (future proof if they add M4...)
  408. m3_mode(event,arg);
  409. end
  410. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement