Skip to content

Instantly share code, notes, and snippets.

@kidsonfilms-python-rules
Last active March 5, 2021 18:27
Show Gist options
  • Save kidsonfilms-python-rules/73eb722c71a7da277a7e51942311d1d4 to your computer and use it in GitHub Desktop.
Save kidsonfilms-python-rules/73eb722c71a7da277a7e51942311d1d4 to your computer and use it in GitHub Desktop.
Spam a Text every 20 sec. in Node.js
var robot = require("robotjs");
var timerID = setInterval(function () {
robot.typeString(`i am a robot. This was developed by @kidsonfilms#4635`);
robot.keyTap('enter')
}, 20 * 1000);
var robot = require("robotjs");
var timerID = setInterval(function () {
var date_ob = new Date()
let date = ("0" + date_ob.getDate()).slice(-2);
// current month
let month = ("0" + (date_ob.getMonth() + 1)).slice(-2);
// current year
let year = date_ob.getFullYear();
// current hours
let hours = date_ob.getHours();
// current minutes
let minutes = date_ob.getMinutes();
// current seconds
let seconds = date_ob.getSeconds();
robot.typeString(`i am a robot, this action was performed at ${year + "-" + month + "-" + date + " " + hours + ":" + minutes + ":" + seconds} to prove i am a robot. This was developed by @kidsonfilms#4635`);
robot.keyTap('enter')
}, 20 * 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment