0

Basically I have this script so far:

on 1:TEXT:*some text*:#:{
 if(($time(hh)-25) > $lasttime ) {
   This code gets executed only once per 25 hours
   $lasttime = $time(hh)
 }
}

I'm not sure if I'm doing this correctly but if I am I need to know how to set $lasttime if its not already set, and if there is anyway to keep $lasttime set when mirc is closed and re opened?

Tazmanian Tad
  • 193
  • 1
  • 2
  • 12

1 Answers1

0

Sure, save the last time it was said in a permanent variable (set %last_time ...) and check against that the next time. global mIRC %variables are kept even after close/reopen.

Madara's Ghost
  • 172,118
  • 50
  • 264
  • 308
  • To be clear, the `set` command is what makes the variable global. Local variables also start with a percent sign, but you use `var %variable` instead of `set %variable`. – Kylar Oct 18 '12 at 01:17
  • @Kylar: Also, `var %variable = value`, against `set %variable value` – Madara's Ghost Oct 18 '12 at 18:02