I'l update the original post again
Just a warning to anyone currently using or thinking about using the project, I will be moving to Python 3 with the next release. In fact, the next revision is going to change a lot of the HTTP core. My current intentions are to move the current master branch to a new branch to maintain the Python 2 compatibility, and then update the master branch to the Python 3 version. I also did revision of the configuration system, which I talked about (you need an account to see links).
Since the some of the old thread content was lost, here's some more showing off This is the very basic main loop I have for the UAB I am developing. Searches for an item, buys it if it's cheap enough, then stocks and prices it and repeats.
That being said, I am having trouble finding a python 3.x imaging library that plays well with the main shop captcha. If anyone is interested in really helping this library out, a main shop OCR module would be extremely helpfulCode:def mainLoop(self): while True: for item in self.items: cmpPrice = item.price - self.dedAmount r = ShopWizard.search(self.usr, item.name) if (int(r[0].price) < cmpPrice): if r.buy(0): print ("Bought " + item.name + " at " + str(item.price)) self.usr.inventory.load() if not item.name in usr.inventory: print("Error handling item: " + item.name) continue self.usr.inventory[item.name].stock() self.usr.shop.load() self.usr.shop.inventory[item.name].price = ShopWizard.price(self.usr, item.name, method=ShopWizard.AVERAGE) self.usr.shop.update() print("Handled " + item.name + " successfully") else: print ("Missed " + item.name)
Last edited by AliasXNeo; 10-08-2012 at 01:01 AM.
Turns out the current release of Neolib is completely backwards compatible with Python 2.x. That being said, I'm going to go ahead and officially move back to Python 2.x and transfer the current master branch to 'py3k'.
I've started work on the OCR crack with the Python Imaging Library, however due to real life issues I've had little time to improve the accuracy. Anyone interested in helping me pick up the slack let me know. Cheers.
---------- Post added at 11:36 PM ---------- Previous post was at 11:36 PM ----------
Turns out the current release of Neolib is completely backwards compatible with Python 2.x. That being said, I'm going to go ahead and officially move back to Python 2.x and transfer the current master branch to 'py3k'.
I've started work on the OCR crack with the Python Imaging Library, however due to real life issues I've had little time to improve the accuracy. Anyone interested in helping me pick up the slack let me know. Cheers.
Well here's a start:
That usually gets you right on the border of the pet, so it's a starting place (but Neopets usually doesn't like the cords). Just need to grab 3 more points and use it as a virtual box and just aim for the middle.Code:im = Image.open("capt.jpg") im = im.convert("L") l, h = im.getextrema() p = im.point(lambda x: x == l) x, y, _, _ = p.getbbox()
---------- Post added at 09:57 AM ---------- Previous post was at 09:57 AM ----------
Well here's a start:
That usually gets you right on the border of the pet, so it's a starting place (but Neopets usually doesn't like the cords). Just need to grab 3 more points and use it as a virtual box and just aim for the middle.Code:im = Image.open("capt.jpg") im = im.convert("L") l, h = im.getextrema() p = im.point(lambda x: x == l) x, y, _, _ = p.getbbox()
All un-revisioned or incomplete changes are being committed to the 'dev' branch. If you're wanting to use the bleeding-edge of this library, please checkout that branch rather than the master branch. The master branch will be updated with the dev branch once all goals of a revision have been met. The latest commit includes the above OCR code.
Zachafer (10-23-2012)
Major update today to V1.0.0. This is the first major public release of Neolib. A PyPi package has been created to allow for installation with easy_install:
A more in-depth README can also be found on the Github page.[COLOR="Silver"]Code:easy_install neolib
Last edited by AliasXNeo; 10-30-2012 at 07:49 PM.
j03 (10-30-2012),runbikesurf(10-30-2012)
(you need an account to see links)
(you need an account to see links)(you need an account to see links)
------------------------
[02/24/2013] Stealth CORE is made into the first standalone Neopets auto-player.
------------------------