paintbalbot

TTI server status checker

Sep 5th, 2014
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 2.10 KB | None | 0 0
  1. /* Welcome to ServerStatusChecker's guide on how i check the status!
  2. If you have any idea how/what mirc scripting is, you may understand this!
  3. I remove the password so people don't change it and break me q.q
  4. */
  5. on *:text:status:*:{
  6.   msg $nick Server runnng - %ttivar
  7. }
  8. alias toon {
  9.   if (!$sslready) return $input(SSL is required,o)
  10.   sockclose toon
  11.   sockopen -e toon toontowninfinite.com 443
  12.   if (%ttivar !== %oldttivar) {
  13.     if (%ttivar == false) {
  14.       msg #tticommunity [server status checker] Oh no! looks like the server went down!  (say status anytime to get status)
  15.       msg KevinH Game is now offline, topic change?
  16.       msg Relltrem Game is now offline, topic change?
  17.     }
  18.     if (%ttivar == true) {
  19.       msg #tticommunity [server status checker] HOORAY! the server is back up! go bust some cogs and spin some gears! (say status anytime to get status)
  20.       msg KevinH Game is back online, topic change?
  21.       msg Relltrem Game is now offline, topic change?
  22.     }
  23.   }
  24. }
  25. alias start { --
  26.   msg #tticommunity Automatic server status checker Activated. If the server changes status the irc will be first to know, without any troll messages! (say status anytime to get status)
  27.   echo -a server status checker started
  28.   .timerggnoregui 0 11 toon
  29. }
  30. alias stop {
  31.   msg #tticommunity Automatic server status checker Deactivated. (say status anytime to get status)
  32.   echo -a server status checker stopped
  33.   .timerggnoregui off
  34. }
  35. on *:sockopen:toon:{
  36.   if ($sockerr) return $input(Error while trying to connect to the server,o)
  37.   var %sw sockwrite -n toon
  38.   %sw POST /api/login/ HTTP/1.1
  39.   %sw Host: toontowninfinite.com
  40.   %sw Accept: */*
  41.   %sw Content-Type: application/x-www-form-urlencoded
  42.   %sw Content-Length: 33
  43.   %sw
  44.   sockwrite toon n=ircCheckr&p=(no password for you)&dist=test
  45. }
  46. on *:sockread:toon:{
  47.   if ($sockerr) return $input(An error occured while reading data,o)
  48.   var %a
  49.   sockread -f %a
  50.   if (*{"success":* iswm %a) {
  51.     set -e %ttivar $gettok($gettok(%a,2,58),1,44)
  52.     .timerlolggnore 1 9 set -e %oldttivar $gettok($gettok(%a,2,58),1,44)
  53.     echo -a %a
  54.   }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment