All pastes #2428 Raw Edit

lightwizard420

public text v1 · immutable
#2428 ·published 2004-11-27 22:46 UTC
rendered paste body
on *:TEXT:!reminder:*: {
  notice $nick To set reminders use the following format:
  notice $nick !reminder [numerical value] [unit of time] [message]
}

on *:TEXT:!reminder *:*: {
  if ($2 !isnum) {
    notice $nick  $+ $2  $+ is an invalid numerical value.
  }
  else {
    if (($3 != second) && ($3 != seconds) && ($3 != minute) && ($3 != minutes) && ($3 != hour) && ($3 != hours) && ($3 != day) && ($3 != days) && ($3 != week) && ($3 != weeks) && ($3 != year) && ($3 != years)) {
      /notice $nick  $+ $3  $+ is an invalid unit of time.   
    }
    else {
      if ($4 !isalnum) {
        notice $nick reminder requires more parameters.
      }
      else {
        inc %x
        set %timer [ $+ [ %x ] ] on
        set -n %timerr [ $+ [ %x ] ] $4-
        if ($nick == %9-11light) {
          set -n %timern [ $+ [ %x ] ] lightwizard420
          if (($3 === second) || ($3 === seconds)) {
            set -n %timer [ $+ [ %x ] ] on
            set %timert [ $+ [ %x ] ] $2
            set %timerd [ $+ [ %x ] ] $calc($ctime + %timert [ $+ [ %x ] ] )
            notice $nick You will be reminded  $+ %timerr [ $+ [ %x ] ] $+  at  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), HH:nn:ss zzz)) $+  on  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), yyyy-mm-dd) $+ .
            /timer [ $+ [ %x ] ] $+ a 1 %timert [ $+ [ %x ] ] /query %timern [ $+ [ %x ] ] %timerr [ $+ [ %x ] ]
            /timer [ $+ [ %x ] ] $+ b 1 %timert [ $+ [ %x ] ] /unset %timer [ $+ [ %x ] ]
          }
          elseif (($3 === minute) || ($3 === minutes)) {
            set %timert [ $+ [ %x ] ] $calc($2 * 60)
            set -n %timer [ $+ [ %x ] ] on
            set %timerd [ $+ [ %x ] ] $calc($ctime + %timert [ $+ [ %x ] ] )
            notice $nick You will be reminded  $+ %timerr [ $+ [ %x ] ] $+  at  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), HH:nn:ss zzz)) $+  on  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), yyyy-mm-dd) $+ .
            /timer [ $+ [ %x ] ] $+ a 1 %timert [ $+ [ %x ] ] /query %timern [ $+ [ %x ] ] %timerr [ $+ [ %x ] ]
            /timer [ $+ [ %x ] ] $+ b 1 %timert [ $+ [ %x ] ] /unset %timer [ $+ [ %x ] ]
          }
          elseif (($3 === hour) || ($3 === hours)) {
            set %timert [ $+ [ %x ] ] $calc($2 * 3600)
            set -n %timer [ $+ [ %x ] ] on
            set %timerd [ $+ [ %x ] ] $calc($ctime + %timert [ $+ [ %x ] ] )
            notice $nick You will be reminded  $+ %timerr [ $+ [ %x ] ] $+  at  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), HH:nn:ss zzz)) $+  on  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), yyyy-mm-dd) $+ .
            /timer [ $+ [ %x ] ] $+ a 1 %timert [ $+ [ %x ] ] /query %timern [ $+ [ %x ] ] %timerr [ $+ [ %x ] ]
            /timer [ $+ [ %x ] ] $+ b 1 %timert [ $+ [ %x ] ] /unset %timer [ $+ [ %x ] ]
          }
          elseif (($3 === day) || ($3 === days)) {
            set %timert [ $+ [ %x ] ] $calc($2 * 86400)
            set -n %timer [ $+ [ %x ] ] on
            set %timerd [ $+ [ %x ] ] $calc($ctime + %timert [ $+ [ %x ] ] )
            notice $nick You will be reminded  $+ %timerr [ $+ [ %x ] ] $+  at  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), HH:nn:ss zzz)) $+  on  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), yyyy-mm-dd) $+ .
            /timer [ $+ [ %x ] ] $+ a 1 %timert [ $+ [ %x ] ] /query %timern [ $+ [ %x ] ] %timerr [ $+ [ %x ] ]
            /timer [ $+ [ %x ] ] $+ b 1 %timert [ $+ [ %x ] ] /unset %timer [ $+ [ %x ] ]
          }
          elseif (($3 === week) || ($3 === weeks)) {
            set %timert [ $+ [ %x ] ] $calc($2 * 604800)
            set -n %timer [ $+ [ %x ] ] on
            set %timerd [ $+ [ %x ] ] $calc($ctime + %timert [ $+ [ %x ] ] )
            notice $nick You will be reminded  $+ %timerr [ $+ [ %x ] ] $+  at  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), HH:nn:ss zzz)) $+  on  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), yyyy-mm-dd) $+ .
            /timer [ $+ [ %x ] ] $+ a 1 %timert [ $+ [ %x ] ] /query %timern [ $+ [ %x ] ] %timerr [ $+ [ %x ] ]
            /timer [ $+ [ %x ] ] $+ b 1 %timert [ $+ [ %x ] ] /unset %timer [ $+ [ %x ] ]
          }
          elseif (($3 === year) || ($3 === years)) {
            set %timert [ $+ [ %x ] ] $calc($2 * 31556926)
            set -n %timer [ $+ [ %x ] ] on
            set %timerd [ $+ [ %x ] ] $calc($ctime + %timert [ $+ [ %x ] ] )
            notice $nick You will be reminded  $+ %timerr [ $+ [ %x ] ] $+  at  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), HH:nn:ss zzz)) $+  on  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), yyyy-mm-dd) $+ .
            /timer [ $+ [ %x ] ] $+ a 1 %timert [ $+ [ %x ] ] /query %timern [ $+ [ %x ] ] %timerr [ $+ [ %x ] ]
            /timer [ $+ [ %x ] ] $+ b 1 %timert [ $+ [ %x ] ] /unset %timer [ $+ [ %x ] ]
          }
          else {
            /notice $nick  $+ $3  $+ is an invalid unit of time.
          }
        }
        else {
          set -n %timern [ $+ [ %x ] ] $nick
          if (($3 == second) || ($3 == seconds) || ($3 == sec)) {
            set -n %timer [ $+ [ %x ] ] on
            set %timert [ $+ [ %x ] ] $2
            set %timerd [ $+ [ %x ] ] $calc($ctime + %timert [ $+ [ %x ] ] )
            notice $nick You will be reminded  $+ %timerr [ $+ [ %x ] ] $+  at  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), HH:nn:ss zzz)) $+  on  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), yyyy-mm-dd) $+ .
            /timer [ $+ [ %x ] ] $+ a 1 %timert [ $+ [ %x ] ] /query %timern [ $+ [ %x ] ] %timerr [ $+ [ %x ] ]
            /timer [ $+ [ %x ] ] $+ b 1 %timert [ $+ [ %x ] ] /unset %timer [ $+ [ %x ] ]
          }
          elseif (($3 == minute) || ($3 == minutes) || ($3 == min)) {
            set %timert [ $+ [ %x ] ] $calc($2 * 60)
            set -n %timer [ $+ [ %x ] ] on
            set %timerd [ $+ [ %x ] ] $calc($ctime + %timert [ $+ [ %x ] ] )
            notice $nick You will be reminded  $+ %timerr [ $+ [ %x ] ] $+  at  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), HH:nn:ss zzz)) $+  on  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), yyyy-mm-dd) $+ .
            /timer [ $+ [ %x ] ] $+ a 1 %timert [ $+ [ %x ] ] /query %timern [ $+ [ %x ] ] %timerr [ $+ [ %x ] ]
            /timer [ $+ [ %x ] ] $+ b 1 %timert [ $+ [ %x ] ] /unset %timer [ $+ [ %x ] ]
          }
          elseif (($3 == hour) || ($3 == hours) || ($3 == hr)) {
            set %timert [ $+ [ %x ] ] $calc($2 * 3600)
            set -n %timer [ $+ [ %x ] ] on
            set %timerd [ $+ [ %x ] ] $calc($ctime + %timert [ $+ [ %x ] ] )
            notice $nick You will be reminded  $+ %timerr [ $+ [ %x ] ] $+  at  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), HH:nn:ss zzz)) $+  on  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), yyyy-mm-dd) $+ .
            /timer [ $+ [ %x ] ] $+ a 1 %timert [ $+ [ %x ] ] /query %timern [ $+ [ %x ] ] %timerr [ $+ [ %x ] ]
            /timer [ $+ [ %x ] ] $+ b 1 %timert [ $+ [ %x ] ] /unset %timer [ $+ [ %x ] ]
          }
          elseif (($3 == day) || ($3 == days)) {
            set %timert [ $+ [ %x ] ] $calc($2 * 86400)
            set -n %timer [ $+ [ %x ] ] on
            set %timerd [ $+ [ %x ] ] $calc($ctime + %timert [ $+ [ %x ] ] )
            notice $nick You will be reminded  $+ %timerr [ $+ [ %x ] ] $+  at  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), HH:nn:ss zzz)) $+  on  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), yyyy-mm-dd) $+ .
            /timer [ $+ [ %x ] ] $+ a 1 %timert [ $+ [ %x ] ] /query %timern [ $+ [ %x ] ] %timerr [ $+ [ %x ] ]
            /timer [ $+ [ %x ] ] $+ b 1 %timert [ $+ [ %x ] ] /unset %timer [ $+ [ %x ] ]
          }
          elseif (($3 == week) || ($3 == weeks)) {
            set %timert [ $+ [ %x ] ] $calc($2 * 604800)
            set -n %timer [ $+ [ %x ] ] on
            set %timerd [ $+ [ %x ] ] $calc($ctime + %timert [ $+ [ %x ] ] )
            notice $nick You will be reminded  $+ %timerr [ $+ [ %x ] ] $+  at  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), HH:nn:ss zzz)) $+  on  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), yyyy-mm-dd) $+ .
            /timer [ $+ [ %x ] ] $+ a 1 %timert [ $+ [ %x ] ] /query %timern [ $+ [ %x ] ] %timerr [ $+ [ %x ] ]
            /timer [ $+ [ %x ] ] $+ b 1 %timert [ $+ [ %x ] ] /unset %timer [ $+ [ %x ] ]
          }
          elseif (($3 == year) || ($3 == years)) {
            set %timert [ $+ [ %x ] ] $calc($2 * 31556926)
            set -n %timer [ $+ [ %x ] ] on
            set %timerd [ $+ [ %x ] ] $calc($ctime + %timert [ $+ [ %x ] ] )
            notice $nick You will be reminded  $+ %timerr [ $+ [ %x ] ] $+  at  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), HH:nn:ss zzz)) $+  on  $+ $asctime($calc($ctime + %timert [ $+ [ %x ] ] ), yyyy-mm-dd) $+ .
            /timer [ $+ [ %x ] ] $+ a 1 %timert [ $+ [ %x ] ] /query %timern [ $+ [ %x ] ] %timerr [ $+ [ %x ] ]
            /timer [ $+ [ %x ] ] $+ b 1 %timert [ $+ [ %x ] ] /unset %timer [ $+ [ %x ] ]
          }
        }
      }
    }
  }
}