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.

simple question about flags

Help for those learning Tcl or writing their own scripts.
Post Reply
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

simple question about flags

Post by darton »

Hello!
My script should only work if the user has at least voice. So what I must change?

Code: Select all

bind pub - !msg pub:msg
proc pub:msg {nick uhost hand chan arg} {
global admin_chan
global public_chan
 if {[string equal -nocase $public_chan $chan]} {
  putquick "privmsg $admin_chan :!msg $nick: $arg"
 }
}
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

The following works when $nick is voiced in public_chan:

Code: Select all

proc pub:msg {nick uhost hand chan arg} {
 if {[isvoice $nick $public_chan]} {
  global admin_chan
  global public_chan
   if {[string equal -nocase $public_chan $chan]} {
    putquick "privmsg $admin_chan :!msg $nick: $arg"
   }
 }
}
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

But that script only works if you have voice, but it should work when you have halfop or op, too.
I can do it like this:

Code: Select all

bind pub - !msg pub:msg
proc pub:msg {nick uhost hand chan arg} {
global admin_chan
global public_chan
if {[isvoice $nick $public_chan] || [ishalfop $nick $public_chan] || [isop $nick $public_chan]} { 
 if {[string equal -nocase $public_chan $chan]} {
  putquick "privmsg $admin_chan :!msg $nick: $arg"
  }
 }
}
But is this the easiest way?
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Does it work? If so, then what are you worried about?
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

You asked for help with a script.
The help you got showed you how to help yourself for the rest.
Don't complain about learning how to do something for yourself.
Post Reply