This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Using the $botnick as a trigger

Old posts that have not been replied to for several years.
Locked
User avatar
Aron
Halfop
Posts: 86
Joined: Sat Mar 15, 2003 8:35 am

Using the $botnick as a trigger

Post by Aron »

Is there a way to set the public command trigger to $botnick (and a space), without the use of a switch command?

I mean, something like:

bind pub o {$botnick }thecommand theprocess

Tia
The best way to start learning is to start helping.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

bind pub o ${botnick} theprocess

proc theprocess {nick host handle channel text} {
  switch -- [strlwr [lindex $text 0]] {
    "op" {
      # do op
    }
    "deop" {
      # deop thing
    }
  }
}
Once the game is over, the king and the pawn go back in the same box.
User avatar
Aron
Halfop
Posts: 86
Joined: Sat Mar 15, 2003 8:35 am

Post by Aron »

So no way of doing this without switch?

Thanks for the help :)
The best way to start learning is to start helping.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

use

Code: Select all

bind pubm "% ${botnick} command *" proc:name
g
guppy
eggdrop engineer
Posts: 199
Joined: Mon Sep 24, 2001 8:00 pm
Location: Canada
Contact:

Post by guppy »

I wouldn't put $botnick into a bind -- since if your botnick changes, the bind will not. I'd use a pubm instead and check the first argument for being your bot's current nick.
Locked