All pastes #965380 Raw Edit

Something

public text v1 · immutable
#965380 ·published 2008-03-31 23:24 UTC
rendered paste body
### !MODE <chanmode>

proc pub_lol_chan {nick host hand chan mode} {
	if {![botisop $chan]} {return 0}
	set arg [charfilter $mode]
	global lol botnick
	if {![check $hand $nick $host]} {
		if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
                puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
		return 0
	}
	if {[llength $arg] != 1} {
		puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]mode <chanmode>"
		return 0
	}
	if {$lol(chankey) == 1} {
		if {[string first k [lindex $mode 0]] != -1} {
			set posmode [string first k [lindex $mode 0]]
			if {[string first l [lindex $mode 0]] != -1} {
				set poslim [string first l [lindex $mode 0]]
				if {$posmode < $poslim} {
					channel set $chan need-key "chankey $chan [lindex $mode 1]"
				} {
					channel set $chan need-key "chankey $chan [lindex $mode 2]"
				}
			} {
				channel set $chan need-key "chankey $chan [lindex $mode 1]"
			}
		}
	}
	pushmode $chan $mode
	return 0
}