mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#253522 18/06/15 02:39 AM
K
Khonor
Khonor
K
I have this script and I was wondering if someone could help me, because from one moment to the other I leave to function the command and not know why.





on *:text:!uptime*:#:{
if ((%flooduptime) || ($($+(%,flooduptime.,$nick),2))) { return }
set -u5 %flooduptime On
set -u10 %flooduptime. $+ $nick On
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/streaming.

}

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


Any help is appreciated!

#253527 18/06/15 10:35 PM
Joined: Dec 2008
Posts: 1,483
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,483

westor #253593 20/06/15 11:22 PM
K
Khonor
Khonor
K
If I seen this script but I need for multiple channels.

westor #253597 21/06/15 02:28 AM
K
Khonor
Khonor
K
I have this script that is yours and it works very well, but need to work on multiple channels, you can do?

PS: And in the part where it says: "The streaming is currently offline." He it repeats twice in chat.



alias uptime_chan return

ON *:TEXT:!uptime:#: {
var %c = $chr(35) $+ $uptime_chan
if (%c == $chan) { 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= $+ $uptime_chan HTTP/1.1
sockwrite -n $sockname Host: $sock($sockname).addr
sockwrite -n $sockname $crlf
}

ON *:SOCKREAD:uptime: {
if ($sockerr) { sockclose $sockname }
var %data
sockread %data
if ($gettok(%data,1,32) isnum) && ($gettok(%data,2,32)) {
var %c = $chr(35) $+ $uptime_chan
if ($me !ison %c) { return }
.msg %c The streaming is up for $qt(%data) $+ .
}
elseif (*not live.* iswm %data) {
var %c = $chr(35) $+ $uptime_chan
if ($me !ison %c) { return }
.msg %c The streaming is currently offline.
}
}

#253598 21/06/15 02:35 AM
Joined: Dec 2008
Posts: 1,483
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,483
Try use this code:

Code:
ON *:TEXT:!uptime:#: { 
  var %s = uptime_ $+ $ticks $+ $rand(1,10000)
  sockopen %s nightdev.com 80
  sockmark %s $mid($chan,2-)
}

ON *:SOCKOPEN:uptime_*: {
  if ($sockerr) { sockclose $sockname | return }
  sockwrite -n $sockname GET /hosted/uptime.php?channel= $+ $sock($sockname).mark HTTP/1.1
  sockwrite -n $sockname Host: $sock($sockname).addr
  sockwrite -n $sockname $crlf
}

ON *:SOCKREAD:uptime_*: {
  if ($sockerr) { sockclose $sockname | return }
  var %data
  sockread %data
  if ($gettok(%data,1,32) isnum) && ($gettok(%data,2,32)) {
    var %c = $chr(35) $+ $sock($sockname).mark
    if ($me !ison %c) { return }
    .msg %c The streaming is up for $qt(%data) $+ .
  }
  elseif (*not live.* iswm %data) {
    var %c = $chr(35) $+ $sock($sockname).mark
    if ($me !ison %c) { return }
    .msg %c The streaming is currently offline.
  }
}

westor #253599 21/06/15 02:57 AM
K
Khonor
Khonor
K
It does not work. [img]http://prntscr.com/7jfgoq[/img] cry

#253600 21/06/15 03:41 AM
Joined: Dec 2008
Posts: 1,483
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,483
Of course and is working, probably you did something wrong on copy/paste, or you had place it into an wrong place.

Paste the code into the Remotes tab into the Script Editor into a new file and try again.

westor #253601 21/06/15 03:50 AM
K
Khonor
Khonor
K
I do not change anything. [img]http://prntscr.com/7jfthz[/img]

#253602 21/06/15 04:12 AM
Joined: Dec 2008
Posts: 1,483
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,483
If you are not getting any command response thats not code fault but you have probably did not add support for CAP (new twitch protocol) so try use this code:

NOTE: After you paste the code, restart the bot to apply.

Code:
ON *:TEXT:!uptime:#: { 
  var %s = uptime_ $+ $ticks $+ $rand(1,10000)
  sockopen %s nightdev.com 80
  sockmark %s $mid($chan,2-)
}

ON *:SOCKOPEN:uptime_*: {
  if ($sockerr) { sockclose $sockname | return }
  sockwrite -n $sockname GET /hosted/uptime.php?channel= $+ $sock($sockname).mark HTTP/1.1
  sockwrite -n $sockname Host: $sock($sockname).addr
  sockwrite -n $sockname $crlf
}

ON *:SOCKREAD:uptime_*: {
  if ($sockerr) { sockclose $sockname | return }
  var %data
  sockread %data
  if ($gettok(%data,1,32) isnum) && ($gettok(%data,2,32)) {
    var %c = $chr(35) $+ $sock($sockname).mark
    if ($me !ison %c) { return }
    .msg %c The streaming is up for $qt(%data) $+ .
  }
  elseif (*not live.* iswm %data) {
    var %c = $chr(35) $+ $sock($sockname).mark
    if ($me !ison %c) { return }
    .msg %c The streaming is currently offline.
  }
}

