mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2015
Posts: 34
C
copman Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Jun 2015
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

Last edited by copman; 30/09/15 05:13 AM.
Joined: Jun 2015
Posts: 34
C
copman Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Jun 2015
Posts: 34
can this even get coded

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Ask a specific question related to mIRC's functionality without assuming others have knowledge of twitch nomenclature.

Joined: Sep 2014
Posts: 259
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
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.

Joined: Jun 2015
Posts: 34
C
copman Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Jun 2015
Posts: 34
tnaks i will have to try it smile

Joined: Aug 2015
Posts: 16
A
Pikka bird
Offline
Pikka bird
A
Joined: Aug 2015
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

Last edited by acpixel; 28/11/15 10:49 PM.
Joined: Oct 2015
Posts: 112
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2015
Posts: 112
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


Link Copied to Clipboard