|
Sad Panda posted:I've played with MSS before, but have gone back to using PyAutoGUI with OpenCV as a backend. The jump from the Python backend to the OpenCV backend is crazy. https://docs.opencv.org/2.4/modules/imgproc/doc/object_detection.html cv2.matchTemplate(image, templ, method[, result]) → result mss is just a faster and easier way of getting images, you'll still need opencv for most analysis. and yeah it's ridiculous how much faster opencv is over a pure python solution
|
# ? Feb 24, 2019 01:07 |
|
|
# ? May 16, 2024 18:51 |
|
In all of the examples they do...Python code:
Python code:
<generator object MSSMixin.save at 0x0000020451EFBD68>
|
# ? Feb 24, 2019 01:51 |
|
Sad Panda posted:In all of the examples they do... the print does nothing lol, its just running the generator. also: the author explicitly advises NOT doing any mss().xxx as it causes resource leaks https://python-mss.readthedocs.io/usage.html checking the function save() in the source, it returns the filename. saving the file is inherently part of the function. grab() gets you the image, save() combines that with to_png() Python code:
mbt fucked around with this message at 02:15 on Feb 24, 2019 |
# ? Feb 24, 2019 02:12 |
|
crazysim posted:I like using debuggex and other online regexp tools to debug those. I really like https://regex101.com. I used to use https://regexr.com before that but I think regex101 is nicer for whatever reason I don't remember.
|
# ? Feb 24, 2019 11:25 |
|
Why are people posting about writing cheat software ITT? "It's just a research project". Uh-huh
|
# ? Feb 24, 2019 16:56 |
NtotheTC posted:Why are people posting about writing cheat software ITT? This is a programming thread on SA , not a tech support thread of official Space Station forums or whatever.
|
|
# ? Feb 24, 2019 17:12 |
|
I'm with the cops, you're all busted
|
# ? Feb 24, 2019 17:53 |
|
cinci zoo sniper posted:This is a programming thread on SA , not a tech support thread of official Space Station forums or whatever. My issue was less about white-noising the thread and more about it being scummy and maybe people should keep the blackhat poo poo they do for a dollar to themselves.
|
# ? Feb 24, 2019 18:24 |
|
NtotheTC posted:My issue was less about white-noising the thread and more about it being scummy and maybe people should keep the blackhat poo poo they do for a dollar to themselves. Thank you for implying i get paid or even distribute my code. Im bad at fps games and dont want to click 100 times in spacestation 13, throw me in jail
|
# ? Feb 24, 2019 18:47 |
|
NtotheTC posted:My issue was less about white-noising the thread and more about it being scummy and maybe people should keep the blackhat poo poo they do for a dollar to themselves. if space station 13 were a competitive game where people were actually trying to win or lose, it might be scummy, but ss is a heavily moderated western RPG-style game with no set win conditions.
|
# ? Feb 24, 2019 19:12 |
|
I enjoy the idea of automating games (particularity clicky web games) that aren't competitive. (gently caress you if you're writing cheats for overwatch or something). I hope people continue to post about that poo poo. One day I hope to get through my huge list of projects that sound fun and maybe try my hand at doing something like that.
|
# ? Feb 24, 2019 19:31 |
|
Clicky web games, you can often just edit the js directly or mock parts of the api or figure out the save format
|
# ? Feb 24, 2019 20:10 |
|
NtotheTC posted:My issue was less about white-noising the thread and more about it being scummy and maybe people should keep the blackhat poo poo they do for a dollar to themselves. Maybe you should keep your opinions to yourself instead since you don't seem to know what you're talking about What that dude is doing is basically AutoHotKey with an image processing layer, and he's applying to possibly the least competitive multiplayer game in existence; there's nothing really "blackhat" to talk about there. He also wasn't "white-noising" the thread, he explained exactly what he was doing and even provided a movie of it in action.
|
# ? Feb 24, 2019 21:22 |
|
QuarkJets posted:Maybe you should keep your opinions to yourself instead since you don't seem to know what you're talking about The first post says "im writing cheat software", the second post says "here's how you'd do it for Apex" and the video is literally titled "cheating in space station 13". So why would anyone think it strange? I didnt set the tone or the topic. I imagine automation- ahk or otherwise is listed as cheating even in a web game so who cares if it's the equivalent of botting in slither.io? How is it a contraversial opinion to say "don't talk about writing cheats ITT?“ there must be thousands of legitimate uses for that sort of tooling so use those to demonstrate it.
|
# ? Feb 24, 2019 22:10 |
|
I asked about it because capturing image data from video games, processing it, analyzing it, and then responding with simulated input, is (to me at least) a very interesting technical problem worthy of discussion in a thread about Python. No one is talking about breaking terms of service agreements or laws or anything. I was thinking about writing a bot for some SNES platformer or something dumb like that.
|
# ? Feb 24, 2019 22:19 |
|
NtotheTC posted:The first post says "im writing cheat software", the second post says "here's how you'd do it for Apex" and the video is literally titled "cheating in space station 13". So why would anyone think it strange? I didnt set the tone or the topic. Saying 'learn cpp and write dll wrappers' isnt some arcane secret. Its more of saying 'hey if you want to actually cheat DONT do this, its the least efficient way to do this and involves more computational power than god" Maybe it didnt come across but being able to 'get sick headshots in apex' via python image capture is not possible no matter how you slice it. Writing automation software for games is how lots of people get into programming to begin with, including myself. Eventually you get a real job and begin to think back on cheating on cookie clicker and translate those same exact functions to legitimate uses. It doesnt take a phd to say 'programs that move your mouse and keyboard can be used to cheat in games' lol
|
# ? Feb 24, 2019 22:57 |
|
Using the Python reddit as an example, there are several topics less constructive than game cheats: Banal blog posts/Medium articles, framework/A vs B, political package-manager chat, popularity statistics etc.
|
# ? Feb 24, 2019 22:59 |
|
NtotheTC posted:The first post says "im writing cheat software", the second post says "here's how you'd do it for Apex" and the video is literally titled "cheating in space station 13". So why would anyone think it strange? I didnt set the tone or the topic. I never said that it wasn't cheating, I said that it wasn't "blackhat". However what's being discussed is a legitimate use of programming and that's what people are pointing out to you. As always, the context matters a lot; in a context where you're combining keypresses for convenience, rather than as a substitute for skill, it's generally not considered malicious. For instance any game where abilities have cooldowns (games like MWO, most RPGs, most MMOs, etc) a key-pressing script provides no competitive advantage. World of Warcraft basically has AHK built into it, you can automate all sorts of mundane poo poo but you'll get banned if you start to automate something that occurs during a competitive context, such as combat. In the context of SS13, "combining ingredients in a specific order" is not really a skill, assuming you have motor and memory skills exceeding a toddler, so automating those steps is for convenience rather than to gain a competitive advantage (also it's not a competitive game). When you said "white noise" I thought you were referring to your out-of-nowhere "oh this is just a research project" comment, which implied that he was being secretive or something when he clearly wasn't. If that wasn't your intention then I guess you sometimes just randomly type words into the comment field and that's a harmless enough form of entertainment
|
# ? Feb 24, 2019 23:13 |
Can we not goon up what had until now been a nice, interesting and informative thread, with a stupid slapfight thanks just thanks. Person who posted the screenshot stuff, I found it very interesting and always like to find more performant ways of doing things thank you.
|
|
# ? Feb 25, 2019 01:12 |
|
Bundy posted:Can we not goon up what had until now been a nice, interesting and informative thread, with a stupid slapfight thanks just thanks. This, I really enjoyed the MSS chat as I've used both OpenCV w/python and pyautogui but hadn't heard of MSS
|
# ? Feb 25, 2019 02:32 |
|
The last four or so companies that reached out to me were all about screen scraping old lovely enterprise applications for data entry and poo poo, basically replacing all the 60 year old gray haired $65,000/yr accountants with a couple of ec2 instances at $60/month. It all sounds like bullshit but VCs keep throwing about $60 million a year at the problem to a couple dozen companies each year so there's at least a legit purpose for the technology, even if the task is mind numbing drudgery. The computer doesn't care if it's playing space station 13, sudoku, crossword puzzles, or validating field expense reports and balancing the sales teams' monthly budget. Hadlock fucked around with this message at 11:44 on Feb 25, 2019 |
# ? Feb 25, 2019 11:40 |
|
Bit of a Hail Mary request and not entirely Python but: We have a database stored in Netezza (an old IBM data warehouse). Our legacy in-house solution to connect to it involves using a Windows SQL workbench. I'd rather (2) use Linux or OSX and (2) do it from a script with a proper programming language like Python. And it's getting complicated: * Hey, you connect to Netezza with odbc! I'll just use pyodbc! * Uh, but you still need the odbc drivers for Netezza, which IBM won't give to me. I need a license. * (I ask the in-house IT for the drivers. Radio silence ...) * Uh, mxODBC says it can connect to Netezza ... if I can install something on the server. Nope. * There's a bunch of solutions on the web about using pyodbc to connect to Netezza ... all of which gloss over the driver step * Here's a few other commercial / shareware solutions that say they can connect to Netezza but it's unclear if they really can or if they just use the aforementioned drivers. * Someone suggests just copying the driver from the PC installation ... but I can't seem to find a matching jar file. Any leads here? I feel like I'm chasing my tail. And any opinions on pyodbc? Some aspects of it seem under-documented but that might be my inexperience.
|
# ? Feb 25, 2019 14:13 |
|
Boris Galerkin posted:I'm digging into tox right now and it's a bit confusing. Is tox suppose to only run tests or do people use it for more than that? Here's what my simple tox.ini file looks like right now: test library idea: toxx. adds a new form of assertion, where if it ever fails, it logs into the forums with your account ... bonus: idiots checking their forums password into github
|
# ? Feb 26, 2019 00:57 |
|
Soricidus posted:test library idea: toxx. adds a new form of assertion, where if it ever fails, it logs into the forums with your account ... I don't get it, but speaking of tox I just saw my .tox folder is 1.6 GB. The actual code itself isn't even 1 MB. What the hell is ballooning my .tox folder and is there any way to stop this from happening? Hard drive space is cheap but my MacBook only has 512 GB total so this is going to add up if I start using tox for everything.
|
# ? Feb 26, 2019 11:58 |
|
baka kaba posted:I'm with the cops, you're all busted I'm writing iOS malware in Python come at me bro I also appreciated the MSS/OpenCV chat thanks everyone
|
# ? Feb 26, 2019 17:44 |
|
If I want to write real time "tail -f"-able logs in python, I want to set buffering to 0 when I call .write(), yeah?
|
# ? Feb 26, 2019 21:25 |
|
Razzled posted:If I want to write real time "tail -f"-able logs in python, I want to set buffering to 0 when I call .write(), yeah? Is there any particular reason you aren’t using Python’s logging module?
|
# ? Feb 27, 2019 02:05 |
|
Gangsta Lean posted:Is there any particular reason you aren’t using Python’s logging module? I guess simplicity? I mostly write scripts to help myself, not applications. I just need this thing to update me while it works so I can tail a log file and see where it's at
|
# ? Feb 27, 2019 06:15 |
|
logging owns, it's up there with itertools and collections for things you'll find yourself trying to do that someone else has already implemented excellently. Won't guarantee it solves your problem but take a minute to look at the basic interface and FileHandler and there's a very good chance it at least makes your code simpler and more readable.
|
# ? Feb 27, 2019 06:56 |
|
I'm a C# programmer trying to convert some code to python, and I'm having an issue with class static methods. Let's say I have an IP class that contains Address, Mask and a Status. The class also has a static method to print the address in dotted-decimal notation (go with me here, this is not the actual application i'm working with, that's proprietary enough that I can't post it here, so this is a proxy). In C#, I would have:C# code:
Python code:
>>> import IP >>> ip = IP.IP() >>> ip.ToDD(0) '0.0.0.0' >>> IP.ToDD(21230232) Traceback (most recent call last): File "<pyshell#5>", line 1, in <module> IP.ToDD(21230232) AttributeError: module 'IP' has no attribute 'ToDD' >>> ip.ToDD(21230232) '1.67.242.152' >>> Am I fundamentally misunderstanding static methods in Python? The whole point of static class methods is that I don't have to instantiate an object to use the method. What am I getting wrong? TIA
|
# ? Feb 27, 2019 21:43 |
|
Module named the same as your class, this wont get confusing! Do: IP.ip.ToDD(29293020) or whatever numbers you want. Youre currently asking the library IP to run a function ToDD which doesnt exist, IP.py only has the class ip Static method means you can skip the newobject = IP.ip() instantiation
|
# ? Feb 27, 2019 22:02 |
|
Meyers-Briggs Testicle posted:Module named the same as your class, this wont get confusing! Thank you!
|
# ? Feb 27, 2019 22:22 |
|
Razzled posted:I guess simplicity? I mostly write scripts to help myself, not applications. I just need this thing to update me while it works so I can tail a log file and see where it's at logging library is what you should be using. It's simple for simple use cases. It's complicated for complicated use cases.
|
# ? Feb 28, 2019 21:55 |
|
Is there a good alternative to IDLE for interactive Python? My beefs are: 1. it always starts up a shell in its own directory, so every time I restart the shell, I need to “include os” then “os.chdir(...)” to get to the directory of the project I’m working with, and 2. there doesn’t seem to be a way to paste multi-line code into the interpreter, I always get an error message, so I find myself typing the same poo poo over and over, and 3. There is no way to reload an “include” without restarting the shell which is what makes the above 2 items so frustrating 4. (Edit) up arrow is totally loving useless Maybe I don’t know what I’m doing with IDLE (always a possibility), but man this is irritating.
|
# ? Mar 1, 2019 05:53 |
|
Ipython/QtConsole
|
# ? Mar 1, 2019 06:17 |
|
I have some slow/heavy api calls i have to make on every page load in Django, page load time is almost 10 seconds, and will soon be doubling the number of api calls Thinking about setting up celery to run the queries every 15 seconds and then cache the results to a table in the db. Is this the right way to do this? I can setup a redis container but reading the docs it sounds like postgres is supported out of the box. Each api call returns about 1000 key value pairs in json format, that part is pretty inflexible Django 2.1 and python 3.7
|
# ? Mar 1, 2019 10:17 |
|
LongSack posted:Is there a good alternative to IDLE for interactive Python? You might enjoy an interactive development environment such as Spyder. It's installed by default with Anaconda python distrib.
|
# ? Mar 1, 2019 15:50 |
|
Hadlock posted:I have some slow/heavy api calls i have to make on every page load in Django, page load time is almost 10 seconds, and will soon be doubling the number of api calls I usually default to using my database as a cache and then moving on to redis or something like it when my performance degrades enough that I need to introduce the extra complexity. That being said, I'd possibly use python-rq instead of celery. You add extra complexity because you have to use redis, but you lose complexity because python-rq is way simpler to configure and write for than celery.
|
# ? Mar 1, 2019 19:00 |
|
pmchem posted:You might enjoy an interactive development environment such as Spyder. It's installed by default with Anaconda python distrib. Thanks, that hits the spot. I can reimport my modules, the up-arrow works, and I don't have to keep alt-tabbing between IDLE and Notepad++
|
# ? Mar 1, 2019 20:32 |
|
|
# ? May 16, 2024 18:51 |
|
LongSack posted:Thanks, that hits the spot. I can reimport my modules, the up-arrow works, and I don't have to keep alt-tabbing between IDLE and Notepad++ Spyder is a really great, open source / free, lightweight, python-native piece of software that needs more appreciation in the community. I love it.
|
# ? Mar 2, 2019 00:18 |