Library to help broadcast important information to all DanNet/EQBC connected toons, or a single defined toon (driver).
Heavily inspired by Knightly's 'Write' lua script
Installation
Add
Broadcast Usage
Setting reciever in config will attempt to send broadcast only to this character:
BroadcastInterface Usage
Heavily inspired by Knightly's 'Write' lua script
Installation
Add
broadcast.lua
and broadcastinterface.lua
to the lua
folder of your MQ directory.Broadcast Usage
Lua:
local broadcast = require('broadcast')
broadcast.Info("Information for all")
broadcast.Success("We succeded")
broadcast.Fail("I failed")
broadcast.Warn("Im in trouble")
broadcast.Error("Something went horribly wrong")
-- Handle string formatting too
broadcast.Success("%s successully cast %s", mq.TLO.Me.Name, 'Complete Heal')
Setting reciever in config will attempt to send broadcast only to this character:
Lua:
local defaultConfig = {
usecolors = true,
usetimestamp = false,
broadcastLevel = 'success',
separator = '::',
reciever = nil -- Used to specify a list of recievers (not broadcast to all), comma separated
}
BroadcastInterface Usage
Lua:
local broadCastInterfaceFactory = require 'broadcast/broadcastinterface'
---@alias ColorName 'Previous'|'Black'|'Blue'|'Cyan'|'Green'|'Maroon'|'Orange'|'Red'|'White'|'Yellow'
---@class BroadCastInterface
---@field Broadcast fun(message: string, recievers?: string[])
---@field ExecuteCommand fun(executeCommand: string, recievers: string[])
---@field ExecuteAllCommand fun(executeCommand: string, includeSelf?: boolean)
---@field ConnecteClients fun(): string[]
---@field ColorWrap fun(self: BroadCastInterface, text: string, color: ColorName): string
---@field ColorCodes table<ColorName, string>
local bci = broadCastInterfaceFactory() -- instatiate a new broadcast interface (requires DanNet or NetBots to be loaded, DanNet is preferred protocol)
local command = string.format('/say %s', "This is triggered remotly")
bci.ExecuteAllCommand(command, true) -- 2nd parameter is to include self and is optional (default false)
bci.ExecuteCommand(command, {"Toon1", "Toon2"}) -- 2nd parameter is a list of toons that should execute the command
- Source Repository
- https://github.com/peonMQ/broadcast