Skip to content

Commit da36ebd

Browse files
committed
provide more delays for minecraft
1 parent 494b990 commit da36ebd

3 files changed

Lines changed: 189 additions & 160 deletions

File tree

Macropad_Hotkeys/macros/minecraft-messages.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# NOTE: There appears to be some delay when bringing up the command screen.
1010

1111
DELAY_AFTER_SLASH = 0.80 # required so minecraft has time to bring up command screen
12-
12+
DELAY_BEFORE_RETURN = 0.10
1313

1414
# NOTE: On PC, characters are sometimes lost due to lag. No simple fix for
1515
# lost keystrokes is known. However, the commands do work most of the time.
@@ -23,15 +23,15 @@
2323
(0x000020, 'list', [
2424
'/', DELAY_AFTER_SLASH,
2525
'list',
26-
Keycode.RETURN, -Keycode.RETURN]),
26+
DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]),
2727
(0x000020, 'list', [
2828
'/', DELAY_AFTER_SLASH,
2929
'list',
30-
Keycode.RETURN, -Keycode.RETURN]),
30+
DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]),
3131
(0x000020, 'list', [
3232
'/', DELAY_AFTER_SLASH,
3333
'list',
34-
Keycode.RETURN, -Keycode.RETURN]),
34+
DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]),
3535
# 2nd row ----------
3636
(0x000000, '', []),
3737
(0x000000, '', []),
@@ -44,15 +44,15 @@
4444
(0x101010, 'bed', [
4545
'/', DELAY_AFTER_SLASH,
4646
'msg @a Time for bed!',
47-
Keycode.RETURN, -Keycode.RETURN]),
47+
DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]),
4848
(0x101010, 'bed', [
4949
'/', DELAY_AFTER_SLASH,
5050
'msg @a Time for bed!',
51-
Keycode.RETURN, -Keycode.RETURN]),
51+
DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]),
5252
(0x101010, 'bed', [
5353
'/', DELAY_AFTER_SLASH,
5454
'msg @a Time for bed!',
55-
Keycode.RETURN, -Keycode.RETURN]),
55+
DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]),
5656
# Encoder button ---
5757
(0x000000, '', [])
5858
]

Macropad_Hotkeys/macros/minecraft-pe-effects.py

Lines changed: 41 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
# See https://minecraft.fandom.com/wiki/Effect
1010

11-
DELAY_AFTER_ESCAPE = 0.05
11+
DELAY_AFTER_SLASH = 0.80 # required so minecraft has time to bring up command screen
12+
DELAY_BEFORE_RETURN = 0.10 # give minecraft time to show all the keys pressed...
1213

