|
Khonor
|
Khonor
|
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!
|
|
|
|
Joined: Dec 2008
Posts: 1,483
Hoopy frood
|
Hoopy frood
Joined: Dec 2008
Posts: 1,483 |
|
|
|
|
Khonor
|
Khonor
|
If I seen this script but I need for multiple channels.
|
|
|
|
Khonor
|
Khonor
|
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. } }
|
|
|
|
Joined: Dec 2008
Posts: 1,483
Hoopy frood
|
Hoopy frood
Joined: Dec 2008
Posts: 1,483 |
Try use this 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.
}
}
|
|
|
|
Joined: Dec 2008
Posts: 1,483
Hoopy frood
|
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.
|
|
|
|
Joined: Dec 2008
Posts: 1,483
Hoopy frood
|
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.
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
}
}
|
|
|
|
Khonor
|
Khonor
|
It does not work, do not understand why this does not work and the other happens to the principle itself.
|
|
|
|
Joined: Dec 2008
Posts: 1,483
Hoopy frood
|
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..
|
|
|
|
Khonor
|
Khonor
|
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.
|
|
|
|
Joined: Dec 2008
Posts: 1,483
Hoopy frood
|
Hoopy frood
Joined: Dec 2008
Posts: 1,483 |
Give a try this one:
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
}
}
|
|
|
|
Khonor
|
Khonor
|
Still does not work, but good no matter thank you very much for all your help equal Westor.
|
|
|
|
Joined: Jan 2014
Posts: 107
Vogon poet
|
Vogon poet
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.
|
|
|
|
Khonor
|
Khonor
|
If this used to work, but in the last few weeks it stopped. 
|
|
|
|
keyeslol
|
keyeslol
|
You need to send this:
/raw CAP REQ :twitch.tv/membership /raw CAP REQ :twitch.tv/commands
|
|
|
|
bl968
|
bl968
|
Recently nightbot added a spam to the command. I dealt with it by changing.... if ($1 isnum) && ($2) { msg %channel %target has been online for $1- } to 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.
|
|
|
|
Joined: Jan 2016
Posts: 78
Babel fish
|
Babel fish
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"
|
|
|
|
Sissou
|
Sissou
|
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 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 }
|
|
|
|
|