Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- keyheld = false;
- drawchar = "\u2588";
- drawcolor = 0x000000;
- function write(str) {
- for (let i = 0; i < str.length; i++) {
- w.typeChar(str.charAt(i))
- }
- };
- function startdrawing() {
- if (!keyheld) return;
- if (getCharProtection(...currentPosition)) return;
- oldcolor = YourWorld.Color;
- YourWorld.Color = drawcolor;
- cursorCoords = currentPosition;
- renderCursor(cursorCoords);
- w.typeChar(drawchar, true);
- YourWorld.Color = oldcolor;
- };
- document.addEventListener('keyup', function (e) {
- if (e.code !== "F2") return;
- e.preventDefault();
- e.stopPropagation();
- keyheld = false;
- });
- document.addEventListener('keydown', function (e) {
- if (e.code !== "F2") return;
- e.preventDefault();
- e.stopPropagation();
- keyheld = true;
- startdrawing()
- });
- document.addEventListener('mousemove', startdrawing);
- alert('hold f2 and move the cursor to draw');
Advertisement
Comments
-
- hallo am human being i have a new one where you dont have to hold down a key
Add Comment
Please, Sign In to add comment