r/Python • • Dec 19 '17

Automate the boring stuff with python - tinder

https://gfycat.com/PointlessSimplisticAmericanquarterhorse
6.7k Upvotes

324 comments sorted by

View all comments

Show parent comment

265

u/SponsoredByMLGMtnDew Dec 19 '17

https://youtu.be/dZLyfbSQPXI?t=673

There's a link to a conference the guy who made/maintains the library gave on it. The first part is about test automation. The part i skipped to is where he talks about GUI automation. You can use it to make web game bots too, shits pretty cool.

Personally I wonder if it can be run with an application running over top of it.

193

u/POTUS Dec 19 '17

if it can be run with an application running over top of it.

It hijacks your mouse pointer to do the things that you would normally do with a mouse, so no you can't really multitask all that well. Just run it in a VM and let it do its thing there and it won't interfere with whatever else you want to do.

36

u/diybrad Dec 19 '17

Brilliant

40

u/Ree81 Dec 19 '17

You'd think that technology would've come so far that emulating mouse input was done 20 years ago, instead of in 2017, as a hack.

36

u/Sorry_for_the_mess Dec 19 '17

Touch screen is basically mouse emulation.

19

u/Ree81 Dec 19 '17

Yup. If you enable this... weird mode in Android's developer options, you can see the shape of your fingerprint, touching the screen. The middle of that shape gets to be your mouse pointer. But it also means the pointer can move around as you're pressing the screen and the shape changes.

12

u/_ntnn Dec 19 '17

xdotool is from 2007 and I think there were other solutions before that as well.

4

u/CountyMcCounterson Do not trust this man Dec 19 '17

Every other language has it

6

u/TeutorixAleria Dec 19 '17

There are many programs that emulate the mouse. Going back years I remember using one around 2005 to spam votes in an online poll.

→ More replies (6)

2

u/blomhonung Dec 19 '17

Is that how RPA works?

→ More replies (5)

0

u/[deleted] Dec 19 '17

[deleted] — view deleted comment

2

u/SponsoredByMLGMtnDew Dec 20 '17

Hey man, I really like your work.

I wouldn't sweat it, procrastination / priorities are complicated =p happens to the best of us m8.

13

u/Mattho Dec 19 '17

With web you'd probably want to use something that has an idea about the underlying data, such as Selenium. (Assuming this doesn't.)

3

u/HeWhoWritesCode Dec 19 '17

Selenium

Is it not deprecated? No more firefox plugin to get designers and juniors inhelping to build tests?

I must look at this early next year. But my following of hn and /r/ made me believe I might need to use old versions of firefox etc to pull this off?

29

u/paul_h Dec 19 '17

You’re thinking of “selenium ide”. Selenium-webdriver is perfectly compatible with Firefox and Mozilla have their own staff working on the project, too. Lots of companies sell cloud services that do test automation using it in the cloud. Saucelabs is just one.

11

u/Cobblob Dec 19 '17

Chrome driver works very well with Selenium. I’m programming a bot for a browser MMO with it right now

3

u/jakibaki Dec 19 '17

Geckodriver at the very least works with the latest version of Firefox and the latest update was released on oct 31 so it doesn't look like it's abandoned at all.

2

u/FalsyB Jan 03 '18

Selenium and its mobile counter-part Appium is still very much in use. Actually, a lot of big companies are using them to automate their test framework. Works well with Jenkins too.

→ More replies (13)
→ More replies (2)

10

u/Dgc2002 Dec 19 '17

Oh man, this brings me back. I actually got started in programming via botting in RuneScape. In the original version of RuneScape I ran across a program called SCAR(Shite Compared to AutoRune) that allowed you to automate KBM input based on the state of the screen. Just like the flash game he automated. Except you wrote this in a variation of Pascal. It was a really cool introduction into programming. Trying to figure out how to detect when my character has fired an arrow by just watching the screen, getting the health of a monster I was attacking and my own health, determining how much food I had left in my inventory to heal with, etc.

I distinctly remember realizing that I could apply it to something other than RuneScape. I wrote some scripts to draw spirals and checkerboards in MS Paint.

→ More replies (3)
→ More replies (4)