MORE randoms

This commit is contained in:
2024-12-15 01:45:03 +01:00
parent 6b3d584f98
commit f5c1dcd3c5

View File

@@ -1,6 +1,7 @@
local addonname, data = ...
---@cast addonname string
local channelNameLength = 8
local channelNameLengthLowerBound = 5
local channelNameLengthUpperBound = 33
local messageLengthLowerBound = 12
local messageLengthUpperBound = 47
local lowerBound = 53
@@ -27,17 +28,18 @@ local function GenerateString(length)
end
return string
end
local channelName = GenerateString(channelNameLength)
local channelName = GenerateString(math.random(channelNameLengthLowerBound, channelNameLengthUpperBound))
local function Yap()
local message = GenerateString(math.random(messageLengthLowerBound, messageLengthUpperBound))
print(string.format("YAPPING %s", tostring(message)))
print(string.format("Yapping %s", tostring(message)))
local channelId = GetChannelId(channelName)
if channelId ~= nil then
SendChatMessage(message, "CHANNEL", nil, channelId)
else
print(string.format("Channel %s not found", channelName))
print(string.format("Channel %s not found, trying to join again...", channelName))
JoinTemporaryChannel(channelName)
end
local delay = math.random(lowerBound, upperBound)