Skip to content

Instantly share code, notes, and snippets.

@t00n
Last active September 28, 2017 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save t00n/0f479bbe658aa31e053b81c90dbc5c56 to your computer and use it in GitHub Desktop.
Save t00n/0f479bbe658aa31e053b81c90dbc5c56 to your computer and use it in GitHub Desktop.
--- sends a message on several channels at once ---
--- channels can be either a name or a number ---
/script m,cs="what you want to send",{"1","world","LookingForGroup"};
/script for _,c in ipairs(cs) do i,n=GetChannelName(c);SendChatMessage(m,"CHANNEL",nil,i);end
--- toggles join/leave a channel ---
/script c="channel_name";i,n=GetChannelName(c);if i==0 then JoinChannelByName(c);ChatFrame_AddChannel(ChatFrame1,c);else LeaveChannelByName(c);end
--- swaps weapons with first 2 slots of last bag, works with 2H,1H+shield, not tested with 2 weapons ---
/script local a,b,c=CursorHasItem,PickupInventoryItem,PickupContainerItem;CloseMerchant();b(17);if (not a()) then c(4,1);b(16);c(4,2);b(17);else c(4,2);b(16);c(4,1);end
--- cast several spells when clicked several times. number is the position of the spell in the spell book ---
/script function c(l) s,d,e=GetSpellCooldown(l, "BOOKTYPE_SPELL");if d == 0 then CastSpell(l,"spell") end end
/script c(27);c(4)
-- cast several spells or use items when clicked several times ---
--- l is the position of the spell in the spell book or the inventory slot id
--- t is 1 if spell else item
/script function c(l,t) if t ==1 then CastSpell(l,"spell") else UseInventoryItem(l) end end
/script c(27,1);c(4,1);c(14,0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment