Created
October 27, 2016 15:25
-
-
Save rjriel/3b7fe3cb0c73bbb6c311aee985c86c7b to your computer and use it in GitHub Desktop.
PERFORM MOVE (ATTACK ONLY)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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