Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name gomoku
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @match https://gomoku.yjyao.com/
- // @icon https://www.google.com/s2/favicons?domain=yjyao.com
- // @grant none
- // ==/UserScript==
- (async function() {
- 'use strict';
- // Your code here...
- let last = -1;
- let alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- while(true){
- let m = Array.from(document.querySelectorAll("div[currentPlayer] > .gomoku-10 > div")).indexOf(document.querySelector('[isLastMove][spot="1"]'))
- if(m != last){
- last = m;
- let col = last % 15;
- let row = parseInt(last / 15);
- if(alphabet[col])
- console.log(alphabet[col] + "" + (row+1));
- }
- if(document.querySelector('[isprimary="true"]'))
- console.log("Nouvelle partie");
- await new Promise(r => setTimeout(r, 100));
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement