playground hustler - for chopcoin.io

creates an alert box when someone enters a paid room, so you can do something else while waiting for other players

  1. // ==UserScript==
  2. // @name playground hustler - for chopcoin.io
  3. // @namespace namespace
  4. // @description creates an alert box when someone enters a paid room, so you can do something else while waiting for other players
  5. // @include http://chopcoin.io/*
  6. // @version 1.03
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10.  
  11. var playOnce = true;
  12. checkPlayers();
  13.  
  14. function checkPlayers() {
  15. var players = chopcoin.game.leaderboard.list.length;
  16. var pot = chopcoin.game.pot;
  17. if (players > 1 && playOnce && pot != 0) {
  18. alert('multiple players');
  19. playOnce = false;
  20. console.log('multiple players');
  21. }
  22. else if(players == 1) {
  23. playOnce = true;
  24. console.log('player reset');
  25. }
  26. setTimeout(function(){ checkPlayers(); }, 1000);
  27. }
  28.