Page 1 of 1

Melee Shoot Macro

PostPosted: Thu Jan 14, 2016 7:41 pm
by xanderbox
Is there an equivalent macro for the three shoot skills melee has. Once the new syntax is in the game you can have it check to see which type of ranged weapon is equipped and use the appropriate skill as below. Is this possible in vanilla?

/cast [equipped:gun] shoot gun
/cast [equipped:bow] shoot bow
/cast [equipped:crossbow] shoot crossbow

Re: Melee Shoot Macro

PostPosted: Thu Jan 14, 2016 10:55 pm
by Roadblock
Ok, haha this was a nice challenge to fit in 255 chars :D .
Code: Select all
/script local _,_,i=strfind(GetInventoryItemLink("player",18),"\124Hitem:(%d+)");local _,_,_,_,_,p=GetItemInfo(i);local t={["Bows"]="Bow",["Guns"]="Gun",["Crossbows"]="Crossbow",["Thrown"]="Throw"};CastSpellByName((string.gsub(t[p],"^([^T])","Shoot %1")))

(255 chars)
Gist for easy copy paste: https://gist.github.com/Dridzt/c45e3c14 ... ro-vanilla

Re: Melee Shoot Macro

PostPosted: Thu Jan 14, 2016 11:03 pm
by Roadblock
v2 with 7 chars to spare (248 chars instead of 255)
Code: Select all
/script local _,_,i=strfind(GetInventoryItemLink("player",18),"\124Hitem:(%d+)");local _,_,_,_,_,p=GetItemInfo(i);local t={};t.Bows="Bow";t.Guns="Gun";t.Crossbows="Crossbow";t.Thrown="Throw";CastSpellByName((string.gsub(t[p],"^([^T])","Shoot %1")))

Re: Melee Shoot Macro

PostPosted: Thu Jan 14, 2016 11:09 pm
by Roadblock
Last version 241 chars :P
Code: Select all
/script local _,_,i=strfind(GetInventoryItemLink("player",18),"\124Hitem:(%d+)")local _,_,_,_,_,p=GetItemInfo(i)local t={}t.Bows="Bow"t.Guns="Gun"t.Crossbows="Crossbow"t.Thrown="Throw"CastSpellByName((string.gsub(t[p],"^([^T])","Shoot %1")))


It should handle all 4 ranged skills btw, Gun, Bow, Crossbow and Thrown.

Re: Melee Shoot Macro

PostPosted: Sat Jan 16, 2016 12:24 pm
by Fuhrern
Thanks a lot for this macro, I've needed this one for a while!