mIRC Home    About    Download    Register    News    Help

Topic Options
#255211 - 30/09/15 06:10 AM {Twitch} help with auto hosting
copman Offline
Ameglian cow

Registered: 13/06/15
Posts: 34
I want it so the bot can see if people are online and if they are not then it skips them and i want a !skip so i can skip hosts if i need to here is the script and i want a !extend so the host can be extended for 10 more mins.

ON *:TEXT:!autohost*:#:{
if (!$istok(%owners,$nick,32)) { .msg $chan ( $+ $nick $+ ): Error, You have NOT access for this command! | return }
if ($2 == on) {
if ($timer(.hostON)) { .msg $chan ( $+ $nick $+ ): Error, The AUTOHOST is already enabled! | return }
var %f = nowhosting.txt
if (!$isfile(%f)) { .msg $chan ( $+ $nick $+ ): Error, The $qt(%f) file does NOT provide any nickname(s) for hosting! | return }
if (!$lines(%f)) { .msg $chan ( $+ $nick $+ ): Error, The $qt(%f) file does NOT provide any nickname(s) in the list for hosting! | return }
msg # /me Auto Hosting is now enabled.
searchhost $chan
.timer.hostON 0 1800 searchhost $chan
}
elseif ($2 == off) {
if (!$timer(.hostON)) { .msg $chan ( $+ $nick $+ ): Error, The AUTOHOST is already disabled! | return }
msg # /me Auto Hosting is now disabled.
.timer.hostON off
msg # /unhost
}
}

alias searchhost {
if (!$1) { return }
if ($me !ison $1) { return }
var %f = nowhosting.txt
if (!$isfile(%f)) { return }
if (!$lines(%f)) { return }
var %r = $read(NowHosting.txt,n)
msg $1 /me Now hosting $qt(%r)
msg $1 /host %r
}

Thanks


Edited by copman (30/09/15 06:13 AM)

Top
#255238 - 02/10/15 03:17 AM Re: {Twitch} help with auto hosting [Re: copman]
copman Offline
Ameglian cow

Registered: 13/06/15
Posts: 34
can this even get coded

Top
#255239 - 02/10/15 03:44 AM Re: {Twitch} help with auto hosting [Re: copman]
Loki12583 Offline
Hoopy frood

Registered: 22/01/04
Posts: 1263
Ask a specific question related to mIRC's functionality without assuming others have knowledge of twitch nomenclature.

Top
#255241 - 02/10/15 08:16 AM Re: {Twitch} help with auto hosting [Re: copman]
Sakana Offline
Fjord artisan

Registered: 19/09/14
Posts: 259
Originally Posted By: copman
can this even get coded


Sure, just make a list of channels you want to check, then look up Twitch's API to check if it's online. If it is online, host it, else check the next one, and so on.

Top
#255243 - 02/10/15 06:11 PM Re: {Twitch} help with auto hosting [Re: Sakana]
copman Offline
Ameglian cow

Registered: 13/06/15
Posts: 34
tnaks i will have to try it smile

Top
#255869 - 28/11/15 10:48 PM Re: {Twitch} help with auto hosting [Re: copman]
acpixel Offline
Pikka bird

Registered: 19/08/15
Posts: 16
ok to check if they are live i would use this json parser script
http://hawkee.com/snippet/10194/

then the code you would need would be this:
replace (channel) with the variable that contains the channel you are checking
Code:
JSONOpen -u live https://api.twitch.tv/kraken/streams/ $+ (channel) $+ ?nocache= $+ $ticks
      if ( $json(live,stream) != $null ) {
          set %live on
          JSONClose live
}
else {
unset %live
}


The rest of the script should be easy enough for you to figure out. hope i helped


Edited by acpixel (28/11/15 10:49 PM)

Top
#255895 - 30/11/15 12:39 AM Re: {Twitch} help with auto hosting [Re: copman]
Blas Offline
Vogon poet

Registered: 27/10/15
Posts: 104
I have been successfully using a script that I created just recently for auto-hosting on Twitch. It does not have !skip or !extend features, but I still consider it fairly advanced and should at least be a decent template for what you want. Twitch Advanced Auto-Host
_________________________
My Twitch mIRC Bot Games and Stuff

Top