mIRC Home    About    Download    Register    News    Help

Print Thread
How would I make an uptime continue? #254746 29/08/15 07:24 PM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Hi, I am trying to make it to where the uptime will continue in the event of a crash or stream restart for Twitch such as a 24 hour stream. If the stream stops after 5-10 minutes it will also stop the uptime, but continue when they come back online. Here is Nillen's script for uptime. Does anyone have any idea as to how I might do this? Can I use his script or do I need to create my own and if so, how would I go about doing that.

Thanks,
powerade661

Code:

on *:text:!uptime*:#:{
  set %target $iif($2,$2,$mid(#,2-))
  set %channel #
  uptime 
}

alias uptime {
  sockclose uptime
  sockopen uptime nightdev.com 80
}

on *:sockopen:uptime:{
  if ($sockerr) { sockclose $sockname | halt }
  sockwrite -n $sockname GET /hosted/uptime.php?channel= $+ %target HTTP/1.1
  sockwrite -n $sockname Host: www.nightdev.com 
  sockwrite -n $sockname $crlf
}

on *:sockread:uptime:{
  if ($sockerr) { sockclose $sockname | halt }
  var %data
  sockread %data
  tokenize 32 %data
  if ($1 isnum) && ($2) { msg %channel %target has been online for $1- }
  elseif (%data == The channel is not live.) msg %channel %target is currently not online.
}

on *:sockclose:uptime:{ 
  unset %channel
  unset %target
}


Re: How would I make an uptime continue? [Re: powerade661] #254747 29/08/15 08:51 PM
Joined: Jan 2015
Posts: 168
P
powerade661 Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
Also another thing. I am trying to get this script to prevent phrases instead of words only. When modifying the gettok if I do 144 or 44 it will time them out for using spaces, is it possible to have it check for spaces within the phrase?


Code:

on *:TEXT:!blacklist add*:#: {
  if ($nick isop #) {
    set %blacklist. $+ $$3- $+ . $+ $chan On
    msg # $$3- has been added to my blacklist, anyone using $$3- will be timed out for 10 minutes.
  }
  else {
    msg # Sorry $nick $+ , you do not have permission to add words to the blacklist
  }
}
on *:TEXT:!blacklist del*:#: {
  if ($nick isop #) {
    unset %blacklist. $+ $$3- $+ . $+ $chan On
    msg # $$3- Has been removed from the blacklist
  }
  else {
    msg # Sorry $nick $+ , you do not have permission to remove words from my blacklist
  }
}
on *:TEXT:*:#: {
  if ($nick isop #) return
  if ($read($chan $+ regs.txt,nw,$nick)) { return }
  var %i = 1
  while (%i <= $0) {
    if ($($+(%,blacklist.,$gettok($1-,%i,32),.,#),2)) {
      msg # $nick --> Don't use that word. FailFish [Timeout]
      msg # .timeout $nick 600
      break
    }
    inc %i
  }
}
}










Re: How would I make an uptime continue? [Re: powerade661] #254749 30/08/15 04:45 PM
Joined: Feb 2015
Posts: 243
O
OrFeAsGr Offline
Fjord artisan
Offline
Fjord artisan
O
Joined: Feb 2015
Posts: 243
Hi!
From what i read i think you could store the uptime in a variable.. and when it resets due to crash or restart you can add the new time to the stored one.

Last edited by OrFeAsGr; 30/08/15 04:46 PM.