Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Neolib v2

  1. #1

    Joined
    Sep 2012
    Posts
    39
    Userbars
    0
    Thanks
    0
    Thanked
    31/15
    Mentioned
    11 times
    Time Online
    2d 8h 38m
    Avg. Time Online
    N/A

    Neolib v2



    Neolib is a python library which aims to automate the cult classic web based game, Neopets. Neolib automates the game from the ground up by centralizing actions around the Neopets user account. The library includes strong functionality for performing complex tasks as well as built-in querying of a user's assets.
    Neolib is built upon python's famous requests library for handling HTTP communications and the powerful lxml library for parsing HTML content. These two libraries combine to give Neolib a powerful and fast framework for automation.

    Neolib is aimed for being deployed on a server or cloud environment. The library does not assume that there will be a graphical interface for interacting with the library. Rather, it assumes the code will either be ran in a script on a server or as part of a grander program with a web interface.

    Neolib is still in a very early stage of development. As such, things are expected to change, up to and including the base classes. If you intend on using the library in this state please ensure you check back frequently with the master branch for changes.

    Neolib is also looking for developers interested in contributing to the project. A very detailed and useful primer can be found in the links below. Please read it and understand it fully before making contributions to the project.

    Documentation: (you need an account to see links)
    Contribution Primer: (you need an account to see links)
    Author: Josh
    Github: (you need an account to see links)
    Documentation: (you need an account to see links)
    Example Programs: (you need an account to see links)
    Version: 0.1 (Beta)

    As most have guessed, this is the second iteration of my Neolib library. Since Neopets is undergoing new management, some things have changed and I've deemed it necessary to simply rewrite the library from scratch rather than attempting to fix the first iteration. It also gives me an opportunity to implement new ideas like core classes and switching over to lxml from BeautifulSoup.

    This is a great opportunity for new or non-experienced programmers to contribute towards something and learn a lot about Python. The current iteration of the library includes a lot of concepts from both the functional and object oriented disciplines. If you're interested please read through the primer and contact me to be added on as a contributor.

    As the library progresses I will be releasing example programs to help stimulate use of the library. This programs will be publicly available and open source via the same Github repo.

    Enjoy!
    Last edited by AliasXNeo; 11-20-2014 at 12:30 AM.

  2. The Following 4 Users Say Thank You to AliasXNeo For This Useful Post:

    Ghosts (11-18-2014),j03 (11-09-2014),mmk (11-09-2014),reestoquer (12-03-2014)

  3. #2
    Saiyan Race
    j03's Avatar
    Joined
    Dec 2011
    Posts
    13,756
    Userbars
    176
    Thanks
    5,936
    Thanked
    33,184/6,625
    DL/UL
    23/36
    Mentioned
    3,871 times
    Time Online
    564d 11h 47m
    Avg. Time Online
    3h 13m
    Great work. Always look forward to the stuff you contribute, especially after the last project you left us with!
    (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.
    ------------------------


  4. #3

    Joined
    Sep 2012
    Posts
    39
    Userbars
    0
    Thanks
    0
    Thanked
    31/15
    Mentioned
    11 times
    Time Online
    2d 8h 38m
    Avg. Time Online
    N/A
    Quote Originally Posted by Infamous Joe View Post
    Great work. Always look forward to the stuff you contribute, especially after the last project you left us with!
    Thanks!

    I must admit it's turning out a lot better this time around. The use of lxml and xpath is making stuff pretty clean and very quick. I also just implemented a universal query method for searching inventories like so:

    Code:
    >>> usr.inventory.find(name='Carrot')
    [Item <Carrot>]
    >>> usr.inventory.find(name__startswith='C')
    [Item <Carrot>]
    >>> usr.inventory.find(desc__contains='carrot')
    [Item <Carrot>]
    I'll post back here in a little while with instructions on how interested parties can test the library's current features.
    Last edited by AliasXNeo; 11-09-2014 at 06:37 PM.

  5. #4
    Saiyan Race
    j03's Avatar
    Joined
    Dec 2011
    Posts
    13,756
    Userbars
    176
    Thanks
    5,936
    Thanked
    33,184/6,625
    DL/UL
    23/36
    Mentioned
    3,871 times
    Time Online
    564d 11h 47m
    Avg. Time Online
    3h 13m
    Damn, now that's feature packed lol. Just for the inventory it seems like you are covering a lot of functions that may come in handy at a later point. I'm interested in learning from this entire project and I will probably use some of the stuff for my future Python work.
    (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.
    ------------------------


  6. #5

    Joined
    Sep 2012
    Posts
    39
    Userbars
    0
    Thanks
    0
    Thanked
    31/15
    Mentioned
    11 times
    Time Online
    2d 8h 38m
    Avg. Time Online
    N/A
    To start using it from Linux/Mac:

    1. Ensure git is installed (apt-get install git)
    2. Ensure python 3 is installed (apt-get install python3)
    3. Ensure libxml and libxslt are installed on linux (apt-get install libxml2 libxslt)
    4. Ensure development headers for python are installed (apt-get install python-dev)
    5. Ensure pip is installed (apt-get install pyton3-pip)

    6.Clone the repository:
    Code:
    $ git clone https://github.com/jmgilman/neolib2.git neolib2
    7.Install required libraries:
    Code:
    $ cd neolib2
    $ pip install -r requirements.txt
    You may need to substitute 'pip3' for 'pip'.

    For Windows:

    1. Ensure the latest version of python 3 is installed on your system
    2. Download Github for Windows: (you need an account to see links)
    3. Navigate to: (you need an account to see links) and click 'Clone to Desktop' button on the right-hand side
    4. Open a command prompt and navigate to the location where the Github client cloned the repository (move inside the 'neolib2' folder)

    5. Install the required libraries
    Code:
    pip install -r requirements.txt
    To test if it's working:

    1. Open command prompt/shell and navigate to neolib2 folder
    2. Run python3
    3. Follow the below prompts
    Code:
    >>> from neolib.user.User import User
    >>> usr = User('username', 'password')
    >>> usr.login()
    True
    >>> usr.inventory
    Inventory <32 Items>
    If you follow the above prompts and get similar results then the library should be in a working order.

  7. The Following 2 Users Say Thank You to AliasXNeo For This Useful Post:

    Accelerator (11-11-2014),j03 (11-10-2014)

  8. #6
    Saiyan Race
    j03's Avatar
    Joined
    Dec 2011
    Posts
    13,756
    Userbars
    176
    Thanks
    5,936
    Thanked
    33,184/6,625
    DL/UL
    23/36
    Mentioned
    3,871 times
    Time Online
    564d 11h 47m
    Avg. Time Online
    3h 13m
    @(you need an account to see links) have you tested this on Linux and/or Mac?

    Also if you still need the Random Event code, I have this information. PM me for it.
    Last edited by j03; 11-10-2014 at 11:35 PM.
    (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.
    ------------------------


  9. #7

    Joined
    Sep 2012
    Posts
    39
    Userbars
    0
    Thanks
    0
    Thanked
    31/15
    Mentioned
    11 times
    Time Online
    2d 8h 38m
    Avg. Time Online
    N/A
    Quote Originally Posted by Infamous Joe View Post
    @(you need an account to see links) have you tested this on Linux and/or Mac?

    Also if you still need the Random Event code, I have this information. PM me for it.
    I've tested it on an arch linux KVM I use for development and a Mac running a managed version of OSX (managed by Google). However, not much is different than standard OSX so I would assume it works fine. I havn't actually tested the steps I wrote though (which is why I asked for feedback if they don't work).

  10. #8

    Joined
    Sep 2012
    Posts
    39
    Userbars
    0
    Thanks
    0
    Thanked
    31/15
    Mentioned
    11 times
    Time Online
    2d 8h 38m
    Avg. Time Online
    N/A
    I've added a primer for contributing to the library. It covers most of the internal stuff you need to know about before attempting to contribute.

    (you need an account to see links)

  11. #9

    Joined
    Sep 2012
    Posts
    39
    Userbars
    0
    Thanks
    0
    Thanked
    31/15
    Mentioned
    11 times
    Time Online
    2d 8h 38m
    Avg. Time Online
    N/A
    Did some major updates today. About 90% of the way to the first stage of beta (only item remaining is main shops). To celebrate I've added an example User Shop Autbuyer script to the repository. Does all the steps of a UAB in less than 25 lines of non-fluff code:

    Code:
    usr = User(username, password)
    w = Wizard(usr)
     
    print('Logging in...')
    if not usr.login():
        print('Login failed! Aborting....')
        exit()
     
    print('Initiaing...')
    while True:
        # Search for the item
        print('Searching...')
        try:
            r = w.search(item, max=max)
        except WizardBanned:
            print('Shop wizard banned. Aborting...')
            exit()
     
        # If we have any results we should buy them all
        if r:
            print('Found ' + str(len(r)) + ' of ' + item)
     
            bought = r.buy()
            if bought:
                print('Successfully purchased ' + str(len(bought)) + ' of ' + item)
     
        # Wait some random time for realism
        time.sleep(random.randint(5, 10))

  12. The Following User Says Thank You to AliasXNeo For This Useful Post:

    j03 (11-16-2014)

  13. #10

    Joined
    Sep 2012
    Posts
    39
    Userbars
    0
    Thanks
    0
    Thanked
    31/15
    Mentioned
    11 times
    Time Online
    2d 8h 38m
    Avg. Time Online
    N/A
    Updated with support for Main Shops, including an OCR cracker. It now has everything to build a pretty solid MAB.

  14. The Following User Says Thank You to AliasXNeo For This Useful Post:

    j03 (11-16-2014)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •