Skip to content

Commit 0d16ad6

Browse files
committed
Merge branch 'develop' into playback_class_interface
2 parents 2fab34a + 36aac90 commit 0d16ad6

File tree

4 files changed

+29
-30
lines changed

4 files changed

+29
-30
lines changed

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
Literally Automate the boring stuff with Python, allows the user to record his mouse and keyboard
55
actions and reproduce them identically as many times as he wants.
66

7+
# Use cases
8+
I've mainly used it to automate gold/point/XP farming in games, I think this can also be used to:
9+
10+
- Automate a demo during a conference for example
11+
- Automate UAT in the devops process (as long as you're making something with a GUI).
12+
13+
If you use it for something really cool you can always reach me at github (at) rmpr (dot) xyz or drop
14+
a PR :). Bonus points if you have a demo video.
715

816
# Install instructions
917

@@ -16,8 +24,8 @@ from [here](https://github.com/rmpr/atbswp/releases)
1624

1725
Fedora
1826
```shell
27+
sudo dnf install python3-wxpython4 python3-xlib python3-tkinter
1928
git clone https://github.com/RMPR/atbswp.git && cd atbswp
20-
sudo dnf install python3-wxpython4
2129
make prepare-dev
2230
make run
2331
```
@@ -47,27 +55,18 @@ python atbswp\atbswp.py
4755

4856
![atbswp quick demo](demo/demo.gif)
4957

50-
# Use cases
51-
I've mainly used it to automate gold/point/XP farming in games, I think this can also be used to:
52-
53-
- Automate a demo during a conference for example
54-
- Automate UAT in the devops process (as long as you're making something with a GUI).
55-
56-
If you use it for something really cool you can always reach me at github (at) rmpr (dot) xyz or drop
57-
a PR :). Bonus points if you have a demo video.
5858

5959
# Donate
6060
<a href="https://www.buymeacoffee.com/rmpr" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-black.png" width="150" alt="Buy me a coffee"></a>
6161

62-
If you found this helpful in any way.
63-
62+
If you found this helpful.
6463

6564
# Contributions
6665
Contributions are welcomed, see [CONTRIBUTING.md](./CONTRIBUTING.md)
6766

6867
# Known issues
6968
On Linux, this only works with Xorg, with wayland support coming soon, for now you have to
70-
enable Xorg.
69+
enable Xorg.
7170

7271
```
7372
sudo sed 's/#WaylandEnable=false/WaylandEnable=false/' /etc/gdm/custom.conf -i # on Gnome

atbswp/control.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ def isinteger(s):
191191

192192
if move == "moveTo":
193193
coordinates = [int(s) for s in parameters.split(", ") if isinteger(s)]
194-
if coordinates[0] - self._lastx < self.mouse_sensibility \
195-
and coordinates[1] - self._lasty < self.mouse_sensibility:
194+
if abs(coordinates[0] - self._lastx) < self.mouse_sensibility \
195+
and abs(coordinates[1] - self._lasty) < self.mouse_sensibility:
196196
return
197197
else:
198198
self._lastx, self._lasty = coordinates
@@ -256,8 +256,6 @@ def on_scroll(self, x, y, dx, dy):
256256

257257
def on_press(self, key):
258258
"""Triggered by a key press."""
259-
if not self.recording:
260-
return False
261259
b = time.perf_counter()
262260
timeout = int(b - self.last_time)
263261
if timeout > 0:
@@ -333,9 +331,7 @@ def action(self, event):
333331
with open(TMP_PATH, 'w') as f:
334332
# Remove the recording trigger event
335333
self._capture.pop()
336-
# If it's the mouse remove the previous also
337-
if "mouseDown" in self._capture[-1]:
338-
self._capture.pop()
334+
self._capture.pop()
339335
f.seek(0)
340336
f.write("\n".join(self._capture))
341337
f.truncate()
@@ -345,7 +341,6 @@ def action(self, event):
345341

346342
def update_timer(self, event):
347343
"""Check if it's the time to start to record"""
348-
print(self.timer)
349344
if self.timer <= 0:
350345
self.wx_timer.Stop()
351346
self.countdown_dialog.Destroy()

atbswp/gui.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ def __init__(self, *args, **kwds):
158158
wx.ID_ANY,
159159
wx.Bitmap(os.path.join(self.path, "img", "play-circle.png"),
160160
wx.BITMAP_TYPE_ANY))
161+
self.remaining_plays = wx.StaticText(self, label=settings.CONFIG.get("DEFAULT", "Repeat Count"),
162+
style=wx.ALIGN_CENTRE_HORIZONTAL)
161163
self.play_button.SetToolTip(self.app_text[3])
162164
self.compile_button = wx.BitmapButton(self,
163165
wx.ID_ANY,
@@ -228,6 +230,7 @@ def __set_properties(self):
228230
self.help_button.SetSize(self.help_button.GetBestSize())
229231

230232
def __do_layout(self):
233+
self.remaining_plays.Position = (256, 0)
231234
main_sizer = wx.BoxSizer(wx.HORIZONTAL)
232235
main_sizer.Add(self.panel)
233236
main_sizer.Add(self.file_open_button, 0, 0, 0)

atbswp/settings.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
CONFIG = configparser.ConfigParser()
2727
VERSION = "0.2"
28-
YEAR = date.today().strftime('%Y')
28+
YEAR = date.today().strftime("%Y")
2929

3030

3131
# Check the location of the configuration file, default to the home directory
@@ -44,16 +44,18 @@ def save_config():
4444
with open(config_location, "w") as config_file:
4545
CONFIG.write(config_file)
4646

47+
4748
try:
4849
with open(config_location) as config_file:
4950
CONFIG.read(config_location)
5051
except:
51-
CONFIG['DEFAULT'] = {'Fast Play Speed': False,
52-
'Infinite Playback': False,
53-
'Repeat Count': 1,
54-
'Recording Hotkey': 348,
55-
'Playback Hotkey': 349,
56-
'Always On Top': True,
57-
'Language': 'en',
58-
'Recording Timer': 0}
59-
52+
CONFIG["DEFAULT"] = {
53+
"Fast Play Speed": False,
54+
"Infinite Playback": False,
55+
"Repeat Count": 1,
56+
"Recording Hotkey": 348,
57+
"Playback Hotkey": 349,
58+
"Always On Top": True,
59+
"Language": "en",
60+
"Recording Timer": 0,
61+
}

0 commit comments

Comments
 (0)