Gather Cookie Finder

gather cookie stealer!

  1. // ==UserScript==
  2. // @name Gather Cookie Finder
  3. // @namespace http://talhahabib.com/
  4. // @version 0.1
  5. // @description gather cookie stealer!
  6. // @author Talha Habib
  7. // @match *://*.gather.town/*
  8. // @icon https://www.google.com/s2/favicons?domain=greasyfork.org
  9. // @grant none
  10. // ==/UserScript==
  11. (function() {
  12. 'use strict';
  13. var exec = false;
  14. var find = (str, autoMove = true, findTill = 2, teleportBackIn = 10) => {
  15. var c = 1;
  16. var intr = setInterval(() => {
  17. var o = game.completeMaps[gameSpace.mapId].objects; // current game objects
  18. var e = Object.keys(o); // converted to array
  19. var b = o[e.filter(s => o[s].id == str)]; // finding id for given string
  20. var p = game.players[gameSpace.id]; // player position
  21.  
  22. console.log(++c); // indicator
  23. if (b) { // object found
  24. if(autoMove){
  25. game.teleport(0, b.x, b.y); // teleporting to found object
  26. setTimeout(() => game.teleport(0, p.x, p.y), 1000 * teleportBackIn); // player going back to original position where he teleported from
  27. }
  28. clearInterval(intr) // stop interval
  29. exec = false // unlock trigger
  30. }
  31. }, 1000); // 1s ticker
  32. setTimeout(() => { // max limit
  33. clearInterval(intr) // stop interval
  34. exec = false // unlock trigger
  35. }, 1000 * 60 * findTill); // find till 2 minute default
  36. return intr;
  37. }
  38. var keys = [];
  39. document.addEventListener("keydown", function(zEvent) {
  40. // alt + f on windows
  41. // option + f on mac
  42. keys.push(zEvent.code)
  43. if (keys.includes("KeyF") && (keys.includes("AltRight") || keys.includes("AltLeft")) && !exec) {
  44. console.log('triggered')
  45. find('COOKIE-HUNT-COOKIE')
  46. exec = true;
  47. }
  48. });
  49. document.addEventListener('keyup', () => keys = []);
  50. // Your code here...
  51. })();