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.

[SOLVED] Restrictions To See help manu

Help for those learning Tcl or writing their own scripts.
Post Reply
i
illusionist
Voice
Posts: 25
Joined: Mon Mar 09, 2020 11:22 am

[SOLVED] Restrictions To See help manu

Post by illusionist »

Hello everyone one i have a short help menu script i want to add some restrictions to see help menu..
Owner commands for n flag user only
Master commands for m flag user only..
Etc
Here is the code

Code: Select all

set jCrX "~"
#★★★★★#
#    HeLp    #
#★★★★★#

#BinDs
bind pub o|o ${jCrX}cmdhelp pub_cmdhelp
bind msg o|o cmdhelp msg_cmdhelp
#End

#Help Process#
proc msg_cmdhelp {nick host hand text} {
global botnick
set htext [lindex $text 0]
if {$htext == "partyline"} {
puthelp "NOTICE $nick :reload, save, backup, chandle +ignore, -ignore, ignorelist, +user, -user, +host, -host, chattr, info, userinfo, userlist, chanlist"
} esleif {$htext == "owner"} {
puthelp "NOTICE $nick :\00302~join, part, cycle, mop, mdeop, v*, dv*, mkick, ${jCrX}+gban, -gban, lock, unlock, mode, up, down, op, deop, voice, devoice, kick, +ban, -ban, bans, rb, invite"
} elseif {$htext == "master"} {
puthelp "NOTICE $nick :\00302~mop, mdeop, v*, dv*, +gban, -gban, lock, unlock, mode, up, down, op, deop, voice, devoice, kick, +ban, -ban, bans, rb, invite"
} elseif {$htext == "op"} {
puthelp "NOTICE $nick :\00302~lock, unlock, mode, up, down, op, deop, voice, devoice, kick, +ban, -ban, bans, rb, invite"
} else {
puthelp "NOTICE $nick :\00307\037***\017\00304\u2620\017 \[\00303\002\u275d\00302\u2c7c\u2090\u0064\u1d64\u0067\u2090\u1d63\u2099\u1d62\00304\037\u262a\037\00302\u1d63\u2091\u2090\u209c\u1d62\u2134\u2099\00303\u275e\017\] \00304\u2620\017\00307\037***"
puthelp "NOTICE $nick :\[\002\00303\u275d\00302\u2c7c\00304\037\u262a\00303\037\u275e\017\] \00302/msg $botnick cmdhelp \002<owner/master/op>"
  }
}

