Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function ReplaceDigit(digit)
- DigitToNumeral = {[""] = "\"",["1"] = "\"",["2"] = "II\"",["3"] = "III\"",["4"] = "IV\"",["5"] = "V\"",["6"] = "VI\"",["7"] = "VII\""}
- local result = DigitToNumeral[digit]
- if result ~= nil then
- return result
- else
- return digit
- end
- end
- function handle_Game_command(typed,command)
- ScriptWrapper:Print(command,0)
- if typed then -- typed command
- local Ismagic = nil
- if command:find("/ma ") ~= nil then -- /ma somespell 3 <t>
- Ismagic = "(/ma )(%w)"
- elseif command:find("/magic ") ~= nil then -- /magic somespell 3 <t>
- Ismagic = "(/magic )(%w)"
- end
- if Ismagic ~= nil then -- takes /ma somespell 3 sometarget and returns /ma "Somespell III" sometarget
- return string.gsub(string.gsub(command, Ismagic, function(a,b) return a.."\""..string.upper(b) end, 1), "(%d+)", ReplaceDigit, 1) -- /ma "somespell III" <t>
- end
- end
- return false
- end
- ScriptWrapper:RegisterHandler(1, "handle_Game_command")
Add Comment
Please, Sign In to add comment