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.

restrict all ! commands to master

Old posts that have not been replied to for several years.
Locked
w
w0lfstar
Voice
Posts: 22
Joined: Fri May 20, 2005 9:26 am

restrict all ! commands to master

Post by w0lfstar »

hello, can someone let me know if its possible to have *all* commands with ! to make only masters to use them in a global way? i have added a validuser check for all procs righr now, but i thought this could be set globally? any help is wanted =)

ps: maybe the global error msg can be set to:

you have to ident yourself to use any command.

wolfy
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Yeah you can,

Code: Select all

bind pub m !command my:proc
OR

Code: Select all

bind pub m "*" my:proc

proc my:proc {nick uhost hand chan text} {
 if {([string length [lindex $text 0]] > 0) && [string equal "!" [lindex $text 0]]} {
 #your stuff here
 }
}
You can also check like this, within a procedure:

Code: Select all

if {[matchattr $hand m|-]} {

#or

if {[matchattr $hand m]} {
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Re: restrict all ! commands to master

Post by Sir_Fz »

w0lfstar wrote:hello, can someone let me know if its possible to have *all* commands with ! to make only masters to use them in a global way? i have added a validuser check for all procs righr now, but i thought this could be set globally? any help is wanted =)

ps: maybe the global error msg can be set to:

you have to ident yourself to use any command.

wolfy
I wrote such a script a month ago, here give it a try.
w
w0lfstar
Voice
Posts: 22
Joined: Fri May 20, 2005 9:26 am

Post by w0lfstar »

hm i meant it like this: user is known by the bot with a working hostmask but user2 is not.

so when user trys any !<cmd> like:

!showsports, !showtv etc

only user can enter *any* ! commands. user2 will always get a error msg like: "you are not allowed to use any ! commands if you arent in my userdatabase with a working hostmask"

thanks =)

wolfy
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Code: Select all

if {![matchattr $hand f|f $chan]} {putquick "notice $nick :I don't like you.";return}
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
w
w0lfstar
Voice
Posts: 22
Joined: Fri May 20, 2005 9:26 am

Post by w0lfstar »

Alchera wrote:

Code: Select all

if {![matchattr $hand f|f $chan]} {putquick "notice $nick :I don't like you.";return}
that is similiar with what i use right now. i just was thinking of an easier way without adding a check to each proc. thanks anyway =)

wolfy
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

there basically isn't
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

you could just have a script rebind everything to appropriate flags. wouldnt get a msg that way though.

here is what i would do

Code: Select all

foreach b [binds pub] {
  if {[string index [join [lindex [split $b] 2]] 0] == "!"} {
    set a [lindex [split $b] end] ; set c [info args $a]
    set d "if {!\[matchattr \$[lindex [info args $a] 2] f|f \$[lindex [info args $a] 3]]} { puthelp \"PRIVMSG \$[lindex [info args $a] 0] :your msg here\" ; return } "
    append d [info body $a]
    proc $a $c $d
  } 
}
unset a b c d
now at the bottom of your conf you'd do
source pubscript1.tcl
source pubscript2.tcl
source thisscript.tcl
source unaffected.tcl
only been through a brief test so bitch out loud if it breaks :wink:

edit: change the flags and msg to whatever's appropriate
photon?
Locked