Simplified version of it:
Code:
on *:input:#:if ($1- == Good morning) set -eu1800 %last_good_morning $ctime

alias last_good_morning echo $iif(%last_good_morning,You said it $duration($calc($ctime -$v1)) ago at $asctime($v1,HH:nn:ss) $+ .,You haven't said it in the last 30 minutes.)



EDIT:
Since I'm bored, I might as well do this:
Code:
;Input event that specifically triggers when you say something in a channel.
on *:input:#: {

  ;Check if the input matches the trigger (change the operator from "==" to "===" if you want it to be case sensitive).
  ;If you want, you could add checks here for $comchar & $ctrlenter.
  ;$comchar to check if the line is a command or not.
  ;$ctrlenter to check if it was sent by pressing CTRL+Enter. It's used to send /commands as normal text, so lines beginning with with the command character won't trigger.
  if ($1- == Good morning) {
  
    ;Sets "%last_good_morning" variable to the current $ctime, and makes mIRC unset the variable after 1800 seconds (30 minutes) or when you exit mIRC.
    set -eu1800 %last_good_morning $ctime
  }
}

;/last_good_morning alias
alias last_good_morning {

  ;Check if "%last_good_morning" variable contains something, it should always be $ctime or $null.
  ;If it does, the script tells you how long ago the $ctime was set to the variable and when, if not it says "You haven't said it in the last 30 minutes.".
  echo $iif(%last_good_morning,You said it $duration($calc($ctime -$v1)) ago at $asctime($v1,HH:nn:ss) $+ .,You haven't said it in the last 30 minutes.)
}

Also: /help



EDIT #2:
Instead of having an alias, you could just make the script whine at (and stop) you automatically when you're trying to say it again, or even both.
Code:
on *:input:#: {
  if ($1- == Good morning) {
    if (%last_good_morning) { echo You've already said it in the last 30 minutes! $duration($calc($ctime -$v1)) ago at $asctime($v1,HH:nn:ss) to be specific. | haltdef }
    else set -eu1800 %last_good_morning $ctime
  }
}

Here the $ctrlenter check would be useful, you could force the "good morning" text through the script even if it hasn't been 30 minutes.

If you want the alias too, take it from the the first or second code.

Last edited by Dazuz; 05/02/16 05:20 AM.