function SendDialog(btn, item, text)
local bs = bitStream.new()
bs:writeUInt8(215)
bs:writeInt16(2)
bs:writeInt32(0)
bs:writeInt32(16) -- str size
bs:writeString("OnDialogResponse")
bs:writeInt32(8)
bs:writeInt8(100)
bs:writeInt32(0)
bs:writeInt8(100)
bs:writeInt32(btn)
bs:writeInt8(100)
bs:writeInt32(item)
bs:writeInt8(115)
bs:writeInt32(#text)
bs:writeString(text)
bs:sendPacketEx(1, 9, 0)
end
function onRunCommand(cmd)
if cmd:find("!radmirdialog") then
local button, listitem, t3xt = cmd:match("!radmirdialog (%S+) (%S+) (.+)")
SendDialog(button, listitem, t3xt)
print("sent dlg| button: "..button.." listItem:"..listitem.." text: "..t3xt)
return false
end
end