Slither.io-bot: An automated test

Created on 4 Jun 2016  Â·  10Comments  Â·  Source: ErmiyaEskandary/Slither.io-bot

from the wiki:

To test the bot, which is required for new commits or pull requests , simply run it for a long time - 30 games is the minimum but more is appreciated. Scores will be collected in the bot.scores variable, which can be viewed with the browser's developer console.

It would be much easier to be able to run a standard test (sort of benchmark), which, for example:

  • measures the average scores
  • disables the drawing
  • measures the average fps
  • (maybe even check the load of the new added features?)

for both the new and the current version of the bot.

I was thinking of a small piece of software to put in the code, and the software creates several windows, and displays the average stats from all windows together. (Could this been done using Electron?)

Maybe we could extend it later to something like discussed in #101

feedback-needed important feature suggestion

Most helpful comment

Well... no I wasn't thinking of automatically logging users' scores (in fact I wouldn't want to do that feature).

I was thinking of a new menu toggle (what letters are still unused? let's say 'R' for the sake of argument) that disables drawing the graphics. This helps testing, because when the drawing is disabled you can run more bots without overloading the CPU.

All 10 comments

@K00sKlust Have a go at it! Sounds like a good idea!

Related to #265

What I think would be even easier is a "testing mode" toggle for disabling the drawing. Electron is waaay too complicated; it's not going to make our lives easier compared to manual testing.

A "testing mode" built into the bot could be written up pretty quickly, and give us a better test experience right away.

A "testing mode" built into the bot could be written up pretty quickly, and give us a better test experience right away.

Remote logs users statistics?

Well... no I wasn't thinking of automatically logging users' scores (in fact I wouldn't want to do that feature).

I was thinking of a new menu toggle (what letters are still unused? let's say 'R' for the sake of argument) that disables drawing the graphics. This helps testing, because when the drawing is disabled you can run more bots without overloading the CPU.

I understand Thank you for explanation :+1:

@ChadSki For the testing key, we could disable graphics - yeah that's a good idea
How would we "comment it out" ? Stupid question nvm - we can just set it to null. Any other easier way?

I think we should leave the variable original_redraw alone because then the name remains accurate.

We can make a new variable redraw_graphics_fn that's usually set to original_redraw, but sometimes is set to an empty lambda.

When the key toggle is pressed, it swaps the current redraw_graphics_fn for the other one, turning graphics rendering on or off.

I skimmed with http://phantomjs.org/ next ran

var page = require('webpage').create();
page.open('http://slither.io/', function(status) {
  console.log("Status: " + status);
  if(status === "success") {
    page.render('slither-io.png');
  }
  phantom.exit();
});

resulting
slither-io

Unfortunately I'm not sure how to inject our code.

(my 2 cents)

I would recommend to do it like https://github.com/ErmiyaEskandary/Slither.io-bot/commit/7da5f7e90bdf920ca6e39232a4b6619f41a6e97b maybe.

I skimmed with http://phantomjs.org/ next ran

var page = require('webpage').create();page.open('http://slither.io/', function(status) {
console.log("Status: " + status);
if(status === "success") {
page.render('slither-io.png');
}
phantom.exit();
});

resulting
[image: slither-io]
https://cloud.githubusercontent.com/assets/371014/15831590/a7d1e208-2c1e-11e6-962d-db7492c4ac05.png

Unfortunately I'm not sure how to inject our code.

(my 2 cents)

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/ErmiyaEskandary/Slither.io-bot/issues/291#issuecomment-224032918,
or mute the thread
https://github.com/notifications/unsubscribe/ABPCHADIy8oGO7cnrglJG47P7QWoO5A1ks5qJFxtgaJpZM4IuJ9c
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ChadSki picture ChadSki  Â·  7Comments

ghost picture ghost  Â·  10Comments

jellybabies picture jellybabies  Â·  7Comments

tyschnoor picture tyschnoor  Â·  11Comments

Tomboman picture Tomboman  Â·  5Comments