Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias time.next.hr {
- ; $1 (hour offset)
- ; Returns seconds until next hour change if $1 not given, else seconds to hour change + $1 hours,
- var %ctime.mod = $calc( $ctime + 3600 * $1)
- return $calc($int($calc(%ctime.mod / 3600)) * 3600 + 3600 - %ctime.mod)
- }
- alias pink_type {
- ; If there is no active timer for pink_type then announced that timer will start
- if ( !$timer(PT) ) {
- echo -a 04»» !pink typing commenced - will randomly type !pink in 04#outback every hour.
- }
- ; If !pink hasn't been typed this hour or if there is no record of a !pink typed, then message !pink in #outback
- if ( $asctime(ddHH) != %pink_type.hr || !%pink_type.hr ) {
- msg #outback !pink
- msg #outback !squid
- }
- ; Set variable to keep track of when !pink was last messaged
- set %pink_type.hr $asctime(ddHH)
- ; Set timer to run pink_type again at a random time next hour but with safety margin of 2 minutes for time differences
- .timerPT -o 1 $rand($calc($time.next.hr + 120),$calc($time.next.hr + 3600 - 120)) pink_type
- }
- on *:input:#outback: {
- ; If !pink is manually typed then runs pink_type to set script to run the next hour
- if ( $1 == !pink ) {
- set %pink_type.hr $asctime(ddHH)
- pink_type
- }
- }
- on *:join:#outback: {
- ; Starts the !pink type script upon joining #outback, with a random starting time of 0 to 120 seconds.
- if ( $nick == $me ) {
- ; .timerPT_start 1 $rand(0,$iif($time.next.hr > 120,120,$time.next.hr)) pink_type
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement