-
Notifications
You must be signed in to change notification settings - Fork 0
/
anti-afk.ino
51 lines (44 loc) · 1.24 KB
/
anti-afk.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "DigiKeyboard.h"
#include <stdlib.h>
const int LED_PIN = 1; // Pin for the LED
int ledState = LOW; // Starting state of the LED
void setup() {
pinMode(LED_PIN, OUTPUT);
}
void loop() {
// Press and release the W button
digitalWrite(LED_PIN, HIGH);
DigiKeyboard.sendKeyPress(KEY_W);
delay(1000);
DigiKeyboard.sendKeyPress(0);
digitalWrite(LED_PIN, LOW);
delay(random(5000, 50000));
// Press and release the S button
digitalWrite(LED_PIN, HIGH);
DigiKeyboard.sendKeyPress(KEY_S);
delay(1000);
DigiKeyboard.sendKeyPress(0);
digitalWrite(LED_PIN, LOW);
delay(random(5000, 50000));
// Press and release the A button
digitalWrite(LED_PIN, HIGH);
DigiKeyboard.sendKeyPress(KEY_A);
delay(1000);
DigiKeyboard.sendKeyPress(0);
digitalWrite(LED_PIN, LOW);
delay(random(5000, 50000));
// Press and release the D button
digitalWrite(LED_PIN, HIGH);
DigiKeyboard.sendKeyPress(KEY_D);
delay(1000);
DigiKeyboard.sendKeyPress(0);
digitalWrite(LED_PIN, LOW);
delay(random(5000, 50000));
// Press and release the SPACE button
digitalWrite(LED_PIN, HIGH);
DigiKeyboard.sendKeyPress(KEY_SPACE);
delay(1000);
DigiKeyboard.sendKeyPress(0);
digitalWrite(LED_PIN, LOW);
delay(random(5000, 50000));
}