About: USERAPI RunSlashCmd   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

The following snippet provides a global function RunSlashCmd that can be used to execute an arbitrary slash command (i.e. "/myaddon hi"). local _G = _G function RunSlashCmd(cmd) local slash, rest = cmd:match("^(%S+)%s*(.-)$") for name, func in pairs(SlashCmdList) do local i, slashCmd = 1 repeat slashCmd, i = _G["SLASH_"..name..i], i + 1 if slashCmd == slash then return true, func(rest) end until not slashCmd end -- Okay, so it's not a slash command. It may also be an emote. local i = 1 while _G["EMOTE" .. i .. "_TOKEN"] do local j, cn = 2, _G["EMOTE" .. i .. "_CMD1"] while cn do if cn == slash then return true, DoEmote(_G["EMOTE" .. i .. "_TOKEN"], rest); end j, cn = j+1, _G["EMOTE" .

AttributesValues
rdfs:label
  • USERAPI RunSlashCmd
rdfs:comment
  • The following snippet provides a global function RunSlashCmd that can be used to execute an arbitrary slash command (i.e. "/myaddon hi"). local _G = _G function RunSlashCmd(cmd) local slash, rest = cmd:match("^(%S+)%s*(.-)$") for name, func in pairs(SlashCmdList) do local i, slashCmd = 1 repeat slashCmd, i = _G["SLASH_"..name..i], i + 1 if slashCmd == slash then return true, func(rest) end until not slashCmd end -- Okay, so it's not a slash command. It may also be an emote. local i = 1 while _G["EMOTE" .. i .. "_TOKEN"] do local j, cn = 2, _G["EMOTE" .. i .. "_CMD1"] while cn do if cn == slash then return true, DoEmote(_G["EMOTE" .. i .. "_TOKEN"], rest); end j, cn = j+1, _G["EMOTE" .
dcterms:subject
dbkwik:wowwiki/pro...iPageUsesTemplate
abstract
  • The following snippet provides a global function RunSlashCmd that can be used to execute an arbitrary slash command (i.e. "/myaddon hi"). local _G = _G function RunSlashCmd(cmd) local slash, rest = cmd:match("^(%S+)%s*(.-)$") for name, func in pairs(SlashCmdList) do local i, slashCmd = 1 repeat slashCmd, i = _G["SLASH_"..name..i], i + 1 if slashCmd == slash then return true, func(rest) end until not slashCmd end -- Okay, so it's not a slash command. It may also be an emote. local i = 1 while _G["EMOTE" .. i .. "_TOKEN"] do local j, cn = 2, _G["EMOTE" .. i .. "_CMD1"] while cn do if cn == slash then return true, DoEmote(_G["EMOTE" .. i .. "_TOKEN"], rest); end j, cn = j+1, _G["EMOTE" .. i .. "_CMD" .. j] end i = i + 1 end end
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software