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.

commands on action

Old posts that have not been replied to for several years.
Locked
S
Storm
Voice
Posts: 36
Joined: Fri Apr 25, 2003 12:59 am
Location: Vancouver, Canada

commands on action

Post by Storm »

Hey, I'm trying to make a script so the bot will op users on /me op...

Code: Select all

bind CTCP - action act:cmds
proc act:cmds { nick host handle chan keyword text } {
if { $text == "op" } {
putserv "MODE $chan +o $nick"
}
}
So this script works. And how to make it so if I use /me op someonesNickName , the bot will OP that nickname, not me...
Thanks :D !
m
mortician
Voice
Posts: 37
Joined: Sun Sep 22, 2002 6:35 pm
Location: Tsjakamaka
Contact:

Post by mortician »

someonesNickName will also be in the variable $text ..

make a list of $text ( [ split $text ] ) and use lindex ... [lindex $text 0] is the first token (should be op), [lindex $text 1] the second token (the nick ...)
It is a mistake to think you can solve any major problems just with potatoes.
S
Storm
Voice
Posts: 36
Joined: Fri Apr 25, 2003 12:59 am
Location: Vancouver, Canada

Post by Storm »

mortician wrote:someonesNickName will also be in the variable $text ..

make a list of $text ( [ split $text ] ) and use lindex ... [lindex $text 0] is the first token (should be op), [lindex $text 1] the second token (the nick ...)
Hmm... well, could u show the code? :)
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

if {[lindex [split $text] 0] == "op" } {
Once the game is over, the king and the pawn go back in the same box.
S
Storm
Voice
Posts: 36
Joined: Fri Apr 25, 2003 12:59 am
Location: Vancouver, Canada

Post by Storm »

Ok, thanks I'll try it now.
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 CTCP - ACTION act:cmds 

proc act:cmds { nick host handle chan keyword text } { 
if {[lindex [split $text] 0] != "op" || ![botisop $chan]} {
  return
}
set who [lindex [split $text] 1]
if {$who == ""} {
  putserv "MODE $chan +o $nick"
  return
}
if {![onchan $who $chan]} {
  return
}
putserv "MODE $chan +o $who
}
Once the game is over, the king and the pawn go back in the same box.
S
Storm
Voice
Posts: 36
Joined: Fri Apr 25, 2003 12:59 am
Location: Vancouver, Canada

Post by Storm »

Thanks a lot :) !!!
It works :D
Locked