View Single Post
Old 05-31-2005, 09:03 AM  
mentality
Junior Member
 
Join Date: May 2005
Posts: 14
Default

Code:
##[FTP_Pre-Command_Events]
##stor		= %TCL ..\scripts\timeframe.itcl %[$flags]

set timeframe		"16-20" ;# from "this hour-to this hour"
set exemptflags	"1 M G" ;# obvious

proc return_hour {} {return [clock format [clock seconds] -format %H]}

proc check_flags {flags exemptflags} {
	foreach flag $exemptflags {
		if {[string match *$flag* $flags]} {
			return 1
		}
	}
	return 0
}

proc check_time {hour timeframe} {
	if {$hour >= [lindex $timeframe 0] && $hour <= [lindex $timeframe 1]} {
		return 1
	}
	return 0
}

if {[check_flags [lindex $args 0] $exemptflags]} {
	return 0
} elseif {[check_time [return_hour] [split $timeframe -]]} {
	iputs "530 No uploading allowed between these hours '$timeframe'!"
	return 1
}
...something like that
mentality is offline   Reply With Quote