Advertisement
arthurcluet

Untitled

May 13th, 2022
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. // ==UserScript==
  2. // @name gomoku
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author You
  7. // @match https://gomoku.yjyao.com/
  8. // @icon https://www.google.com/s2/favicons?domain=yjyao.com
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (async function() {
  13. 'use strict';
  14.  
  15. // Your code here...
  16. let last = -1;
  17. let alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  18.  
  19. while(true){
  20. let m = Array.from(document.querySelectorAll("div[currentPlayer] > .gomoku-10 > div")).indexOf(document.querySelector('[isLastMove][spot="1"]'))
  21. if(m != last){
  22. last = m;
  23. let col = last % 15;
  24. let row = parseInt(last / 15);
  25. if(alphabet[col])
  26. console.log(alphabet[col] + "" + (row+1));
  27. }
  28. if(document.querySelector('[isprimary="true"]'))
  29. console.log("Nouvelle partie");
  30. await new Promise(r => setTimeout(r, 100));
  31. }
  32. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement