All pastes #113454 Raw Edit

Unnamed

public text v1 · immutable
·published 2006-08-03 16:07 UTC
rendered paste body
####Procedure that puts a new line in the file of triggers for the channel where the trigger was written
proc triggers:add { nick chan arg } {
	set triggerlog "triggerlog.txt"
	set file "triggers.txt"
	set write [open $file a]
	if { [string range $arg 0 [expr [string first " " $arg]-1]] == "" || [lrange $arg 1 end] == "" } {
		close $write
		return 0
	}
	puts $write "[string range $arg 0 [expr [string first " " $arg]-1]]#[lrange $arg 1 end]"
	close $write
	puthelp "NOTICE $nick : The trigger [lindex $arg 0] should be added for the channel $chan."
	set tlog [open $triggerlog a]
	puts $tlog "Logger:$nick added a trigger to $chan. ($arg)"
	close $tlog
	putlog "Logger:$nick added a trigger to $chan. ($arg)"
}