Mudlet Live Feed Script

VaxVax Member Posts: 13
I've made a script that takes the live feed from the front page of the Imperian website and incorporates it into mudlet for you to see inline with other things.  This shows things like deaths, character achievements, ally login/logoff (if you set your person number), and other fun things.  The script works by downloading the json file from the Imperian webserver directly and parsing the data.  It runs every 60 seconds (although this can be modified in the script).  To install, please copy the script from here (http://pastebin.com/Rs7TxP99) and save as a new script file in mudlet.  It should automatically register the event handlers and timer for you. 

Please let me know if you have any trouble with the script, or have any suggestions to make it better!

Comments

  • MathiausMathiaus PennsylvaniaMember, Beta Testers Posts: 1,007 ✭✭✭✭
    edited May 2014
    Messed around with it for a bit, it's pretty neat. How would I go about the person numbers however?

    Also, curious about how big the json file is.
    image
  • VaxVax Member Posts: 13
    If you login as yourself on the imperian.com website and then view source you will find a bit of code that says:

    curPerson = ####;

    That number is your person number.
    Mathiaus
  • VaxVax Member Posts: 13
    edited May 2014
    Mathiaus said:

    Also, curious about how big the json file is.
    The json file is pretty small.  When there's nothing new it returns simply "[ ]". Otherwise it's just a couple of bytes that contain the new events.  

    Here's an example of the file with a new event:

    {
    • 85787083: 
      {
      • 0: "85787083",
      • 1: "Level Gained",
      • 2: "Alyssn earned level 19.",
      • 3: "LUP",
      • 4: "mid",
      • 5: "2014-05-15 16:38:26",
      • 6: "0",
      • id: "85787083",
      • caption: "Level Gained",
      • description: "Alyssn earned level 19.",
      • type: "LUP",
      • game: "Midkemia Online",
      • date: "2014-05-15 16:38:26",
      • persona: "0",
      • gametype: "LUP",
      • gameid: "mid"
      }
    }
    Mathiaus
  • MathiausMathiaus PennsylvaniaMember, Beta Testers Posts: 1,007 ✭✭✭✭
    edited May 2014
    Works great. Only tweaked the echoes to be one line instead of two, changed the colors, and added the function to display it in the chat windows.

    Thanks again :P
    image
  • VaxVax Member Posts: 13
    Updated the script on the pastebin to fix a bug someone pointed out. The url wasn't getting reset after each get, causing errors.
    Ristani
Sign In or Register to comment.