Technically, triggerwords has a single value. It's just a long string with multiple newlines within it. To some extent, it could also be considered a handcrafted list (though this requires caution).
The "pub" binds, or triggers, are matched against individual lines of text from a channel (and only against the first word of the line), so having multiple words or lines will not provide a suitable mask. However, there is nothing preventing you from creating multiple triggers; one for each word of your crafted list.
Something like this should take care of that:
Code: Select all
...
foreach item $triggerwords {
bind pub - $item randaction
}
...
Now, for your proc "randaction";
You try to read the local variable randline, though there exists no such local variable within the proc. I would guess you intended to access the globalspace variable randline instead:
Code: Select all
proc randaction {nick host handle channel text} {
puthelp "PRIVMSG $channel :\001ACTION $::randline\001"
}
This uses the :: fully qualified namespace path to access the variable. You could also use the "global" command to link the localspace variable to the globalspace of the same name though.
I also fixed the order of your parameters to match what the trigger will provide when calling the proc.