alias f1 {
;Press F1 to start a timer to start your ads.
;Upon pressing F1 you will be asked to input the duration of the ads
;If you leave it blank (which you can) it will use 180 seconds (3 min) as default.
;You can press F1 again to stop the timer.
if ($timer(twitchads)) timertwitchads off
else {
var %duration $?="Please enter the ad duration"
if ((%duration !isnum) && (%duration != $null)) echo -a Can not start timer, %duration is not a valid number.
else {
var %repeat 0
;Repeat is if you want to limit how many times it does this action, 0 is endless.
var %timer 1800
;Timer is how often you want to do it (in seconds) 1800 is 30min
var %defaultadtime 180
;Default ad time will be 3 minutes, change this if you want to leave it blank upon prompt and still want to use 120 seconds for instance.
var %duration $iif(%duration != $null,$v1,%defaultadtime)
/commercial %duration
;If you don't want it to make an ad right away when you press F1, delete above line.
timertwitchads %repeat %timer /commercial %duration
}
}
}