Skip to content

Instantly share code, notes, and snippets.

@rjriel
Created October 27, 2016 15:25
Show Gist options
  • Save rjriel/3b7fe3cb0c73bbb6c311aee985c86c7b to your computer and use it in GitHub Desktop.
Save rjriel/3b7fe3cb0c73bbb6c311aee985c86c7b to your computer and use it in GitHub Desktop.
PERFORM MOVE (ATTACK ONLY)
let performMove = () => {
// this is where we would put our logic for deciding which move to make
// here we are just attacking all the time. We should probably be more
// creative than this. If we don't heal our Qritter will most likely be
// defeated in no time.
let body = {action: "attack"}
let options = createOptions("moves", "POST", body)
request.post(options, (error, res, body) => {
if (error || res.statusCode !== 200) {
console.log("Error Performing Move", error || res.body)
} else {
console.log(`attack performed successfully`)
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment