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.
Help for those learning Tcl or writing their own scripts.
darton
Op
Posts: 155 Joined: Sat Jan 21, 2006 11:03 am
Post
by darton » Tue Apr 18, 2006 9:21 am
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"
}
}
DragnLord
Owner
Posts: 711 Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA
Post
by DragnLord » Tue Apr 18, 2006 11:19 am
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"
}
}
}
darton
Op
Posts: 155 Joined: Sat Jan 21, 2006 11:03 am
Post
by darton » Tue Apr 18, 2006 11:40 am
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?
Alchera
Revered One
Posts: 3344 Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:
Post
by Alchera » Tue Apr 18, 2006 8:54 pm
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
DragnLord
Owner
Posts: 711 Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA
Post
by DragnLord » Tue Apr 18, 2006 9:03 pm
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.