Page 1 of 47 12311 ... LastLast
Results 1 to 10 of 468

Thread: Hex api

  1. #1

    Hex api

    Hey Hexers,
    This post is directed mainly towards programmers, because it is talking about API (Application Programming Interface), althought everyone is welcome

    Ok, to the topic.
    During HEX Raid I asked Chris Woods about any possible HEX API. To my suprise few days later I got information from Chris, that he already implemented it, but ofcourse it will not be available until next patch.
    To my even bigger suprise it was implemented into PTR build and I got privilage to share my experience from testing it.


    How is it working?
    Right now it is working only as client side broadcasting JSON message when certain events occur. So it is NOT possible to send anything to client or get any information from server side.
    It IS OFFLINE by default, so it will NOT be sending any data without permission.
    It will NEVER send out any data that is even remotely sensitive.


    How to set it up? (not working on live version yet)
    To set it up You just have to add 2 things into config file:
    - Notifications - listener address,
    - TypesForwareded - what events You want to listen.

    Notifications=<URL>|<URL>|<URL>|....
    TypesForwareded=<MESSAGE>|<MESSAGE>|...

    Examples I tested:
    Notifications=file:///D:/test.txt
    TypesForwarded=All

    Notifications=http://localhost:7777
    TypesForwarded=Login|SaveDeck


    What is form of message that client gives us?
    As I mentioned eariler, it is JSON and always have form of: MessageName, UserName and AdditionalData.
    Example: ["Login","Risterral",[]]


    List of events:
    1. Login
      Occurs when You have been successfully logged in.
      It doesn't have any additiona data.
      Example: ["Login","",[]]


    2. Logout
      Occurs when You have been logged out.
      It doesn't have any additiona data.
      Example: ["Logout","Risterral",[]]


    3. SaveDeck
      Occurs when You have saved deck.
      Additional data contains:
      - Deck name
      - Champion name
      - List of cards in main deck(cards are listed as arrays containing name of card and gem name (if card has gem inserted)
      - List of cards in sideboard (cards are listed same as in main deck)
      Example: ["SaveDeck","Risterral",["Test deck","Bertram Cragraven",[["Elite Battle Tech"],["Infiltrator Bot"], ["Xentoth's Inquisitor","Minor Blood Orb of Deception"], ... , ["Experimental War Hulk"]],[]]]


    4. DraftPack
      Occurs when You have got pass cards during draft
      Additional data contains:
      - List of names of cards that got passed
      Example: ["DraftPack","Risterral",["Elite Battle Tech","Infiltrator Bot", ... , "Experimental War Hulk"]]


    5. DaraftCardPicked (in current live version there is missspell in event name. It have been fixed already, but will go live probably in next week)
      Occurs when You picked card in draft.
      Additional data contains:
      - Picked card name
      Example: ["DaraftCardPicked","Risterral",["Xentoth's Inquisitor"]]


    6. GameStarted
      Occurs when You have started match.
      Additional data contains:
      - List of players names participating in match (not only 2)
      Example: ["GameStarted","Risterral",["Risterral","PlayerName2","PlayerName3"]]
      Note: Playing against AI returns empty array as additional data.


    7. GameEnded
      Occurs when You have ended match.
      Additional data contains:
      - List of players names participating in match (not only 2)
      - Information if certein player won or lost
      Example: ["GameEnded","Risterral",[["Risterral", "Won"],["PlayerName2", "Lost"]]]


    8. Collection
      Occurs when Your collection has been modified from server (e.g. after drafting phase, when You buy something from AH, etc.).
      Additional data contains:
      - List of names of all collected cards, sorted by name.
      Note: Every card is unique instance, so it will be listed as "Burn","Burn","Burn",... so it is possible to count every card.
      Example: ["Collection","Risterral",["Alwyn", "Alwyn","Burn","Burn","Burn",...,"Zoltog"]]



    List of applications / websites publicly available, that are using API:


    There is a lot of things that this API allows to create: applications to gather statistics data, better streamer bots, websites containing automatic deck collection, the possibilities are endless

    If You can think of any event that is not listed here, post it. There is high chance for it to be added to game.

    If You can think of any idea of project using this API, that You want to see or want to create it with anyone, also share it - in this great community I'm sure that there will be always someone willing to help
    Last edited by Risterral; 05-20-2015 at 07:53 AM.

  2. #2
    High Tomb Lord
    Join Date
    May 2013
    Location
    California
    Posts
    1,944
    Hey, that's amazing!

    I would like to have a "start_draft" event, connected to a pretty annoying sound
    In addition I would be nice to get the current status of the different queues. So an event, when someone joins/leaves the tournament.
    Would be amazing to check 15 minutes before a scheduled sealed, if I have to hurry and it is worth it or not
    -----------------------------------------
    Grand King + Pro Player + Collector + King

  3. #3
    High Tomb Lord
    Join Date
    Jul 2013
    Location
    The Bowels of Heck
    Posts
    1,940
    What can you do with this in layman's terms? Can I export my collection?

  4. #4
    Hey all,

    Just wanted to jump in here and say I'll keep an eye on this thread and try to imp events as people bring them up. The way the API is setup it's really easy to add new events to ship out to some external program so people can start collecting data.

    Two big points I really wanted to make real fast:
    - The API is user opt-in and off by default, so you don't need to worry about it sending out data unless you opt into it first.

    - I will never send out any data that is even remotely sensitive. When Risterral says "LOGINNAME" about, he actually means display name (Mine online is 'Chris', for example) -- I would never allow the API to ship out your actual login name, password, IP Address, any computer information, or literally anything that could be remotely considered personal information.

    Otherwise, I hope there are some devs out there who want to make some cool apps to coop with the Hex client, and we'll do everything we can to support that initiative.

    Chris Woods
    Last edited by Chris_Woods; 02-10-2015 at 12:28 PM.

  5. #5
    Someone can make me an auctioneer mod? Plz?
    ----
    http://i.imgur.com/I1MZpF8.png
    HexEnt is too long to type, They're HXE now.
    I am currently trading my unused GK code for a new Tesla Model S P85D
    Feel free to contact me for where you can have it shipped.

  6. #6
    Master Theorycrafter
    Join Date
    May 2013
    Location
    Toronto, Canada
    Posts
    516
    Quote Originally Posted by Risterral View Post
    • DraftPack (not tested - somehow I was not able to solo fire draft during PTR :| )
      Occurs when You have got pass cards during draft
      Additional data contains:
      - List of names of cards that got passed
      Example: ["DraftPack","<LOGINNAME>",["Elite Battle Tech","Infiltrator Bot", ... , "Experimental War Hulk"]]
    Will pay plat for Draft Analyzer. Should detect print runs and tell me what's been picked when a pack wheels.

  7. #7
    High Tomb Lord
    Join Date
    Jul 2013
    Location
    The Bowels of Heck
    Posts
    1,940
    Quote Originally Posted by Gwaer View Post
    Someone can make me an auctioneer mod? Plz?
    I don't know what this is but i want it too.

  8. #8
    Gigantisaur
    Join Date
    Aug 2010
    Location
    San Jose, CA
    Posts
    1,025
    Quote Originally Posted by Risterral View Post
    DraftPack (not tested - somehow I was not able to solo fire draft during PTR :| )
    Occurs when You have got pass cards during draft
    Additional data contains:
    - List of names of cards that got passed
    Example: ["DraftPack","<LOGINNAME>",["Elite Battle Tech","Infiltrator Bot", ... , "Experimental War Hulk"]]
    Twitch Plays Hex Draft.

  9. #9
    Master Theorycrafter
    Join Date
    May 2013
    Location
    Washburn, IA
    Posts
    735
    I was thinking statistics websites and meta analysis. Somethign that displays archetypal decks in limited and constructed, along with win percentages, etc etc. I think it could be way cool to automate the process via the api. Now, to find a way for it to identify opposing decks in game and record tournament info...

    Ahh such dreams
    Pro Player

  10. #10
    Gigantisaur
    Join Date
    Aug 2010
    Location
    San Jose, CA
    Posts
    1,025
    The wheels in my mind are turning... off the top of my head, events I would like to see:

    Auction House:

    onAuctionSearchResults: the list of auctions displayed with some data. A listening program can keep an external history of the listings seen as they are seen. [Unique Auction entry IDs would be awesome for de-duping and updating listings at a later time]

    onAuctionListingCreated (and corresponding onAHListingCanceled): data about a newly created auction, with data about the item listed, and a timestamp. An external solution can keep track of your auctions and timing.

    Inventory:

    onOpenPack: the contents of a pack opened on the wheels of fate screen. Similar to DraftPack. Just because statistics are fun to take.
    onWheelsOfFateSpin: the roll and result of a wheels of fate spin, more stats!
    (PVE) onChestOpen ...

    Tournament:
    onTournamentStart/onDraftStart (already suggested, good suggestion)
    onTournamentListUpdate: could be used to check for newly listed events, or tournaments close to filling (to alert that you have some instant action on a slower-moving tournament queue)

    Game/Match:
    onTurnBegin: with the name of the player whose turn is starting. can alert when it's your turn!

    onGameEnd: when a game ends, some basic results on that game. your name, opponent's name, champions, results. if it is involved with a tournnament, and this data is available, the round and match status, and tournament id [so I can infer if it is the final game in a match or tournament]. i would love some sort of game log, but if there is a unique game id that can refer to a game log elsewhere...

    onGameAction: when any sort of action/link/play happens. send data about the play. we could parse and save the game log externally.
    Last edited by hacky; 02-10-2015 at 12:56 PM.
    http://raptr.com/badge/8dcf0b428b1b1...2e135d/fss.png
    Cryptozoic Champion: CZE Volunteer #517 - South Bay Area, California
    I'm on Twitch! Follow me at twitch.tv/hackychannel
    HexTCG Grand King Team Illusive will definitely be playing Hex... as <Norvic Santos>?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •