/kamergotchi-bot

:baby_bottle: :necktie: Automatically take care of your favorite dutch politician.

Primary LanguageJavaScriptMIT LicenseMIT

KamerBOTchi

Automatically take care of your favorite dutch politician.

A Node.js Kamergotchi bot.



KamerBOTchi v1.4.1
https://git.io/kamergotchi

[*] Player token is set to xxx
    requested game status.
[*] Can't feed Sylvana (Artikel 1) anymore, 319 seconds remaining.
    hibernating for 339 seconds..
    Score 19571 - Spent care point on knowledge
    Score 19576 - Spent care point on knowledge
    Score 19581 - Spent care point on knowledge
    Score 19586 - Spent care point on knowledge
    Score 19591 - Spent care point on knowledge
    Score 19596 - Spent care point on knowledge
    Score 19601 - Spent care point on knowledge
    Score 19606 - Spent care point on knowledge
    Score 19611 - Spent care point on knowledge
    Score 19616 - Spent care point on knowledge
[*] Can't feed Sylvana (Artikel 1) anymore, 409 seconds remaining.
    hibernating for 421 seconds..

Getting started

This package is both a CLI program and a Node module. The easiest way to get started is to download the kamergotchi package from NPM.

npm install -g kamergotchi
kamergotchi {myPlayerToken}

To get started with the bot, you will have to find out your kamergotchi x-player-token through a simple MITM attack using a proxy on your phone. I recommend Burp Suite.

You can also register a new kamergotchi with the kamergotchi.register() function. Simply run the register test script or call the function manually in your script.

node --harmony-async-await test/register.js

When you've obtained a player token, replace {myPlayerToken} with your token and run the program. You can check the progress of the bot on your phone in the Kamergotchi app.

Module

As stated, this package can also be used as a module in your NodeJS script. This module exposes several functions to utilize the Kamergotchi API yourself.

status(token)

const kamergotchi = require('kamergotchi')

let status = await kamergotchi.status(token)

if (status.error) {
  console.log(status.error.message)
} else {
  console.log('current score is ' + status.score)
}

spendCareOn(careType, token)

const kamergotchi = require('kamergotchi')

let updatedGame = await kamergotchi.spendCareOn('food', token)

if (updatedGame.error) {
  console.log(updatedGame.error.message)
} else {
  console.log('new score is ' + status.score)
}

claim(token)

const kamergotchi = require('kamergotchi')

let updatedGame = await kamergotchi.claim(token)

if (updatedGame.error) {
  console.log(updatedGame.error.message)
} else {
  console.log('new score is ' + status.score)
}

register(nickname)

const kamergotchi = require('kamergotchi')

let response = await kamergotchi.register('myawesomebot')
if (response.error) {
  console.log(response.error.message)
} else {
  let playerObject = response.player
  console.log('new player token is ' + playerObject.token)
  console.log('and our gotchi is ' + playerObject.currentGame.gotchi.displayName)
}

Updating

To update your kamergotchi-bot to a newer version, run the following command.

npm update -g kamergotchi

Contributing

If you'd like to contribute to this project, or file a bug or feature request, please head over to the issue tracker or open a pull request.

License

Copyright (c) 2017 @lesander All Rights Reserved.

This software is open-sourced under the MIT License (see the LICENSE file for the full license). So within some limits, you can do with the code whatever you want. However, if you like and/or want to re-use it, I'd really appreciate a reference to this project page.

The software is provided as is. It might work as expected - or not. Just don't blame me.