Untitled

mail@pastecode.io avatarunknown
plain_text
a month ago
1.0 kB
2
Indexable
Never
// ==UserScript==
// @name         BabaPro Example Bot
// @namespace    http://gg.gg/babapro
// @version      1.0
// @description   BabaPro
// @author       shigerusensei
// @match        https://pixelplace.io/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=pixelplace.io
// @grant        unsafeWindow
// @require      https://tinyurl.com/B2B2APR0LIBRY
// ==/UserScript==
/* global NevinCore, NevinWaitForElm*/

const core = new babaproCore({
  timeout: 25
});

babaproWaitForElm('#canvas').then(function(c) {
  c.addEventListener('click', function() {
      const [sx, sy] = document.getElementById('coordinates').textContent.split(',').map(Number)
      core.picker.requestImageFromFileDialog(core.palette).then(a => {
          console.log(core.babaproWS.ws.readyState)
          a.image.addEventListener('load', function() {
              core.engine.tasks = [...core.engine.tasks, ...a.convertToTasks(sx,sy, core.babaproWS)]
          })
      })
  })
})