-
Notifications
You must be signed in to change notification settings - Fork 1
IAH: INTERNET WAR | SINGLEPLAYER AI API
Default API Endpoint: http://127.0.0.1:6800/[request_name]
Use GET Requests to get something and POST to alter something.
GET Returns back string that represents Game Player State.
- STARTING
- LOADING
- MAIN_MENU_INTRO
- MAIN_MENU
- MODE_SELECTION
- HACKER_SELECTION
- HACKER_SELECT
- SANDBOX
- INGAME
- TPSCREEN
- GAMEOVER
POST Transition the Game Player to a certain State. {transition,transitionValue}
Transitions are needed when you want to navigate the main menus. For example, {"transition": "MAIN_MENU"} or to select ScriptKiddie {"transition": "HACKER_SELECT", "transitionValue" : 0}
Potential Hackers:
ScriptKiddie = 0, Java = 1, Ping = 2, Overflow = 3, Backstab = 4, Dns = 5, Deepthroat = 6, Sonic = 7, Scanner = 8, Contract = 9, DevOps = 10, Jack = 11, Whale = 12, Null = 13, Terror = 14, Troll = 15, Filter = 16, Pro = 17, Freelancer = 18, Node = 19, Toxic = 20, Prince = 21, Drama = 22, Liar = 23, Crab = 24, Block = 25, Pixel = 26, Senior = 27, WhiteHat = 28, BlackHat = 29, Spy = 30, Cookie = 31,
GET Return a container object with an array of objects representing Chaos or TP Card that you can select.
POST Choose a Chaos Card or TP Card. -> {"action", 0} -> Select First Card.
https://i.gyazo.com/8e375b3f859fd92626b783c364f39b7b.png
GET Return currently presents tiles in the game and data associated with them.
https://i.gyazo.com/07a5194cd6fcdb7a0008e3a5f52318dc.png
GET Return A* Node list if you want to do your own pathfinding algorithm.
GET Return a List of all entities that are currently present in the game.
You can learn more about values it returns here and purpose of this endpoint: https://github.com/VitaliKirpu/IAH_SinglePlayerAITemplate/blob/master/IAH_SinglePlayerAutomation/Class/Entity.cs
GET Takes uniqueID and targetUniqueID, which are entityID's, and tries to create a ray cast from uniqueID to targetUniqueID. This is useful if you want to check if there is an obstacle before attempting to shoot.
GET Returns true or false; when we perform actions, the computer CPU will become busy, and usually, actions you perform trigger a hostile response.
GET Returns current time scale (Unity Time.time); this is tactical mode speed. Especially in competitive mode, this sometimes can get as low as 0.1.
GET Returns fps, timeRunning (in seconds), and version string of the game. Potentially, some competitive matches will run on specific game versions and won't include the latest updates not to break any meta builds that are currently in use in the leagues.
POST Send ( apiKey and ip), the API Key is your API key that you get when you purchase API, and the IP is 127.0.0.1 for the campaign mode. IP is an identifier that identifies a Remote User Bot, you can think of it as a Username or a secondary Nickname.
https://i.gyazo.com/41349207ae2c7465665c386660d3ff2f.mp4
Note: The IP is not a real IP, and it is a fictional IP.
POST Send Bot Command so that it can do something.
Object structure:
{"IP", "127.0.0.1 or IP competitive pvp API assigned you"}, {"apiPassword", "password that you get from /v1/apipassword" }, {"entityUniqueID", "uniqueID of bot that you want to control" }, {"actionType", "action that you want to perform -> rotate, move, attack, stop, chat, reload, skill, cancelAttack"}, {"actionValue", "some actions also take value, more on that below"}
- rotate takes Vector3 actionValue: {x,y,z}, this is the world location where you want to rotate your bot.
- move takes Vector3 actionValue: {x,y,z}, this is the world location where you want to go, bot will use game's inbuilt pathfinding, but nothing stops you from writing your own pathfinder using data from /v1/grid.
- attack takes string actionValue: uniqueID, this is the ID of the Bot that you want to attack or heal, for example.
- chat takes string actionValue: message, bots can talk.
- skill takes int actionValue: skillIndex, this is arrayIndex, bots can have max 3 skills. https://github.com/VitaliKirpu/IAH_SinglePlayerAITemplate/blob/master/IAH_SinglePlayerAutomation/Class/Entity.cs
Note: After the game detects that the player is sending API Bot Commands, the inbuilt AI for a player will turn off.
POST Takes uniqueID which is Tile uniqueID, and action.
action: -1: just open or close, 0-4 Button Index -> which button to press, you can send button index without opening Tile too, game will open Tile for you and click button.
https://i.gyazo.com/3c97a56f794866c8a62eb771a5b0583c.png
POST Use Framework (Heal/Upgrade/Equip) on ANY Bot. This takes uniqueID, and entityUniqueID. uniqueID is the ID of the tile that you can get using /v1/tiles endpoint.
https://i.gyazo.com/3b67ad02e8e639ad2a974cc1562f270c.jpg
GET Get Website Data from the Website Buffer. As you browse the Internet, your buffer becomes filled with websites.
https://i.gyazo.com/7c37847358cf7a8988cbfa0efb9c505c.png
POST Takes bufferUniqueID, and tileUniqueID, this places website from the buffer to the map tile. It's like drag and drop.
GET/POST Initiate Level Up Sequence so that you can select Chaos or TP Cards.