mIRC Home    About    Download    Register    News    Help

Print Thread
#249828 18/12/14 03:52 PM
Joined: Apr 2014
Posts: 170
Bramzee Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Apr 2014
Posts: 170
So, I'm planning on doing a 24 hour stream on twitch. And having the !uptime command helps people know how much longer is left and all that good stuff. Basically, I want to take a break every couple hours and want to be able to pause the uptime command. Is this a possibility? here's my uptime script:

Code:
on *:text:!startup:#: {
  unset %downtime
  set -e %uptimer. [ $+ [ # ] ] $ctime
}

on *:text:!stopup:#: {
  set %downtime On
  unset %uptimer. [ $+ [ # ] ]
}


on *:text:!uptime:#: {
  if (%downtime) {
    msg # Currently Offline
  }
  else { msg # Proper has been live for: $duration($calc($ctime - %uptimer. [ $+ [ # ] ] )) }
}


Basically what I want is like a !pauseup command that will store the current "uptime" which I'm assuming would have to include making a variable to store the current uptime, unsetting %uptimer. and then when unpausing, starting a new "%uptimer." variable that uses $calc to include the new %uptimer. and the variable that has the old one stored...

ie: $duration($calc($ctime - %uptimernew. [ $+ [ # ] ] ))


However, the things I've tried haven't worked. Any help is appreciated...

Joined: Jun 2014
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
Code:
on *:text:!pause:#: {
  unset %uptimer2
  set -e %uptimer2 $ctime
}
on *:text:!unpause:#: {
  var %now $ctime
  set -e %uptimer. $+ $chan $calc($($+(%,uptimer.,$chan),2) + (%now - %uptimer2))
}


Mmmm maybe.

Joined: Apr 2014
Posts: 170
Bramzee Offline OP
Vogon poet
OP Offline
Vogon poet
Joined: Apr 2014
Posts: 170
Sorry for the late response. I rushed to get this into my scripts right before I started my 24 hour. It did in fact work, thank you very much. So simple, just over thought it lol. Thanks again smile

Joined: Jun 2014
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
Over thinking things is the worst.


Link Copied to Clipboard