8 ms·
I did something similar thing with Python and Guild Wars 2, probably not as advanced though. It would place buy orders for under priced wood logs which were bro
by orf 12y ago
I did something similar thing with Python and Guild Wars 2, probably not as advanced though. It would place buy orders for under priced wood logs which were brought very quickly, and then sold them when the market price fluctuated higher.
Fifa Ultimate Team is easily gameable as well, the web frontend uses a surprisingly well made API which makes it super simple to automate trading of cards. It was interesting to see how the PS3 and XBox economies differed (a lot).
Python is surprisingly awesome for such tasks I find.
- lmm 12y agoPython still lets you get working code faster than anything else; it tends to be less maintainable in the long term / large codebases than something with a stronger compile-time type system, but with this kind of small bot you're likely to completely rewrite it as the API changes rather than wanting to maintain and add features to a codebase.
- eloff 12y agoThis has been my experience with python. When I was younger I wanted the fast out iteration times and speed of coding. Now that I work on a large python project I really miss having a compiler. Go offers a great tradeoff with fast iteration time and good speed of coding while scaling to large teams and codebases well. I actually find the iteration time faster than python because the tests run so much faster.
- lmm 12y agoGo's pretty limited in what you can encode. I couldn't go back to having to write explicit test cases for stuff I can get the Scala compiler to check.
- juzzcurious 12y agoIf you don't mind my asking, how did you go about mankind this? How did you go about unearthing the API? This type of tinkering seems like something I'd REALLY enjoy playing with! But I've no idea how to get started. I'm just a back end developer who lives tinkering but doesn't quite have the expertise.
- cmartel 12y agoIn Guild Wars 2's case, there's a significant portion of the API made available to the public, including the trading post. https://wiki.guildwars2.com/wiki/API:Main https://wiki.guildwars2.com/wiki/API:Main I don't believe this includes "write" operations like buying or selling, but since the in-game trading post communicates through the same web-based, it probably wouldn't be too much of a stretch to piece it together.
- getsat 12y agoIf the website has an API, just use it directly. If not... Load up the website in question, open your browser's debug tools' network tab, and perform each action that you'd like to be able to programatically do. Record the destination host/path, request type, and all the params that can be sent to it. Then, implement a function in your language of choice for each action that you want to be able to do (some actions require multiple requests). Package up the functions into a class/library/whatever and extract out common functionality. Then post it on HN for lots of karma and feedback. For a simple starter task, create an account on http://www.nationstates.net http://www.nationstates.net and write a bot which logs in each day and randomly picks a choice for each decision you are asked to make for your country.
- fastball 12y agoEven easier way to log requests is to use something to man-in-the-middle your own connection, like MITMProxy (which, coincidentally, is written in Python). I've used it a lot to unearth APIs and make programs that utilize them. https://mitmproxy.org/ https://mitmproxy.org/
- getsat 12y agoWow, nice. Bookmarked. Thanks for the link!
- eloff 12y agoI attached a small DLL at runtime which just called pyeval with a little bootstrap REPL running over a socket. Then I'd connect to it and use pythons introspection abilities to poke around the internal services and their methods. It took some tinkering, but I have no reversing or hacking experience, so it wasn't that hard.