diff options
author | madmaxoft <github@xoft.cz> | 2014-02-15 23:17:42 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-02-15 23:17:50 +0100 |
commit | 3582c4bc60beb1f8a093c435131d9d93e337a659 (patch) | |
tree | daa94104bc320354647d6f1a36b66eba2ba6210f /MCServer/Plugins/Debuggers | |
parent | Implemented cCompositeChat. (diff) | |
download | cuberite-3582c4bc60beb1f8a093c435131d9d93e337a659.tar cuberite-3582c4bc60beb1f8a093c435131d9d93e337a659.tar.gz cuberite-3582c4bc60beb1f8a093c435131d9d93e337a659.tar.bz2 cuberite-3582c4bc60beb1f8a093c435131d9d93e337a659.tar.lz cuberite-3582c4bc60beb1f8a093c435131d9d93e337a659.tar.xz cuberite-3582c4bc60beb1f8a093c435131d9d93e337a659.tar.zst cuberite-3582c4bc60beb1f8a093c435131d9d93e337a659.zip |
Diffstat (limited to 'MCServer/Plugins/Debuggers')
-rw-r--r-- | MCServer/Plugins/Debuggers/Debuggers.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua index 51b3a3a87..60e84c947 100644 --- a/MCServer/Plugins/Debuggers/Debuggers.lua +++ b/MCServer/Plugins/Debuggers/Debuggers.lua @@ -54,6 +54,7 @@ function Initialize(Plugin) PM:BindCommand("/ff", "debuggers", HandleFurnaceFuel, "- Shows how long the currently held item would burn in a furnace"); PM:BindCommand("/sched", "debuggers", HandleSched, "- Schedules a simple countdown using cWorld:ScheduleTask()"); PM:BindCommand("/cs", "debuggers", HandleChunkStay, "- Tests the ChunkStay Lua integration for the specified chunk coords"); + PM:BindCommand("/compo", "debuggers", HandleCompo, "- Tests the cCompositeChat bindings") Plugin:AddWebTab("Debuggers", HandleRequest_Debuggers) Plugin:AddWebTab("StressTest", HandleRequest_StressTest) @@ -1195,3 +1196,25 @@ end + +function HandleCompo(a_Split, a_Player) + -- Send one composite message to self: + local msg = cCompositeChat() + msg:AddTextPart("Hello! ", "b@e") -- bold yellow + msg:AddUrlPart("MCServer", "http://mc-server.org") + msg:AddTextPart(" rules! ") + msg:AddRunCommandPart("Set morning", "/time set 0") + a_Player:SendMessage(msg) + + -- Broadcast another one to the world: + local msg2 = cCompositeChat() + msg2:AddSuggestCommandPart(a_Player:GetName(), "/tell " .. a_Player:GetName() .. " ") + msg2:AddTextPart(" knows how to use cCompositeChat!"); + a_Player:GetWorld():BroadcastChat(msg2) + + return true +end + + + + |