Quote:
Originally posted by Mick
Just an observation:
Your use of
on 1:text:!massvoice:*:
would indicate usage in other forms other than just text in channel: Agreed?
ie: in a notice perhaps....
yet both returns are in $chan output would it be wise to use
on 1:text:!massvoice:#:
or use
on 1:text:!massvoice *:*:
and change all $chan to $1
which will enable the trigger "!massvoice #channame" in any format
I take it this would work: please advise
|
using $1 would make the channrl name '!massvoice', you would need to use $2 to pick up the second word. also using it this way with 'on 1:text:!massvoice *:*: ' would enable the op of one channel your bot is in to send the command to any other, so it would need to be locked down to either an access list or a control channel.
heres is an exaple of an access list script from radiobot; the 1st section adds a nick to the text file used, notice the initial usernick is hardcoded into the script to prevent unautherised aditions, once people are added, because of the way the script is written, they can add others to the list:
Code:
on 1:text:!addaccess *:*: {
if ($read(conf/access.txt, s, $nick) == true || $nick == McGreff) {
write conf/access.txt $2 true
}
}
next the alias that is used in commands that querys the text file:
Code:
alias isAccess {
if ($read(conf/access.txt, s, $1) == true) {
return true
}
else {
return $null
}
}
and finaly an example of its use:
Code:
on 1:text:radiobot do you need a reboot:#: {
if ($isAccess($nick)) {
msg $chan 6Yes Please $nick
}
}
the above code (taken from radiobot) was written by McGreff
some command triggers have been renamed to preserve the security of RaDiOBoT