egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

simple question about flags

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
darton
Op


Joined: 21 Jan 2006
Posts: 155

PostPosted: Tue Apr 18, 2006 9:21 am    Post subject: simple question about flags Reply with quote

Hello!
My script should only work if the user has at least voice. So what I must change?
Code:
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"
 }
}
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Tue Apr 18, 2006 11:19 am    Post subject: Reply with quote

The following works when $nick is voiced in public_chan:
Code:

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"
   }
 }
}
Back to top
View user's profile Send private message
darton
Op


Joined: 21 Jan 2006
Posts: 155

PostPosted: Tue Apr 18, 2006 11:40 am    Post subject: Reply with quote

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:
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?
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Tue Apr 18, 2006 8:54 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Tue Apr 18, 2006 9:03 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber