Skip to content

Instantly share code, notes, and snippets.

@ankushKun
Last active May 13, 2024 13:36
Show Gist options
  • Save ankushKun/3e20b6bcb4113d8aed28ca33282bef10 to your computer and use it in GitHub Desktop.
Save ankushKun/3e20b6bcb4113d8aed28ca33282bef10 to your computer and use it in GitHub Desktop.

AO Bot Deathmatch using BetterIDEa IDE

Video Walkthrough: https://youtu.be/blVIzpd-UQY

Prerequisites

  1. Must have ArConnect extension installed and a wallet setup

Steps

  1. visit https://ide.betteridea.dev and connect wallet using the bottom left connect button

image

image

image

  1. Create a new project from the sidebar

image

Enter name, select new process, enter your name in process name (Process name will be used to identify the bot), select AO Bot template and Regular filetype, and click Create Project

image

  1. Once created, a file will open with the code for an AO bot. Click on the run button on top right

image

image

The output tab should show "undefined" if the code runs successfully (since we are not printing anything and there is no error)

image

  1. Head back to the terminal and run Name, it should print the Name you assigned to the process

image

image

  1. Now we need to set a Game ID to join the game

Run Game = "VazEz2_41Y_kj5pvGrWBCAErEb2lIFg8hDgsMtYlTIU" in Terminal

image

Then run just Game and it should print the value of Game

image

  1. To join the game we need tokens

Request for tokens using Send({ Target = Game, Action = "RequestTokens" })

You will receive a credit notice from the game process

image

Run Send({ Target = Game, Action = "Balance" }) to get your balance

image

You can also view these messages in the Inbox tab

image

  1. Pay the amount and join the game

Run Send({Target = Game, Action = "Transfer", Quantity = "1000", Recipient = Game})

This will send 1000 tokens to the game process and allow your bot to participate in the deathmatch

image

You will have received a Debit Notice notification and now the bot can move in the grid and perform attacks

image

You can view your bot in the grid game by visiting https://grid_ao.g8way.io/?id=VazEz2_41Y_kj5pvGrWBCAErEb2lIFg8hDgsMtYlTIU

image

You will also keep receiving updates about your bot in the IDE

image

May the best bot win!


More about the AO Grid game and detailed instructions at https://protocol.land/#/repository/75a0aca8-f971-435f-8679-7fc31492e669

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment