I am unfamiliar with case structures. I tried searching for an example but I didn't have any luck. As far as creating an if statement for Bullseyes, I tried the following but then it always hits bullseye.
<aliases>
<alias
match="throw dart"
enabled="y"
group="darts"
send_to="12"
sequence="100"
>
<send>
-- dart names
local SNUMBERS = {"1", "1", "1", "1", "2", "2", "2", "2", "3", "3", "3", "3", "4", "4", "4", "4", "5", "5", "5", "5", "6", "6", "6", "6", "7", "7", "7", "7", "8", "8", "8", "8", "9", "9", "9", "9", "10", "10", "10", "10", "11", "11", "11", "11", "12", "12", "12", "12", "13", "13", "13", "13", "14", "14", "14", "14", "15", "15", "15", "15", "16", "16", "16", "16", "17", "17", "17", "17", "18", "18", "18", "18", "19", "19", "19", "19", "20", "20", "20", "20", "20", "20", "Bullseye", "Bullseye", "Bullseye"}
local SVALUE = {"Single", "Single", "Single", "Single", "Single", "Single", "Single", "Single", "Single", "Single", "Double", "Double", "Double", "Double", "Double", "Double", "Triple", "Triple", "Triple"}
-- generate the darts
sdarts = {}
for i, snumbers in ipairs (SNUMBERS) do
for j, svalue in ipairs (SVALUE) do
table.insert (sdarts, svalue .. " " .. snumbers)
end -- for each number
end -- for each value
-- shuffle it
require "commas"
shuffle (sdarts)
if snumbers == Bullseye then
Send (" ")
Send ("emote throws a dart at a dartboard...Bullseye")
else
Send ("emote throws a dart at a dartboard. " .. table.remove (sdarts))
end -- if bullseye</send>
</alias>
</aliases>
|