mIRC Homepage
I'm trying to make a Twitch bot with no background in coding, I have managed to get the bot setup and get some simple commands working. But I couldn't find any scripts for my particular needs.

Basically I want the bot to take the text from this website and paste it in chat: https://decapi.me/twitch/uptime.php?channel=Icestriker

It's for an uptime command, can anyone help me?
If you're lazy about stuff you can use the search function here and find a couple of scripts for this same purpose.

Using a 3rd party to pull information isn't optimal when Twitch has an API on their own, but if you choose to do that then that's up to you. Something you need to use for this is Sockets.
I recommend reading here to learn about sockets.
http://en.wikichip.org/wiki/mirc/sockets/tcp
Code:
alias icestriker {
  set %icechan $1
  sockopen -e decapi decapi.me 443
}

on *:SOCKOPEN:*: {
  if ($sockname == decapi) {
    sockwrite -nt $sockname GET /twitch/uptime.php?channel=Icestriker HTTP/1.1
    sockwrite -nt $sockname Host: decapi.me
    sockwrite $sockname $crlf
  }
}

on *:SOCKREAD:*: {
  if ($sockname == decapi) {
    var %decapi
    sockread %decapi
    while ($sockbr) {
      sockread %decapi
    }
  }
}

on *:sockclose:*: {
  if ($sockname == decapi) {
    var %decapi
    sockread -f %decapi
    msg %icechan %decapi
  }
}

Tested and works smile Load this on a clear remote. Use /icestriker channelname to send the text to the channel you want. (example: /icestriker #OrF )
-OrFeAsGr-
© mIRC Discussion Forums