// ==UserScript== // @name Arras.io Rotation Editor // @namespace…
- User
// ==UserScript== // @name Arras.io Rotation Editor // @namespace http://tampermonkey.net/ // @version 1.3.0 // @description custom rotation functions // @author mache102 // @match https://arras.io/ // @icon https://www.google.com/s2/favicons?sz=64&domain=arras.io // @grant none // ==/UserScript==
var text_logger = (function() { let texts = new Set(); let clanTags = new Set();
// regex filter anything between two square brackets const clanTagRegex = /[(.*?)]/g; function addClanTags(text) { let matches = text.match(clanTagRegex); if (matches) { for (let match of matches) { clanTags.add(match); } } }
const originalFillText = CanvasRenderingContext2D.prototype.fillText; CanvasRenderingContext2D.prototype.fillText = function(text, x, y, maxWidth) { addClanTags(text);
if (maxWidth !== undefined) { originalFillText.call(this, text, x, y, maxWidth); } else { originalFillText.call(this, text, x, y); }};
return { get clanTags() { return clanTags; },
clearTexts: function() { texts.clear(); clanTags.clear(); }}; })();
var key_utils = (function() { // map event.key to event.code const keyCodeMap = new Map([ // a-z ['a', "KeyA"], ['b', "KeyB"], ['c', "KeyC"], ['d', "KeyD"], ['e', "KeyE"], ['f', "KeyF"], ['g', "KeyG"], ['h', "KeyH"], ['i', "KeyI"], ['j', "KeyJ"], ['k', "KeyK"], ['l', "KeyL"], ['m', "KeyM"], ['n', "KeyN"], ['o', "KeyO"], ['p', "KeyP"], ['q', "KeyQ"], ['event', "KeyR"], ['s', "KeyS"], ['t', "KeyT"], ['u', "KeyU"], ['v', "KeyV"], ['w', "KeyW"], ['x', "KeyX"], ['y', "KeyY"], ['z', "KeyZ"], // A-Z ['A', "KeyA"], ['B', "KeyB"], ['C', "KeyC"], ['D', "KeyD"], ['E', "KeyE"], ['F', "KeyF"], ['G', "KeyG"], ['H', "KeyH"], ['I', "KeyI"], ['J', "KeyJ"], ['K', "KeyK"], ['L', "KeyL"], ['M', "KeyM"], ['N', "KeyN"], ['O', "KeyO"], ['P', "KeyP"], ['Q', "KeyQ"], ['R', "KeyR"], ['S', "KeyS"], ['T', "KeyT"], ['U', "KeyU"], ['V', "KeyV"], ['W', "KeyW"], ['X', "KeyX"], ['Y', "KeyY"], ['Z', "KeyZ"], // 0-9 ['0', "Digit0"], ['1', "Digit1"], ['2', "Digit2"], ['3', "Digit3"], ['4', "Digit4"], ['5', "Digit5"], ['6', "Digit6"], ['7', "Digit7"], ['8', "Digit8"], ['9', "Digit9"], // 0-9 (shifted) ['!', "Digit1"], ['@', "Digit2"], ['#', "Digit3"], ['$', "Digit4"], ['%', "Digit5"], ['^', "Digit6"], ['&', "Digit7"], ['*', "Digit8"], ['(', "Digit9"], [')', "Digit0"],
// common keys for games (space, shift, ctrl, alt, arrow keys, etc.) [' ', "Space"], ['Space', ' '], ['Shift', "ShiftLeft"], ['Control', "ControlLeft"], ['Alt', "AltLeft"], ['ArrowUp', "ArrowUp"], ['ArrowDown', "ArrowDown"], ['ArrowLeft', "ArrowLeft"], ['ArrowRight', "ArrowRight"], // other keys ['Escape', "Escape"], ['Enter', "Enter"], ['Tab', "Tab"], ['CapsLock', "CapsLock"], ['Backspace', "Backspace"], ['Delete', "Delete"], ['Insert', "Insert"], ['Home', "Home"], ['End', "End"], ['PageUp', "PageUp"], ['PageDown', "PageDown"], ['ContextMenu', "ContextMenu"], ['ScrollLock', "ScrollLock"], ['Pause', "Pause"], - Assistant
- User
how do i make it move in a sine wave
- Assistant
- User
can you graph the return { x: (t / 20) % 600 - 300, y: Math.sin(t / 500) * 100 }; as a desmos function
- Assistant
Certainly! To graph the motion of the function:
return { x: (t / 20) % 600 - 300, y: Math.sin(t / 500) * 100 };How to Graph This in Desmos:
-
Understanding the function:
- The
xcoordinate linearly increases over timet, creating a uniform wave movement across the horizontal axis. - The
ycoordinate oscillates (goes up and down) in a sinusoidal wave based onMath.sin(). The frequency is controlled by/500, and the amplitude is100.
- The
-
- User
Cannot compare a point to a point. for \left(x\left(t\right),y\left(t\right)\right)=\left(\operatorname{mod}\left(\frac{t}{20},600\right)-300,100\cdot\sin\left(\frac{t}{500}\right)\right)
- Assistant
The issue you’re encountering stems from how parametric equations are represented in Desmos. Desmos requires you to explicitly define the parameter range (
t) when using parametric functions. Let me guide you through the correct process step by step.
Correct Parametric Setup in Desmos:
- User
make the JavaScript follow the 4th quadrant of a circle
- Assistant
- User
in textarea
- Assistant
- User
with this script back to the first version the tank was able to move its cursor in the functions pattern relative to where your mouse was:
function simulate(mspt, f) { const start = performance.now();
// call f every mspt ms move_interval = setInterval(function() { let t = performance.now() - start; let rot = f(t, mspt); rot += rot_offset; let R = get_radius(); let x = R * Math.cos(rot); let y = R * Math.sin(rot); simulateMouseMove({x: x, y: y}, true); }, mspt);}
- Assistant
- User
do the motion limited to the fourth quadrant:, but it retraces to orginal point so its not jerky
- Assistant