1. Hey Guest, are you looking for a place to host your IRC related project? Then check out the Resource Manager on IRCForums! Click the resources tab above this notice!
  2. Hello Guest, are you new to IRCForums? Why not introduce yourself in the introduction forum!
  3. We have updated the layout of our forums. Please see this thread for more information.

[msl]A MSL Version of Xbox Live Look up

Discussion in 'Script Gallery (Depreciated)' started by Napa182, Apr 14, 2012.

  1. Offline

    Napa182 Moderator

    Member Since:
    Dec 18, 2011
    Message Count:
    222
    Likes Received:
    83
    Trophy Points:
    56
    This is just an MSL version of an xbox live gamer-tag look up socket.
    Copy/Paste into a new remote of your bot.
    Trigger is @xbox gamertag
    Example:
    Code (mirc):
    on $*:text:/^@xbox\s(.+)/iS:# {
      if (!%f) { inc -u3 %f
        if ($sock(xbox)) sockclose xbox
        sockopen xbox live.xbox.com 80
        sockmark xbox $+(/en-US/Profile?gamertag=,$replace($regml(1),$chr(32),$+($chr(37),20))) $&
          msg # $regml(1)
      }
    }
    on *:sockopen:xbox: {
      sockwrite -nt xbox GET $gettok($sock(xbox).mark,1,32) HTTP/1.1
      sockwrite -nt xbox Host: $+($sock(xbox).addr,$str($crlf,2))
    }
    on *:load: {
      echo 12 -a You Have Just Loaded Napa182's Xbox Live Look-up Socket
      echo 07 -a A irc.EzzyChat.com Production
    }
    on *:sockread:xbox: {
      var %xbox | sockread %xbox
      if ($regex(%xbox,/<h1.+CustomErrorTitle.+>(Ooops!).+<\/h1>/)) {
        $gettok($sock(xbox).mark,2-3,32) $regml(1) I don't know who $+(",$gettok($sock(xbox).mark,4,32),") is. $&
          Looks like you may have misspelled the Gamer-tag you are looking for.
        sockclose xbox
      }
      if ($regex(%xbox,/<div.+presence.+>(.+)<\/div>/)) {
        hadd -m xbox 1 $regsubex($regml(1),/&#(\d+);/g,$chr(\1))
      }
      if ($regex(%xbox,/<div.+gamerscore.+>(\d+)<\/div>/)) {
        $+($gettok($sock(xbox).mark,2-,32),$chr(44)) $hget(xbox,1) - Gamerscore $regml(1)
        sockclose xbox
      }
    }
    Updated version
    Well it seems after the last update xbox did they screwed up this socket so here is a fix using a different site.
    Code (mirc):
    on $*:text:/^@xbox\s(.+)/iS:#: {
      if (!%f) { inc -u3 %f
        if ($sock(xbox)) sockclose xbox
        sockopen xbox www.xboxgamertag.com 80
        sockmark xbox $+(/search/,$replace($regml(1),$chr(32),$+($chr(45)))/) $&
          msg #
      }
    }
    on *:sockopen:xbox: {
      sockwrite -nt xbox GET $gettok($sock(xbox).mark,1,32) HTTP/1.1
      sockwrite -nt xbox Host: $+($sock(xbox).addr,$str($crlf,2))
    }
    on *:load: {
      echo 12 -a You Have Just Loaded Napa182's Xbox Live Look-up Socket
      echo 07 -a A irc.EzzyChat.com Production
    }
    on *:sockread:xbox: {
      var %xbox | sockread %xbox
      if ($regex(%xbox,/<p class="topc">(.+)<\/p>/)) {
        $gettok($sock(xbox).mark,2-,32) $regml(1)
      }
      if ($regex(%xbox,/<p>(Online Status:.+)<\/p>/)) {
        $gettok($sock(xbox).mark,2-,32) $regsubex($regml(1),/<[^>]*>/g,$chr(32))
      }
    }
    GrimReaper likes this.
  2. Online

    GrimReaper Recruit

    Member Since:
    Feb 26, 2012
    Message Count:
    23
    Likes Received:
    8
    Trophy Points:
    18
    Nicely done Napa, Much smaller version than my TCL one. lol.
    Napa182 likes this.
  3. Offline

    Napa182 Moderator

    Member Since:
    Dec 18, 2011
    Message Count:
    222
    Likes Received:
    83
    Trophy Points:
    56
    Thank you Grim...
  4. Offline

    Bertrum ParadoxIRC

    Member Since:
    Dec 17, 2011
    Message Count:
    1,821
    Likes Received:
    243
    Trophy Points:
    188
    Nice one napa, I'll give this a go in a bit
    Napa182 likes this.
  5. Offline

    Napa182 Moderator

    Member Since:
    Dec 18, 2011
    Message Count:
    222
    Likes Received:
    83
    Trophy Points:
    56
    Thanks Bertrum
    Bertrum likes this.
  6. Offline

    Napa182 Moderator

    Member Since:
    Dec 18, 2011
    Message Count:
    222
    Likes Received:
    83
    Trophy Points:
    56
    Well it seems after the last update xbox did they screwed up this socket so here is a fix using a different site.
    Code (mirc):
    on $*:text:/^@xbox\s(.+)/iS:#: {
      if (!%f) { inc -u3 %f
        if ($sock(xbox)) sockclose xbox
        sockopen xbox www.xboxgamertag.com 80
        sockmark xbox $+(/search/,$replace($regml(1),$chr(32),$+($chr(45)))/) $&
          msg #
      }
    }
    on *:sockopen:xbox: {
      sockwrite -nt xbox GET $gettok($sock(xbox).mark,1,32) HTTP/1.1
      sockwrite -nt xbox Host: $+($sock(xbox).addr,$str($crlf,2))
    }
    on *:load: {
      echo 12 -a You Have Just Loaded Napa182's Xbox Live Look-up Socket
      echo 07 -a A irc.EzzyChat.com Production
    }
    on *:sockread:xbox: {
      var %xbox | sockread %xbox
      if ($regex(%xbox,/<p class="topc">(.+)<\/p>/)) {
        $gettok($sock(xbox).mark,2-,32) $regml(1)
      }
      if ($regex(%xbox,/<p>(Online Status:.+)<\/p>/)) {
        $gettok($sock(xbox).mark,2-,32) $regsubex($regml(1),/<[^>]*>/g,$chr(32))
      }
    }
  7. Offline

    Bertrum ParadoxIRC

    Member Since:
    Dec 17, 2011
    Message Count:
    1,821
    Likes Received:
    243
    Trophy Points:
    188
    The new XBOX dashboard is shit. Just thought I'd put that out there.
  8. Offline

    Napa182 Moderator

    Member Since:
    Dec 18, 2011
    Message Count:
    222
    Likes Received:
    83
    Trophy Points:
    56
    Yes it is. They really screwed shit up after that last update. They are trying to get it ready for the 3 new games hitting. Halo 4, Black Ops 2, and Assassin's Creed 3.

Share This Page