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.

Flags or what?

Help for those learning Tcl or writing their own scripts.
Post Reply
C
CyberianIce
Voice
Posts: 12
Joined: Fri Dec 28, 2007 3:21 am

Flags or what?

Post by CyberianIce »

Hi there. I am new in Tcl scripting, and I made script for public commands !op !deop !halfop !dehalfop !voice !devoice. But the script works only for me (I am owner of the bot), no for other ops in the channel. I do not know how to made script wich can be used by other op in channel, no only by me. Using of flag -|- is no a solution, coz then evryone can do !op, or !deop, but flag o|o works only for me...

Does anybody know how to fix that whitout using of access list grabbing?

This is short example of my code:

Code: Select all

###########
# TRIGGER #
###########
bind pub o|o !op op

######
# OP #
######
proc op {nick host hand chan text} {
set target [lindex $text 0]
set target1 [lindex $text 1]
set target2 [lindex $text 2]
if {$target == ""} {
 putserv "MODE $chan +o $nick"
 } else {
 putserv "MODE $chan +ooo $target $target1 $target2"
 }
}

User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

If you add them to the bots userfile. To use the command !op for instance would only require them to have the +o flag for the channel where they need to use the !op command. Other than that, they dont really need any other flags unless you have !voice as +v then people that use !voice will need the +v flag for a channel that they can use !voice on. From the binds its <global flag>|<channel flag> so you can be alot safer if you stick to giving out channel flags only. And you keep the global flags for your self :)
C
CyberianIce
Voice
Posts: 12
Joined: Fri Dec 28, 2007 3:21 am

Post by CyberianIce »

Yeah, I see. But is there any way to do that instead of puting 184 peoples in more over 16 channels in bots userfile?? I want to anybody who have just @ can use !op command, even if he is'nt at any access list or bots userfile....
Image
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Pretty simple :D just use

Code: Select all

bind pub -|- <command> <proc>
for the binds and in the script add at the start of the proc.

Code: Select all

if {![isop $nick $chan]} {return 0}
should only allow people that are oped to use them.
C
CyberianIce
Voice
Posts: 12
Joined: Fri Dec 28, 2007 3:21 am

Post by CyberianIce »

Nice, very nice! It work just fine now! Thank You very much!
Image
Post Reply