MORE randoms
This commit is contained in:
10
Yapper.lua
10
Yapper.lua
@@ -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)
|
||||
|
Reference in New Issue
Block a user