This is a script that will make you more inefficient, but it will also make your characters behave more human like and thereby reducing/removing some of the "benefits" MQ gives that are not "needed" if you are using MQ as disability support software.
This simple Lua will randomize any command you want on a character. Simply run the script and then choose the random amount of time in seconds, you want a character to wait before the command is executed.
Examples for EQBC:
//This will tell all characters in your group to hail an NPC with their own random delay between 0 and 10 seconds.
/bcg //rd 10 /keypress h
//This will tell everyone in your raid to say ready with their own random delay between 0 and 20 seconds.
/bcaa //rd 20 /say ready
[CODE lang="Lua" title="Randomizer.Lua"]local mq = require("mq")
-- Variables for script status and help
local ScriptActive = true
-- Function to convert a string (character name) to a seed number
local function stringToSeed(str)
local seed = 0
for i = 1, #str do
local c = str:byte(i)
seed = seed + c
end
return seed
end
-- Function to execute a command with a random delay up to the specified maximum
local function executeWithRandomDelay(maxDelayInSeconds, command)
-- Generate a random delay between 0 and maxDelayInSeconds
local delayInSeconds = math.random(0, maxDelayInSeconds)
local delayInMilliseconds = delayInSeconds * 1000
mq.delay(delayInMilliseconds)
mq.cmd(command)
end
-- Function to show help text
local function showHelp()
print("Random Delay (/rd) Command Help:")
print("/rd [max delay in seconds] [command] - Executes the specified command after a random delay up to the specified number of seconds.")
print("Example: /rd 10 /cast 1 - This will cast the spell in slot 1 after a random delay of up to 10 seconds.")
print("/rd help - Shows this help text.")
print("/rd active - Toggles the script active or inactive.")
end
-- Function to parse and process input commands
local function processRDCommand(...)
local args = {...}
if not ScriptActive then return end
if args[1] == 'help' then
showHelp()
elseif args[1] == 'active' then
ScriptActive = not ScriptActive
local status = ScriptActive and 'active' or 'inactive'
print(string.format("Random Delay (/rd) script is now %s.", status))
else
local maxDelayInSeconds = tonumber(args[1])
local commandToRun = table.concat(args, " ", 2)
if maxDelayInSeconds and commandToRun and commandToRun ~= "" then
executeWithRandomDelay(maxDelayInSeconds, commandToRun)
else
print("Invalid command format. Type '/rd help' for usage information.")
end
end
end
-- Initialize random seed with character name
local charName = mq.TLO.Me.Name()
math.randomseed(stringToSeed(charName))
-- Binding the /rd command to the processRDCommand function
mq.bind('/rd', processRDCommand)
-- Main loop to keep the script running
while true do
mq.delay(100) -- Small delay to prevent the script from hogging CPU resources
end
[/CODE]
This simple Lua will randomize any command you want on a character. Simply run the script and then choose the random amount of time in seconds, you want a character to wait before the command is executed.
Examples for EQBC:
//This will tell all characters in your group to hail an NPC with their own random delay between 0 and 10 seconds.
/bcg //rd 10 /keypress h
//This will tell everyone in your raid to say ready with their own random delay between 0 and 20 seconds.
/bcaa //rd 20 /say ready
[CODE lang="Lua" title="Randomizer.Lua"]local mq = require("mq")
-- Variables for script status and help
local ScriptActive = true
-- Function to convert a string (character name) to a seed number
local function stringToSeed(str)
local seed = 0
for i = 1, #str do
local c = str:byte(i)
seed = seed + c
end
return seed
end
-- Function to execute a command with a random delay up to the specified maximum
local function executeWithRandomDelay(maxDelayInSeconds, command)
-- Generate a random delay between 0 and maxDelayInSeconds
local delayInSeconds = math.random(0, maxDelayInSeconds)
local delayInMilliseconds = delayInSeconds * 1000
mq.delay(delayInMilliseconds)
mq.cmd(command)
end
-- Function to show help text
local function showHelp()
print("Random Delay (/rd) Command Help:")
print("/rd [max delay in seconds] [command] - Executes the specified command after a random delay up to the specified number of seconds.")
print("Example: /rd 10 /cast 1 - This will cast the spell in slot 1 after a random delay of up to 10 seconds.")
print("/rd help - Shows this help text.")
print("/rd active - Toggles the script active or inactive.")
end
-- Function to parse and process input commands
local function processRDCommand(...)
local args = {...}
if not ScriptActive then return end
if args[1] == 'help' then
showHelp()
elseif args[1] == 'active' then
ScriptActive = not ScriptActive
local status = ScriptActive and 'active' or 'inactive'
print(string.format("Random Delay (/rd) script is now %s.", status))
else
local maxDelayInSeconds = tonumber(args[1])
local commandToRun = table.concat(args, " ", 2)
if maxDelayInSeconds and commandToRun and commandToRun ~= "" then
executeWithRandomDelay(maxDelayInSeconds, commandToRun)
else
print("Invalid command format. Type '/rd help' for usage information.")
end
end
end
-- Initialize random seed with character name
local charName = mq.TLO.Me.Name()
math.randomseed(stringToSeed(charName))
-- Binding the /rd command to the processRDCommand function
mq.bind('/rd', processRDCommand)
-- Main loop to keep the script running
while true do
mq.delay(100) -- Small delay to prevent the script from hogging CPU resources
end
[/CODE]
Last edited:

