-- To use this script
-- 1) copy and paste this body into the script editor window and save it.
-- 2) bind all your G keys for each M key you want to use.
--Keybindings for the elements
WATER_KEY = "q"
LIFE_KEY = "w"
SHIELD_KEY = "e"
COLD_KEY = "r"
LIGHTNING_KEY = "a"
SPIRIT_KEY = "s"
EARTH_KEY = "d"
FIRE_KEY = "f"
--How long to keep the keydown
RELEASE_DELAY_TIME = 40
function tap_key(key)
PressKey(key);
Sleep(RELEASE_DELAY_TIME);
ReleaseKey(key);
Sleep(RELEASE_DELAY_TIME);
end
function cast()
Sleep(RELEASE_DELAY_TIME);
tap_key("spacebar");
end
function range_attack(charge_time)
PressMouseButton(3); -- Right Click
Sleep(charge_time);
ReleaseMouseButton(3);
end
function aoe_attack()
tap_key("LeftShift");
tap_key("Shift");
tap_key("MouseButton(3)");
tap_key("MouseButton3");
tap_key("MouseButton")(3);
end
--Basic elements
function fire()
tap_key(FIRE_KEY);
end
function water()
tap_key(WATER_KEY);
end
function life()
tap_key(LIFE_KEY);
end
function earth()
tap_key(EARTH_KEY);
end
function spirit()
tap_key(SPIRIT_KEY);
end
function lightning()
tap_key(LIGHTNING_KEY);
end
function shield()
tap_key(SHIELD_KEY);
end
function cold()
tap_key(COLD_KEY);
end
--Composite elements
function ice()
Sleep(RELEASE_DELAY_TIME);
water();
cold();
Sleep(RELEASE_DELAY_TIME);
end
function steam()
Sleep(RELEASE_DELAY_TIME);
fire();
water();
Sleep(RELEASE_DELAY_TIME);
end
-- Spells
function teleport()
lightning();
spirit();
lightning();
cast();
end
function thunder_bolt()
steam();
lightning();
spirit();
lightning();
cast();
end
function grease()
water();
earth();
life();
cast();
end
function meteor_shower()
fire();
earth();
steam();
earth();
fire();
cast();
end
function crash_to_desktop()
lightning();
lightning();
lightning();
fire();
life();
cast();
end
function conflagration()
steam();
Sleep(15)
fire();
Sleep(15)
steam();
Sleep(15)
fire();
Sleep(15)
steam();
Sleep(15)
cast();
end
function time_warp()
cold()
shield();
cast();
end
function haste()
lightning();
spirit();
fire();
cast();
end
function invisibility()
spirit();
shield();
steam();
spirit();
cast();
end
function fear()
cold();
spirit();
shield();
cast();
end
function charm()
life();
shield();
earth();
cast();
end
function rain()
water();
steam();
cast();
end
function vortex()
ice();
spirit();
ice();
shield();
ice();
cast();
end
function raise_dead()
ice();
earth();
spirit();
cold();
cast();
end
function summon_elemental()
spirit();
shield();
earth();
steam();
spirit();
cast();
end
-- Experimental
function summon_death()
spirit();
cold();Sleep(60);
ice();Sleep(60);
cold();Sleep(60);
spirit();
cast();
end
function summon_pheonix()
life();
lightning();
fire();
cast();
end
function nullify()
spirit();
shield();
cast();
end
function corporealize()
spirit();
steam();Sleep(60);
lightning();
shield();
spirit();
cast();
end
function confuse()
spirit();
shield();
lightning();
cast();
end
function tornado()
earth();
fire();Sleep(60);
water();Sleep(60);
water();Sleep(60);
water();Sleep(60);
fire();Sleep(60);
cast();
end
function blizzard()
cold();Sleep(50);
cold();Sleep(50);
water();Sleep(50);
cold();Sleep(50);
cast();
end
function thunder_storm()
fire();Sleep(50);
fire();Sleep(50);
water();Sleep(50);
water();Sleep(50);
lightning();
spirit();
lightning();
cast();
end
function levitation()
steam();
spirit();
steam();
cast();
end
function chain_lightning()
lightning();
lightning();
lightning();
cast();
end
function napalm()
steam();
earth();
life();
fire();
fire();
fire();
cast();
end
function party_plasma()
fire();
fire();
steam();
spirit();
cast();
end
-- Useful Combos
function lighting_beam()
steam();
spirit();
lightning();
lightning();
lightning();
lightning();
lightning();
end
function tazer()
steam();
shield();
lightning();
lightning();
lightning();
lightning();
range_attack();
end
function lazer_ice(charge_time)
ice();
ice();
ice();
spirit();
range_attack(charge_time);
end
function steam_beam(charge_time)
steam();
steam();
steam();
lightning();
spirit();
end
-- M mode delegate functions
function m1_mode(event,arg)
if (event == "G_PRESSED") then
if(arg == 1) then -- G1 key
meteor_shower();
elseif(arg == 2) then -- G2 key
thunder_storm();
elseif(arg == 3) then -- G3 key
vortex();
elseif(arg == 4) then -- G4 key
tornado();
elseif(arg == 5) then -- G5 Key
blizzard();
elseif(arg == 6) then -- G6 Key
napalm();
elseif(arg == 7) then -- G7 key
confuse();
elseif(arg == 8) then -- G8 key
summon_pheonix();
elseif(arg == 9) then -- G9 key
teleport();
elseif(arg == 10) then -- G10 key
time_warp();
elseif(arg == 11) then -- G11 Key
grease();
elseif(arg == 12) then -- G12 Key
haste();
elseif(arg == 13) then -- G13 key
conflagration();
elseif(arg == 14) then -- G14 key
thunder_bolt();
elseif(arg == 15) then -- G15 key
party_plasma();
elseif(arg == 16) then -- G16 key
tazer();
elseif(arg == 17) then -- G17 Key
steam_beam();
elseif(arg == 18) then -- G18 Key
lazer_ice(250);
end
end
if (event == "G_RELEASED" and arg == 1) then
-- G1 has been released
end
end
-- Main
function OnEvent(event, arg)
current_mkey = GetMKeyState(); -- Get which M key is active on the keyboard
if(current_mkey == 1) then -- M1
m1_mode(event,arg);
elseif(current_mkey == 2) then -- M2
m2_mode(event,arg);
else -- M3 (future proof if they add M4...)
m3_mode(event,arg);
end
end