Dimka69

OWOT drawing script (Falling1)

Nov 5th, 2022 (edited)
258
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. keyheld = false;
  2. drawchar = "\u2588";
  3. drawcolor = 0x000000;
  4. function write(str) {
  5. for (let i = 0; i < str.length; i++) {
  6. w.typeChar(str.charAt(i))
  7. }
  8. };
  9.  
  10. function startdrawing() {
  11. if (!keyheld) return;
  12. if (getCharProtection(...currentPosition)) return;
  13. oldcolor = YourWorld.Color;
  14. YourWorld.Color = drawcolor;
  15. cursorCoords = currentPosition;
  16. renderCursor(cursorCoords);
  17. w.typeChar(drawchar, true);
  18. YourWorld.Color = oldcolor;
  19. };
  20. document.addEventListener('keyup', function (e) {
  21. if (e.code !== "F2") return;
  22. e.preventDefault();
  23. e.stopPropagation();
  24. keyheld = false;
  25. });
  26. document.addEventListener('keydown', function (e) {
  27. if (e.code !== "F2") return;
  28. e.preventDefault();
  29. e.stopPropagation();
  30. keyheld = true;
  31. startdrawing()
  32. });
  33.  
  34. document.addEventListener('mousemove', startdrawing);
  35. alert('hold f2 and move the cursor to draw');
Advertisement
Comments
Add Comment
Please, Sign In to add comment