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.

Suspend user access?

Old posts that have not been replied to for several years.
Locked
s
scr0llwheel
Voice
Posts: 17
Joined: Fri Jan 03, 2003 12:37 am

Suspend user access?

Post by scr0llwheel »

I have searched the forums for the last 30 minutes but haven't found what I'm looking for so here goes...

Currently, users have access to specific commands on the bot (that I coded) if they have the C flag. Now, I would like to make a command where I (the owner) can suspend their access without removing the C flag. I was thinking of adding an S flag for their handle but that would get tedious to add a check if they have the S flag for every proc (I could do it but I'm looking for a shorter way :)).

So I was wondering if there is a way to use bind so it only processes if the S flag is NOT on the user's handle? Something like

Code: Select all

bind pub +C-S !blah blahproc
However, that (obviously) doesn't work because the - is used for any user and the + just screws it up :).

Is there *any* way to do it with binds? If not, what would be the shortest way to do it otherwise?

Thanks,
scr0llwheel
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Ask yourself this... could you have just added a matchattr to each proc in the 30 minutes you spent looking? hehe

But this is sort of a neat way to do it if you use "hand" as the handle variable:

Code: Select all

proc check_for_s {} {
  upvar hand hand
  if {[matchattr $hand +S]} {
    return -code return 0
  }
  return 0
}

proc blahproc {nick uhost hand chan text} {
  # just one command, no "if", no "return", no arguments
  check_for_s
  ...
   rest of proc
  ...
}
Locked