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.

command in .tcl to exclude ops

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
DrTongue
Op
Posts: 115
Joined: Sat Jan 26, 2002 8:00 pm
Location: Orlando, Florida
Contact:

command in .tcl to exclude ops

Post by DrTongue »

I have a .tcl that when someone in the channel private messages the bot, the bot itself says in channel:

"<nick> You were asked not to private message anyone when you entered."

The problem is when someone does it who is an op and they use /msg to op or IDENT or whatever, they receive this warning. I am trying to get the bot to reconize if this person has the +o flag to NOT give the channel message. I was trying:

if {([matchattr $hand o|o $chan])} {
return 0
}

But it's not working. Any suggestions?
Thanks!
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

There's no chan attribute in a msg or msgm bind.
User avatar
DrTongue
Op
Posts: 115
Joined: Sat Jan 26, 2002 8:00 pm
Location: Orlando, Florida
Contact:

Post by DrTongue »

So:

if {([matchattr $hand o|o])} {
return 0
}

???

And would $nick or nick be what I should use instead of $hand?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

No that's incorrect, show us your code so we could help you.
User avatar
DrTongue
Op
Posts: 115
Joined: Sat Jan 26, 2002 8:00 pm
Location: Orlando, Florida
Contact:

Post by DrTongue »

Ok sorry....here is the script itself that makes the bot respond with a message in the channel:

bind msgm - "*" proc:laina
#seting respondiendo el Privado
set chan "#channel"
proc proc:laina {nick uhost hand arg} {
global chan
set line [string trim $arg]
if {$nick == "SeenServ"} {
puthelp "privmsg $chan : $nick You were asked NO private messages PLEASE' when you entered, thank you."
return 0
}

puthelp "privmsg $chan : $nick You were asked NO private messages PLEASE' when you entered, thank you."

}
return 0
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

bind msgm - "*" proc:laina
#seting respondiendo el Privado
set chan "#channel"
proc proc:laina {nick uhost hand arg} {
 global chan
 set line [string trim $arg]
 if {$nick == "SeenServ"} {
  puthelp "privmsg $chan : $nick You were asked NO private messages PLEASE' when you entered, thank you."
  return 0
 }
 if {[matchattr $hand o|o $chan]} { return 0 }
 puthelp "privmsg $chan : $nick You were asked NO private messages PLEASE' when you entered, thank you."
}
User avatar
DrTongue
Op
Posts: 115
Joined: Sat Jan 26, 2002 8:00 pm
Location: Orlando, Florida
Contact:

Post by DrTongue »

Thank you Sir! Works like a charm! :D
Post Reply