Last active
March 5, 2021 18:27
-
-
Save kidsonfilms-python-rules/73eb722c71a7da277a7e51942311d1d4 to your computer and use it in GitHub Desktop.
Spam a Text every 20 sec. in Node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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