Sleazy Fork is available in English.

Braains.io Assistant

Allows you to toggle shop & chat window with keyboard. More coming idk when.

  1. // ==UserScript==
  2. // @name Braains.io Assistant
  3. // @icon http://i.imgur.com/Uty76J1.png
  4. // @namespace https://greasyfork.org/users/90770
  5. // @version 0.11
  6. // @description Allows you to toggle shop & chat window with keyboard. More coming idk when.
  7. // @author n0thing
  8. // @match http://braains.io/*
  9. // @grant none
  10. // @run-at document-end
  11. // ==/UserScript==
  12. (function() {
  13. 'use strict';
  14. window.addEventListener('load', function() { //run script on page load
  15. var check = false,
  16. keyShop = 32, //toggle shop key 32 = SPACEBAR
  17. keyChat = 69, //toggle chat key 69 = E
  18. enableChat = true,
  19. enableShop = true;
  20.  
  21. document.getElementById('message').onblur = function() {
  22. check = false;
  23. }; //chat DOESN'T have focus
  24. document.getElementById('message').onfocus = function() {
  25. check = true;
  26. }; //chat HAS focus
  27.  
  28. document.body.addEventListener('keyup', function() {
  29.  
  30. //toggle shop
  31. if (parseInt(event.keyCode) === keyShop&&enableShop === true&&check === false) {
  32. if (document.getElementById('modd-shop-modal').getAttribute('style') === 'display: block;') { //checks if shop is open
  33. document.getElementById('modd-shop-modal').click();
  34. } // if yes, close it
  35. else {
  36. document.getElementById('modd-shop-div').getElementsByTagName('button')[0].click();
  37. } //else, open it
  38. }
  39.  
  40. //toggle chat
  41. if (parseInt(event.keyCode) === keyChat&&enableChat === true&&check === false) {
  42. if (document.getElementById('chat-box').getAttribute('style') === 'bottom: 0px; display: none') { //if hidden
  43. document.getElementById('chat-box').setAttribute('style', 'bottom: 0px; display: block');
  44. } //then make it appear
  45. else {
  46. document.getElementById('chat-box').setAttribute('style', 'bottom: 0px; display: none');
  47. } //else hide it
  48. }
  49.  
  50. if (parseInt(event.keyCode) === 0 &&check === false){
  51. var z = 4;while(z--){document.getElementById('confirm-purchase-button').click();}}
  52. });
  53. }, true);
  54. })();