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.

modified partyline access/restrictions

Old posts that have not been replied to for several years.
Locked
User avatar
z_one
Master
Posts: 269
Joined: Mon Jan 14, 2002 8:00 pm
Location: Canada

modified partyline access/restrictions

Post by z_one »

Hi,

Is there a way to make someone have access to the partyline but forbid them from using and bot command such as .dump or .kick or .+ban etc...
I just want them to be able to use the .op command only

Thanks
User avatar
Rusher2K
Halfop
Posts: 88
Joined: Fri Apr 18, 2003 10:45 am
Location: Germany
Contact:

Post by Rusher2K »

Unbind the dcc command .op and add a new flag then wrote your own .op script that checks the flag you have added if the user has the flag its op him.
:wink:
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Test this:

Code: Select all

# What users (theyr handle) to be allowed to use the commands?
set allowed "bla foo bar" 

bind filt - ".dump *" dcc:allow
bind filt - ".kick *" dcc:allow
bind filt - ".+ban *" dcc:allow

proc dcc:allow {idx args} { 
  global allowed 
  set usernick [idx2hand $idx]
  if {[lindex $args 1] == ""} { 
    set icmd [lindex $args 0]
    set args "$icmd "
  }
  if {[lsearch -exact [string tolower $allowed] [string tolower $usernick]] == -1} {
    putdcc $idx "What? You need '.help'"
    } else {
    return $args
  }
}
Once the game is over, the king and the pawn go back in the same box.
User avatar
z_one
Master
Posts: 269
Joined: Mon Jan 14, 2002 8:00 pm
Location: Canada

Post by z_one »

caesar, say I want to control the .kick to stop it (just like u can stop the default eggdrop flud actions if you make the proc return 0).

I read the following about FILT
FILT (stackable)
bind filt <flags> <mask> <proc>
procname <idx> <text>

Description: party line and file system users have their text sent
through filt before being processed. If the proc returns a blank
string, the text is considered parsed. Otherwise, the bot will use
the text returned from the proc and continue parsing that
So will the following code stop anyone from using .kick. If it doesn't then what would be the code to stop anyone from using a .kick from the partyline?

Code: Select all

bind filt - ".kick *" dcc:allow 

proc dcc:allow {idx args} { 
  return ""
}
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

'unbind' is the way to go if you want to disable a command. If you want to change the flag(s) required, just create the bind with different flags. :wink:
Have you ever read "The Manual"?
User avatar
z_one
Master
Posts: 269
Joined: Mon Jan 14, 2002 8:00 pm
Location: Canada

Post by z_one »

user wrote:
If you want to change the flag(s) required, just create the bind with different flags
So if I bind .kick to the owner flag like that:

Code: Select all

bind filt n|n ".kick *" dcc:allow


It would only allow the owner to use .kick ? Do I have to unbind first then bind it to owners only ?

Thanks for everyone who has helped/is helping in this thread.
User avatar
gumbydammit
Master
Posts: 311
Joined: Thu Sep 05, 2002 4:52 pm
Location: Canada
Contact:

Post by gumbydammit »

unbind dcc lo|lo kick *dcc:kick
bind dcc n|n kick *dcc:kick
a.k.a. hellios
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

In the code I've previously posted just add your handle in the allowed variable. Doing this only the handles that are added in the allowd variable can do the dcc commands you've binded.
Once the game is over, the king and the pawn go back in the same box.
User avatar
z_one
Master
Posts: 269
Joined: Mon Jan 14, 2002 8:00 pm
Location: Canada

Post by z_one »

Caesar, done.
Works like charm. :)

Thanks a million.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Heh, you'r welcome. Feel free to change anything you want in it. :)
Once the game is over, the king and the pawn go back in the same box.
User avatar
z_one
Master
Posts: 269
Joined: Mon Jan 14, 2002 8:00 pm
Location: Canada

Post by z_one »

caesar, I was reviewing all eggdrop commands to see which ones I want to stop (using the code you showed me) and I found out this in the tricks file that ships with Eggdrop:
Tcl has a command 'info body <proc>' that will list the contents of a proc.
Now, if I get this right it means that someone who has access to my bot's partyline can somehow display the code inside a procedure that I wrote and then steal it ?
If yes, how to stop this ?
I tried the command .info body myprocname and to my surprise, it said "your info is now myprocname" ! I must be doing something wrong here or using the wrong command
User avatar
gumbydammit
Master
Posts: 311
Joined: Thu Sep 05, 2002 4:52 pm
Location: Canada
Contact:

Post by gumbydammit »

you did .info ( see .help info )
the command you stated is a .tcl command
so they need +n to use it, if it is even binded ( its not by default) and depending on your must-be-owner setting they may even need to be perm owner in the conf to use it
a.k.a. hellios
User avatar
z_one
Master
Posts: 269
Joined: Mon Jan 14, 2002 8:00 pm
Location: Canada

Post by z_one »

Yep! My mistake, I forgot to use .tcl before the command :-?
Anyway it's a relief to know it only works for owners (as I am the only owner). :)
Locked