• Hail, we're RedGuides. We want you to play six (yes, 6!) EverQuest characters at once. We have scripts and a friendly community to help, please join our playstyle and say hello! 👋
  • We've added LLM sections to our Terms & Rules and Resource Rules, for everyone's sanity & in-game safety.
    Read more
    a. Do not replace your voice with an LLM. This goes for your posts and your scripts. Drafting and editing with a tool is fine, but don't take you out of what you share.
    b. Do not replace your EQ character's voice with an LLM. We don't want scripts that speak over /ooc, /shout or other public channels. This has been an unwritten rule that's kept casino scripts off the site for decades, but we're now compelled to make it clear: keep automated communication private.

    Why Does RG Review Scripts?
    Nearly every LLM-written Lua script we see is making your character do impossible things, and rarely in a way that's beneficial to you. We've seen heavy server hammering, /target over impossible distances when /nav spawn would passively accomplish the same thing, a spawn search that fires 20+ times per second, and other pointless actions that are likely annoying GMs.

    You are welcome to use LLMs as a tool to structure, draft, and edit your work, but please read critically before hitting /lua run
Resource icon

Broadcast (DanNet or EQBC) 2.0.1

Download
Other Authors
Knightly
Server Type
🏢 Live 🏘️ Emu TLP Test
Source Repository
https://github.com/peonMQ/broadcast


broadcast​

Library to help broadcast important information to all EQBC connected toons, or a single defined toon (driver).

Using the base interface it can also be used to trigger remote commands on remote characaters. See instructions on how to do this here

Heavily inspired by Knightly's 'Write' lua script

Requirements​

  • MQ
  • MQ2Lua
  • Either or both of:
    • MQ2DanNet (Preferred communication method if both are loaded)
    • MQ2EQBC

Installation​

Add broadcast.lua and broadcastinterface.lua to the lua folder of your MQ directory.

Broadcast Usage​

Lua:
local broadcast = require 'broadcast'

-- receviers is either a single string reciever or a table of recievers/channels ie {"Toon1", "Toon2", "Wizards"}
broadcast.Info(receviers, "Information for all")
broadcast.Success(receviers, "We succeded")
broadcast.Fail(receviers, "I failed")
broadcast.Warn(receviers, "Im in trouble")
broadcast.Error(receviers, "Something went horribly wrong")

-- or send to all connected peers
broadcast.InfoAll("Information for all")
broadcast.SuccessAll("We succeded")
broadcast.FailAll("I failed")
broadcast.WarnAll("Im in trouble")
broadcast.ErrorAll("Something went horribly wrong")
Broadcast also handles string formatting for you, so you can use it just like you would string.format:
Lua:
local broadcast = require 'broadcast'
-- Handles string formatting too
broadcast.Success(receviers, "%s successully cast %s", mq.TLO.Me.Name, 'Complete Heal')
broadcast.SuccessAll("%s successully cast %s", mq.TLO.Me.Name, 'Complete Heal')

Default broadcast levels​

broadcast.Info - Standard level of messages. Normal output.

broadcast.Success - Success messages. All went well.

broadcast.Fail - Fail messages. Something didnt complete correctly.

broadcast.Warn - Warn messages. Exectuion completed but something is not right.

broadcast.Error - Error messages. Something went wrong.

Broadcast Configuration Options​

broadcast.usetimestamp - boolean - Add timestamp to the output. Default is false.

broadcast.broadcastLevel - string - The broadcast level at or above which messages start being printed to the console. Default is 'info'.

broadcast.prefix - string or function that returns string - This will appear at the very beginning of the line. The function portion is useful for inserting something like a timestamp. However, the script's name as a string will also suffice and is how it is most often used. Default is empty.

broadcast.separator - string - This is the notation that appears in between the write string and the log entry to be printed. Default is ' :: '

Broadcast level Configuration Options​

Broadcastlevels themselves can be configured as well. The properties for these are broadcast.broadcastlevels['broadcastlevel'].<property> For example, to set the MQ color of trace, you can do: broadcast.broadcastlevels['error'].color = 'Marroon'

Properties are:

level - number - Used for ordering which broadcast levels are "above" or "below" others.

color - table - The color, valid values are 'Black'|'Blue'|'Cyan'|'Green'|'Maroon'|'Orange'|'Red'|'White'|'Yellow'

abbreviation - string - How a particular broadcast level will be abbreviated

Adding or removing broadcast levels​

An example of adding and removing a custom broadcast level is below. Note that the broadcastlevels only support lower case and handle changing to sentence case for calls on their own.

Example:
Lua:
    -- Add the log level (note custom vs Custom)
    broadcast.broadcastlevels.custom = {
        level = 6,
        color = 'Maroon',
        abbreviation = '[CUSTOM]'
    }

    -- Broadcasts at the broadcast level (note Custom vs custom)
    broadcast.CustomAll('Test')
    -- Remove the broadcast level
    logger.broadcastlevels.custom = nil
    -- This should show an error message
    broadcast.CustomAll('Test2')
Setting one of the default broadcast levels to nil will also remove it.

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 ConnectedClients fun(): string[]
---@field ColorWrap fun(self: BroadCastInterface, text: string, color: ColorName): string
---@field ColorCodes table<ColorName, string>
local bci = broadCastInterfaceFactory()


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
Author
Wednesday
Watchers
39
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from Wednesday

Share this resource

Latest updates

  1. Added functionality to run slash commands remotely with DanNet / NetBots abstraction

    BroadcastInterface Usage local broadCastInterfaceFactory = require...
  2. Now supporting both EQBC and DanNet

    Now supporting both EQBC and DanNet DanNet is the preferred method if both are loaded. If none...
  3. Change to github repository download

    Change to github repository download for better change tracking
Back
Top
Cart