diff options
Diffstat (limited to '')
-rw-r--r-- | Server/Plugins/Debuggers/Debuggers.lua | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/Server/Plugins/Debuggers/Debuggers.lua b/Server/Plugins/Debuggers/Debuggers.lua index 6397962d9..27440027e 100644 --- a/Server/Plugins/Debuggers/Debuggers.lua +++ b/Server/Plugins/Debuggers/Debuggers.lua @@ -987,6 +987,28 @@ end; +function HandleGetLoreCmd(a_Split, a_Player) + local item = a_Player:GetInventory():GetEquippedItem() + if (not(item.m_Lore) or (item.m_Lore == "")) then + a_Player:SendMessage("The lore is empty") + return true + end + local dispLore = string.gsub(item.m_Lore, ".", + function(a_Char) + if (a_Char < " ") then + return string.byte(a_Char) + end + return a_Char + end + ) + a_Player:SendMessage(string.format("The lore is %d bytes: %s", string.len(item.m_Lore), dispLore)) + return true +end + + + + + function HandleHungerCmd(a_Split, a_Player) a_Player:SendMessage("FoodLevel: " .. a_Player:GetFoodLevel()); a_Player:SendMessage("FoodSaturationLevel: " .. a_Player:GetFoodSaturationLevel()); @@ -1040,6 +1062,32 @@ end +function HandleSetLoreCmd(a_Split, a_Player, a_EntireCmd) + if not(a_Split[2]) then + a_Player:SendMessageFatal("Missing an argument: the lore to set"); + return true + end + local loreToSet = a_EntireCmd:match("/setlore%s(.*)") + if not(loreToSet) then + a_Player:SendMessageFatal("Failed to extract the lore to set") + return true + end + loreToSet = loreToSet:gsub("\\([0-9][0-9][0-9])", string.char) + + local inv = a_Player:GetInventory() + local slotNum = inv:GetEquippedSlotNum() + local item = cItem(inv:GetEquippedItem()) -- Make a copy of the item + local oldLore = item.m_Lore + item.m_Lore = loreToSet + inv:SetHotbarSlot(slotNum, item) + a_Player:SendMessage("Lore set to " .. loreToSet) + return true +end + + + + + function HandleSpideyCmd(a_Split, a_Player) -- Place a line of cobwebs from the player's eyes until non-air block, in the line-of-sight of the player local World = a_Player:GetWorld(); |