Closed tionis closed 4 years ago
The Script that was used to produce the issue:
#!/usr/bin/env -S deno run --unstable --allow-net --allow-plugin --allow-env --allow-read --allow-write
import AutoPilot from 'https://raw.githubusercontent.com/divy-work/autopilot-deno/master/mod.ts';
var pilot = new AutoPilot();
var screenSize = pilot.screenSize();
var widthUnit: number = screenSize.heigth / 8;
setInterval(function () {
var position = pilot.mousePosition();
if (position.x > widthUnit * 2) {
pilot.moveMouse(widthUnit,position.y)
}else{
pilot.moveMouse(widthUnit*3,position.y)
}
}, 200);
@tionis The problem is with your script. The widthUnit
is passed as NaN
so it breaks(it should be a number). I'll add type checks for the same but this is a problem with your script.
var widthUnit: number = screenSize.heigth / 8; <-- typo with `height`!!
console.log(widthUnit); // <-- this is NaN
@tionis I've added typechecks for the method arguments. If you try again with the same script, You will get a similar output to this: https://shareit.video/1hvk1lnw6NGNShG0tjVP
I see, the error in the script was a Typo screenSize.heigth to screenSize.height. Seems to be the error of the day for me.
After following the fixes from #3 I get rust panic with following stacktrace: