This script lets you run your own bot for Crabada, automating starting and closing game every 4 hours
It includes an integration with a telegram bot that sends update but you can remove those if needed
Just git clone and install dependencies.
git clone https://github.com/SavageCabbagee/Crabada-Bot.git
npm install
- Do a test start game txn and find your team id. Copy that data and paste it in the data line (line 37) for startGame()
async function startGame() {
var transaction = {
data: '<PASTE_HERE>',
to: Crabada_Game_Address,
value: 0,
from: My_Address,
};
- Create a .env file and fill in your private key and telebot API from BotFather
Wallet = <Private_Key>
telebot = <API>
-
Get your telegram id from @userinfobot and fill that up for the <YOUR_ID> field in bot.sendMessage
-
Paste your address in My_Address line.
-
Ensure you have approved TUS and CRA for trades on Trader Joe.
-
Run the bot and send /start to the bot.
ts-node bot.ts
-
Ideally, closeGame() is called via checking block timestamps but I'm lazy to implement
-
Due to async functions(I think), when you swap, you receive the balance message before the swap goes through, should solve this via a .then but have not implemented
-
Due to the .then in closeGame(), you get the start game message before close game