View Single Post
Old 11-13-2003, 07:05 PM   #14 (permalink)
RipperRoo
AdMiN oF RoCk!
 
RipperRoo's Avatar
 
Join Date: Mar 2003
Location: uk
Posts: 2,080
RipperRoo is on a distinguished road
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
__________________
PcTechtalk.com Admin
A7V8X xp2600 Barton SLK 97U, GeForce FX 5700, 1GB 2700DDR Ram
Sony DVD -R/+R/RW, SB Live 5.1 Digital, 1 x 30gb 3 x 200GB 2x120GB 1 x 250GB HDD'S, 19" TFT Epson R265
HP NX6125 Laptop 1gb memory

http://www.minotaur-computers.co.uk/
RipperRoo is offline   Reply With Quote