ON *:CONNECT: {
  if ($server == tmi.twitch.tv) {
    /raw CAP REQ :twitch.tv/membership
    /raw CAP REQ :twitch.tv/commands
  }
}

westor #253604 21/06/15 03:03 PM
K
Khonor
Khonor
K
It does not work, do not understand why this does not work and the other happens to the principle itself.

#253605 21/06/15 04:12 PM
Joined: Dec 2008
Posts: 1,483
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,483
I cannot understand why is not working into your bot, i had try it 100 times and everything working..

westor #253610 21/06/15 10:25 PM
K
Khonor
Khonor
K
I do not understand because they do not work, but if I use your other script that is only for my channel if it works.

#253611 21/06/15 10:30 PM
Joined: Dec 2008
Posts: 1,483
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,483
Give a try this one:

Code:
ON *:TEXT:!uptime:#: { 
  var %s = uptime_ $+ $ticks $+ $rand(1,10000)
  sockopen %s nightdev.com 80
  sockmark %s $mid($chan,2-)
}

ON *:SOCKOPEN:uptime_*: {
  if ($sockerr) { sockclose $sockname | return }
  sockwrite -n $sockname GET /hosted/uptime.php?channel= $+ $sock($sockname).mark HTTP/1.1
  sockwrite -n $sockname Host: $sock($sockname).addr
  sockwrite -n $sockname $crlf
}

ON *:SOCKREAD:uptime_*: {
  if ($sockerr) { sockclose $sockname | return }
  var %data
  sockread %data
  if ($gettok(%data,1,32) isnum) && ($gettok(%data,2,32)) {
    var %c = $chr(35) $+ $sock($sockname).mark
    .msg %c The streaming is up for $qt(%data) $+ .
  }
  elseif (*not live.* iswm %data) {
    var %c = $chr(35) $+ $sock($sockname).mark
    .msg %c The streaming is currently offline.
  }
}

ON *:CONNECT: {
  if ($server == tmi.twitch.tv) {
    /raw CAP REQ :twitch.tv/membership
    /raw CAP REQ :twitch.tv/commands
  }
}

westor #253612 21/06/15 10:55 PM
K
Khonor
Khonor
K
Still does not work, but good no matter thank you very much for all your help equal Westor.

#253623 23/06/15 05:04 AM
Joined: Jan 2014
Posts: 107
M
Vogon poet
Offline
Vogon poet
M
Joined: Jan 2014
Posts: 107
Mine works just fine. Just tested it in my own channel.

Here you go:

https://github.com/Majeye/MajeyeBot/blob/master/streamer_uptime

!uptime is the command

You can also do !uptime <Streamer Name> and it'll tell you someone elses uptime, even in your own channel.


Last edited by Majeye; 23/06/15 05:06 AM.
Majeye #253631 23/06/15 02:49 PM
K
Khonor
Khonor
K
If this used to work, but in the last few weeks it stopped. confused

#253637 23/06/15 04:51 PM
K
keyeslol
keyeslol
K
You need to send this:

/raw CAP REQ :twitch.tv/membership
/raw CAP REQ :twitch.tv/commands

#256498 21/01/16 03:13 AM
B
bl968
bl968
B
Recently nightbot added a spam to the command. I dealt with it by changing....

Quote:
if ($1 isnum) && ($2) { msg %channel %target has been online for $1- }

to
Quote:
if ($1 isnum) && ($2) {
/msg %channel %target has been streaming for $gettok($1-,1,45)
}




Last edited by bl968; 21/01/16 03:14 AM.
#256591 30/01/16 03:34 PM
Joined: Jan 2016
Posts: 78
X
Babel fish
Offline
Babel fish
X
Joined: Jan 2016
Posts: 78
bot saying

"1 hour, 32 minutes - Oh hey, you're using an API meant for Nightbot, not for whatever you're using. Maybe you'd want to try out the new Nightbot beta: https://beta.nightbot.tv".

can i delete other words.i want to only "hours and minutes"

x3pos #256592 30/01/16 08:45 PM
S
Sissou
Sissou
S
Originally Posted By: x3pos
bot saying

"1 hour, 32 minutes - Oh hey, you're using an API meant for Nightbot, not for whatever you're using. Maybe you'd want to try out the new Nightbot beta: https://beta.nightbot.tv".

can i delete other words.i want to only "hours and minutes"




I use this and it works

Quote:

on *:text:!uptime*:#:{
if (!$2) { set %target $remove($chan,$chr(35)) }
else 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
var %delmessage = $deltok($1-, 5-30, 32)
var %online $remove(%delmessage,- Oh)
if ($1 isnum) && ($2) { msg %channel %target has been online for %online }
elseif (%data == The channel is not live. - Oh hey, you're using an API meant for Nightbot, not for whatever you're using. Maybe you'd want to try out the new Nightbot beta: https://beta.nightbot.tv) msg %channel %target is currently not online.
}

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

Page 1 of 2 1 2

Link Copied to Clipboard