Skip to content

Commit 7f9093f

Browse files
committed
added stopAfter
1 parent cca7e23 commit 7f9093f

File tree

3 files changed

+46
-7
lines changed

3 files changed

+46
-7
lines changed

README.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ A python script to auto send commands in Discord or any other program.
55
<img alt="Python3" src="https://img.shields.io/badge/-Python3-3776AB?style=flat-square&logo=Python&logoColor=white" />
66
>DISCLAIMER
77
**Use at your own risk!** I am not responsible if you get banned for spamming or using autotype. I do not take responsibility for how you use this program nor do I recommend you use it in any way that may infringe on any software / buisness.
8+
This program is not endorsed or affiliated with Discord or any bot for Discord. Usage of this application may also cause a violation of the agreed Terms of Service between you and Discord or a bot.
9+
10+
# Features
11+
- #### Start / Stop via hotkey
12+
- #### Supports sending one time commands via hotkey
13+
- #### Supports individually timed commands
14+
- #### Supports ratelimit for sending messages in Discord
15+
- #### Supports auto stop after certain time
16+
- #### Supports randomly skipping commands to avoid blacklisting and ban
17+
818

919
# Installation
1020
Download the repo as a zip and extract it to a folder. Open a command prompt in that folder and and then run the command `pip install -r requirements.txt` (needs Python3 and pip).
@@ -13,6 +23,7 @@ Download the repo as a zip and extract it to a folder. Open a command prompt in
1323
- Rename the file `settings-example.json` to `settings.json`.
1424
- Edit the `settings.json` as per your need (read settings.json section below)
1525
- Open a command prompt in the folder and run `python autotyper.py` or simply run the file `run.cmd` (Windows)
26+
.If you have python3 installed separately run `python3 autotyper.py`
1627
- Now either go to the discord web app or desktop app and click on the textbox
1728
- Finally press the hotkey to start the autotyping
1829

@@ -29,6 +40,7 @@ This is the configuration file used by the program.
2940
| showKeyCode | boolean | Used as a helper to show the `KeyCode` of the pressed key |
3041
| randomSkip | float | A value from 0 to 1 indicating whether to skip a command randomly to prevent ban and blacklisting |
3142
| randomTime | integer | The maximum value in seconds to choose the random delay between commands (value is added to `waittime`) |
43+
| stopAfter | float | The time in minutes to stop the autotyping after. (set to `-1` for infinite autotype) |
3244
| commands | array | An array of `command object` |
3345
| onetime | object | A JS object containing some settings. See `onetime object` below |
3446

@@ -60,6 +72,7 @@ You want to send the command `pls beg` after every 45s with a random delay. You
6072
"showKeyCode": false,
6173
"randomSkip": 0.2,
6274
"randomTime": 60,
75+
"stopAfter": -1,
6376
"commands": [
6477
{
6578
"text": "pls beg",
@@ -75,7 +88,7 @@ You want to send the command `pls beg` after every 45s with a random delay. You
7588
}
7689
```
7790
##### Multiple commands
78-
You want to send the command `pls beg` after every 45s with a random delay, `pls fish` after 40s with no random delay and `pls hunt` after 40s with a random delay. You don't want a command to be skipped randomly. The start/stop key is F9 and the exit key is F10. Then the following is the `setttings.json` file:
91+
You want to send the command `pls beg` after every 45s with a random delay, `pls fish` after 40s with no random delay and `pls hunt` after 40s with a random delay. You don't want a command to be skipped randomly. The start/stop key is F9 and the exit key is F10. Then the following will be the `setttings.json` file:
7992
```json
8093
{
8194
"hotkey": "Key.f9",
@@ -84,6 +97,7 @@ You want to send the command `pls beg` after every 45s with a random delay, `pls
8497
"showKeyCode": false,
8598
"randomSkip": 0.2,
8699
"randomTime": 60,
100+
"stopAfter": -1,
87101
"commands": [
88102
{
89103
"text": "pls beg",
@@ -110,7 +124,7 @@ You want to send the command `pls beg` after every 45s with a random delay, `pls
110124
```
111125
##### Using onetime commands
112126
You want the commands `pls sell fish all` , `pls sell deer all` and `pls sell bread all` to be sent when the `F7` key is pressed. The delay between each command is 4s.
113-
The following will be the `onetime` object:
127+
Then the following will be the `onetime` object:
114128
```json
115129
{
116130
"key": "Key.f7",
@@ -122,8 +136,17 @@ The following will be the `onetime` object:
122136
]
123137
}
124138
```
125-
## Legal Warning
126-
This application is not endorsed or affiliated with Discord or any bot for Discord. Usage of this application may also cause a violation of the agreed Terms of Service between you and Discord or a bot.
139+
##### Using auto stop after
140+
You want the autotype to automatically stop after `4hrs`. Then the following will be the `settings.json` file:
141+
```json
142+
{
143+
...,
144+
...,
145+
"stopAfter": 240,
146+
...,
147+
...
148+
}
149+
```
127150

128151
## Prevent Bans and Blacklisting
129152
- Make a new server with a few channels and invite the bot you want to use the commands on.

autotyper.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,23 @@
3333
onetime_delay = int(settings["onetime"]["delay"])
3434
randomTime = int(settings["randomTime"])
3535
command_delay = float(settings["commandDelay"])
36+
stop_after = float(settings["stopAfter"])
3637
controller = Controller()
3738

3839

40+
def stop_typer():
41+
global started
42+
if started:
43+
started = False
44+
print("Auto stopped.")
45+
46+
47+
def start_stop_after():
48+
global stop_after
49+
if stop_after > 0:
50+
Timer(stop_after*60, stop_typer).start()
51+
52+
3953
def send_command(text):
4054
global controller
4155
controller.type(text)
@@ -114,6 +128,7 @@ def on_key_press(key):
114128
if started:
115129
print("Started.")
116130
init_typer()
131+
start_stop_after()
117132
else:
118133
print("Stopped.")
119134
if key == settings["exitkey"]:

settings-example.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"commandDelay": 1,
55
"showKeyCode": true,
66
"randomSkip": 0.1,
7-
"randomTime": 60,
7+
"randomTime": 45,
8+
"stopAfter": -1,
89
"commands": [
910
{
1011
"text": "first command",
@@ -13,12 +14,12 @@
1314
},
1415
{
1516
"text": "second command",
16-
"waittime": 40,
17+
"waittime": 30,
1718
"randomtime": true
1819
},
1920
{
2021
"text": "third command",
21-
"waittime": 40,
22+
"waittime": 5,
2223
"randomtime": true
2324
}
2425
],

0 commit comments

Comments
 (0)