1314
app = { # REQUIRED dict, must be named 'app'
1415
'name' : 'Minecraft PE (effect)', # Application name
@@ -20,73 +21,60 @@
2021
# COLOR LABEL KEY SEQUENCE
2122
# 1st row ----------
2223
(0x002000, 'speed', [
23-
Keycode.ESCAPE, -Keycode.ESCAPE, DELAY_AFTER_ESCAPE,
24-
'/effect @s speed 999999999 1 true',
25-
Keycode.RETURN, -Keycode.RETURN,
26-
Keycode.ESCAPE, -Keycode.ESCAPE]),
24+
'/', DELAY_AFTER_SLASH,
25+
'effect @s speed 999999999 1 true',
26+
DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]),
2727
(0x002000, 'str', [
28-
Keycode.ESCAPE, -Keycode.ESCAPE, DELAY_AFTER_ESCAPE,
29-
'/effect @s strength 999999999 1 true',
30-
Keycode.RETURN, -Keycode.RETURN,
31-
Keycode.ESCAPE, -Keycode.ESCAPE]),
28+
'/', DELAY_AFTER_SLASH,
29+
'effect @s strength 999999999 1 true',
30+
DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]),
3231
(0x002000, 'haste', [
33-
Keycode.ESCAPE, -Keycode.ESCAPE, DELAY_AFTER_ESCAPE,
34-
'/effect @s haste 999999999 1 true',
35-
Keycode.RETURN, -Keycode.RETURN,
36-
Keycode.ESCAPE, -Keycode.ESCAPE]),
32+
'/', DELAY_AFTER_SLASH,
33+
'effect @s haste 999999999 1 true',
34+
DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]),
3735
# 2nd row ----------
3836
(0x002000, 'jump', [
39-
Keycode.ESCAPE, -Keycode.ESCAPE, DELAY_AFTER_ESCAPE,
40-
'/effect @s jump_boost 999999999 1 true',
41-
Keycode.RETURN, -Keycode.RETURN,
42-
Keycode.ESCAPE, -Keycode.ESCAPE]),
37+
'/', DELAY_AFTER_SLASH,
38+
'effect @s jump_boost 999999999 1 true',
39+
DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]),
4340
(0x000030, 'breath', [
44-
Keycode.ESCAPE, -Keycode.ESCAPE, DELAY_AFTER_ESCAPE,
45-
'/effect @s water_breathing 999999999 0 true',
46-
Keycode.RETURN, -Keycode.RETURN,
47-
Keycode.ESCAPE, -Keycode.ESCAPE]),
41+
'/', DELAY_AFTER_SLASH,
42+
'effect @s water_breathing 999999999 0 true',
43+
DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]),
4844
(0x202020, 'darkv', [
49-
Keycode.ESCAPE, -Keycode.ESCAPE, DELAY_AFTER_ESCAPE,
50-
'/effect @s night_vision 999999999 0 true',
51-
Keycode.RETURN, -Keycode.RETURN,
52-
Keycode.ESCAPE, -Keycode.ESCAPE]),
45+
'/', DELAY_AFTER_SLASH,
46+
'effect @s night_vision 999999999 0 true',
47+
DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]),
5348
# 3rd row ----------
5449
(0x300000, 'health', [
55-
Keycode.ESCAPE, -Keycode.ESCAPE, DELAY_AFTER_ESCAPE,
56-
'/effect @s health_boost 999999999 4 true',
57-
Keycode.RETURN, -Keycode.RETURN,
58-
Keycode.ESCAPE, -Keycode.ESCAPE]),
50+
'/', DELAY_AFTER_SLASH,
51+
'effect @s health_boost 999999999 4 true',
52+
DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]),
5953
(0x300000, 'regen', [
60-
Keycode.ESCAPE, -Keycode.ESCAPE, DELAY_AFTER_ESCAPE,
61-
'/effect @s regeneration 999999999 4 true',
62-
Keycode.RETURN, -Keycode.RETURN,
63-
Keycode.ESCAPE, -Keycode.ESCAPE]),
54+
'/', DELAY_AFTER_SLASH,
55+
'effect @s regeneration 999999999 4 true',
56+
DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]),
6457
(0x002000, 'absorb', [
65-
Keycode.ESCAPE, -Keycode.ESCAPE, DELAY_AFTER_ESCAPE,
66-
'/effect @s absorption 999999999 3 true',
67-
Keycode.RETURN, -Keycode.RETURN,
68-
Keycode.ESCAPE, -Keycode.ESCAPE]),
58+
'/', DELAY_AFTER_SLASH,
59+
'effect @s absorption 999999999 3 true',
60+
DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]),
6961
# 4th row ---------
7062
(0x002000, 'resist', [
71-
Keycode.ESCAPE, -Keycode.ESCAPE, DELAY_AFTER_ESCAPE,
72-
'/effect @s resistance 999999999 3 true',
73-
Keycode.RETURN, -Keycode.RETURN,
74-
Keycode.ESCAPE, -Keycode.ESCAPE]),
63+
'/', DELAY_AFTER_SLASH,
64+
'effect @s resistance 999999999 3 true',
65+
DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]),
7566
(0x101010, 'invis', [
76-
Keycode.ESCAPE, -Keycode.ESCAPE, DELAY_AFTER_ESCAPE,
77-
'/effect @s invisibility 999999999 0 true',
78-
Keycode.RETURN, -Keycode.RETURN,
79-
Keycode.ESCAPE, -Keycode.ESCAPE]),
67+
'/', DELAY_AFTER_SLASH,
68+
'effect @s invisibility 999999999 0 true',
69+
DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]),
8070
(0x300000, 'fire_r', [
81-
Keycode.ESCAPE, -Keycode.ESCAPE, DELAY_AFTER_ESCAPE,
82-
'/effect @s fire_resistance 999999999 0 true',
83-
Keycode.RETURN, -Keycode.RETURN,
84-
Keycode.ESCAPE, -Keycode.ESCAPE]),
71+
'/', DELAY_AFTER_SLASH,
72+
'effect @s fire_resistance 999999999 0 true',
73+
DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]),
8574
# Encoder button --- Remove all status effects....
8675
(0x000000, '', [
87-
Keycode.ESCAPE, -Keycode.ESCAPE, DELAY_AFTER_ESCAPE,
88-
'/effect @s clear',
89-
Keycode.RETURN, -Keycode.RETURN,
90-
Keycode.ESCAPE, -Keycode.ESCAPE]),
76+
'/', DELAY_AFTER_SLASH,
77+
'effect @s clear',
78+
DELAY_BEFORE_RETURN, Keycode.RETURN, -Keycode.RETURN]),
9179
]
9280
}

0 commit comments

Comments
 (0)