Hope this will help you for now. It only works as you want but in minutes. I dont have time to make the hour/day for now because i dont have time. But i will be back and make it if noone else will make this script.
bind PUB n|n !cycle cycle:pub
proc cycle:pub {nick uhost hand chan arg} {
set target [lindex [split $arg] 0]
set duration [lindex [split $arg] 1]
if {$target == ""} { putserv "PRIVMSG $chan :\002$nick\002 - You didnt set the channel name"; return }
if {[validchan $target]} {
if {$duration != ""} {
putserv "PART $target :i will be back in $duration minutes ;"
channel set $target +inactive
timer $duration [list channel set $target -inactive]
putserv "PRIVMSG $chan :\002$nick\002 - CYCLE for $target complete (ill be back in $duration min)"
} else {
putserv "PRIVMSG $chan :\002$nick\002 - You didnt set the duration (EX: !cycle #channel 5)"
}
} else {
putserv "PRIVMSG $chan :\002$nick\002 - '$target' is not a valid channel"
}
}
In order to get a time format in minutes, hours or days the user would need to add some kind of separator in order to figure out the format is used. The easiest way would be by formatting the duration like 5m for 5 minutes, 2h for two hours and 3d for 3 days for instance.
Just right off the bat I would set a user defined integer flag where would store the time the +inactive would expire (for instance when the command was issued in unix time to that would add the actual duration) combined with either a cron/time bind triggered every 1 second and check for this user defined flag and remove it where is due, or make a cron/time bind exactly on that time and then after it was triggered remove it.
Here's a start that needs just the last part. I'm a bit busy with work and can't test or do continue right now.
I modifyed caesar version to what you wanted as his version had what mine didnt so now it will work with minute/hours/days and if you add only lets say '5' it will be considered minutes.