proc pub_cmdhelp {nick host hand chan text} {
global jCrX botnick
set htext [lindex $text 0]
if {$htext == "partyline"} {
puthelp "NOTICE $nick :\00302${jCrX}reload, ${jCrX}save, ${jCrX}backup, ${jCrX}chandle +ignore, ${jCrX}-ignore, ${jCrX}ignorelist, ${jCrX}+user, ${jCrX}-user, ${jCrX}+host, ${jCrX}-host, ${jCrX}chattr, ${jCrX}info, ${jCrX}userinfo, ${jCrX}userlist, ${jCrX}chanlist"
} elseif {$htext == "owner"} {
puthelp "NOTICE $nick :\00302${jCrX}join, ${jCrX}part, ${jCrX}cycle, ${jCrX}mop, ${jCrX}mdeop, ${jCrX}v*, ${jCrX}dv*, ${jCrX}mkick, ${jCrX}+gban, ${jCrX}-gban, ${jCrX}lock, ${jCrX}unlock, ${jCrX}mode, ${jCrX}up, ${jCrX}down, ${jCrX}op, ${jCrX}deop, ${jCrX}voice, ${jCrX}devoice, ${jCrX}kick, ${jCrX}+ban, ${jCrX}-ban, ${jCrX}bans, ${jCrX}rb, ${jCrX}invite"
} elseif {$htext == "master"} {
puthelp "NOTICE $nick :\00302${jCrX}mop, ${jCrX}mdeop, ${jCrX}v*, ${jCrX}dv*, ${jCrX}+gban, ${jCrX}-gban, ${jCrX}lock, ${jCrX}unlock, ${jCrX}mode, ${jCrX}up, ${jCrX}down, ${jCrX}op, ${jCrX}deop, ${jCrX}voice, ${jCrX}devoice, ${jCrX}kick, ${jCrX}+ban, ${jCrX}-ban, ${jCrX}bans, ${jCrX}rb, ${jCrX}invite"
} elseif {$htext == "op"} {
puthelp "NOTICE $nick :\00302${jCrX}lock, ${jCrX}unlock, ${jCrX}mode, ${jCrX}up, ${jCrX}down, ${jCrX}op, ${jCrX}deop, ${jCrX}voice, ${jCrX}devoice, ${jCrX}kick, ${jCrX}+ban, ${jCrX}-ban, ${jCrX}bans, ${jCrX}rb, ${jCrX}invite"
} else {
puthelp "NOTICE $nick :\00307\037***\017\00304\u2620\017 \[\00303\002\u275d\00302\u2c7c\u2090\u0064\u1d64\u0067\u2090\u1d63\u2099\u1d62\00304\037\u262a\037\00302\u1d63\u2091\u2090\u209c\u1d62\u2134\u2099\00303\u275e\017\] \00304\u2620\017\00307\037***"
puthelp "NOTICE $nick :\[\002\00303\u275d\00302\u2c7c\00304\037\u262a\00303\037\u275e\017\] \00302/msg $botnick cmdhelp \002<owner/master/op>"
  }
}
##########End Help###########
	putlog "***Commands & Control, Channel Control. Loaded."

# End of - Commands & Control, Channel Control. (cmd_chan.tcl)
Really appreciated if someone help me in this regard. Thanks
Last edited by illusionist on Wed Jul 15, 2020 10:37 pm, edited 1 time in total.
User avatar
CrazyCat
Revered One
Posts: 1305
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Peharps you can try to find by yourself...

Here is a short way to do what you want, I let you try to understand the modifications.

Code: Select all

set jCrX "~"
#★★★★★#
#    HeLp    #
#★★★★★#

#BinDs
bind pub o|o ${jCrX}cmdhelp pub_cmdhelp
bind msg o|o cmdhelp msg_cmdhelp
#End

#Help Process#
proc msg_cmdhelp {nick host hand text} {
	set htext [lindex $text 0]
	if {$htext == "partyline" && [matchattr $hand +p]} {
		puthelp "NOTICE $nick :reload, save, backup, chandle +ignore, -ignore, ignorelist, +user, -user, +host, -host, chattr, info, userinfo, userlist, chanlist"
	} elseif {$htext == "owner" && [matchattr $hand +n]} {
		puthelp "NOTICE $nick :\00302~join, part, cycle, mop, mdeop, v*, dv*, mkick, ${jCrX}+gban, -gban, lock, unlock, mode, up, down, op, deop, voice, devoice, kick, +ban, -ban, bans, rb, invite"
	} elseif {$htext == "master" && [matchattr $hand +mn]} {
		puthelp "NOTICE $nick :\00302~mop, mdeop, v*, dv*, +gban, -gban, lock, unlock, mode, up, down, op, deop, voice, devoice, kick, +ban, -ban, bans, rb, invite"
	} elseif {$htext == "op" && [matchattr $hand +mno]} {
		puthelp "NOTICE $nick :\00302~lock, unlock, mode, up, down, op, deop, voice, devoice, kick, +ban, -ban, bans, rb, invite"
	} else {
		puthelp "NOTICE $nick :\00307\037***\017\00304\u2620\017 \[\00303\002\u275d\00302\u2c7c\u2090\u0064\u1d64\u0067\u2090\u1d63\u2099\u1d62\00304\037\u262a\037\00302\u1d63\u2091\u2090\u209c\u1d62\u2134\u2099\00303\u275e\017\] \00304\u2620\017\00307\037***"
		puthelp "NOTICE $nick :\[\002\00303\u275d\00302\u2c7c\00304\037\u262a\00303\037\u275e\017\] \00302/msg $::botnick cmdhelp \002<owner/master/op>"
	}
}

proc pub_cmdhelp {nick host hand chan text} {
	set htext [lindex $text 0]
	if {$htext == "partyline" && [matchattr $hand +p]} {
		puthelp "NOTICE $nick :\00302${jCrX}reload, ${jCrX}save, ${jCrX}backup, ${jCrX}chandle +ignore, ${jCrX}-ignore, ${jCrX}ignorelist, ${jCrX}+user, ${jCrX}-user, ${jCrX}+host, ${jCrX}-host, ${jCrX}chattr, ${jCrX}info, ${jCrX}userinfo, ${jCrX}userlist, ${jCrX}chanlist"
	} elseif {$htext == "owner" && [matchattr $hand +n]} {
		puthelp "NOTICE $nick :\00302${jCrX}join, ${jCrX}part, ${jCrX}cycle, ${jCrX}mop, ${jCrX}mdeop, ${jCrX}v*, ${jCrX}dv*, ${jCrX}mkick, ${jCrX}+gban, ${jCrX}-gban, ${jCrX}lock, ${jCrX}unlock, ${jCrX}mode, ${jCrX}up, ${jCrX}down, ${jCrX}op, ${jCrX}deop, ${jCrX}voice, ${jCrX}devoice, ${jCrX}kick, ${jCrX}+ban, ${jCrX}-ban, ${jCrX}bans, ${jCrX}rb, ${jCrX}invite"
	} elseif {$htext == "master" && [matchattr $hand +mn]} {
		puthelp "NOTICE $nick :\00302${jCrX}mop, ${jCrX}mdeop, ${jCrX}v*, ${jCrX}dv*, ${jCrX}+gban, ${jCrX}-gban, ${jCrX}lock, ${jCrX}unlock, ${jCrX}mode, ${jCrX}up, ${jCrX}down, ${jCrX}op, ${jCrX}deop, ${jCrX}voice, ${jCrX}devoice, ${jCrX}kick, ${jCrX}+ban, ${jCrX}-ban, ${jCrX}bans, ${jCrX}rb, ${jCrX}invite"
	} elseif {$htext == "op" && [matchattr $hand +mno]} {
		puthelp "NOTICE $nick :\00302${jCrX}lock, ${jCrX}unlock, ${jCrX}mode, ${jCrX}up, ${jCrX}down, ${jCrX}op, ${jCrX}deop, ${jCrX}voice, ${jCrX}devoice, ${jCrX}kick, ${jCrX}+ban, ${jCrX}-ban, ${jCrX}bans, ${jCrX}rb, ${jCrX}invite"
	} else {
		puthelp "NOTICE $nick :\00307\037***\017\00304\u2620\017 \[\00303\002\u275d\00302\u2c7c\u2090\u0064\u1d64\u0067\u2090\u1d63\u2099\u1d62\00304\037\u262a\037\00302\u1d63\u2091\u2090\u209c\u1d62\u2134\u2099\00303\u275e\017\] \00304\u2620\017\00307\037***"
		puthelp "NOTICE $nick :\[\002\00303\u275d\00302\u2c7c\00304\037\u262a\00303\037\u275e\017\] \00302/msg $::botnick cmdhelp \002<owner/master/op>"
	}
}
##########End Help###########
   putlog "***Commands & Control, Channel Control. Loaded."

# End of - Commands & Control, Channel Control. (cmd_chan.tcl)
Tip: matchattr is the key
i
illusionist
Voice
Posts: 25
Joined: Mon Mar 09, 2020 11:22 am

Post by illusionist »

ThanKs Dear CraZyCat You have provided better guidance۔۔ with lil change its working fine Thanks
Post Reply