Results 1 to 2 of 2

Thread: Keeping your python bots browser emulation updated. [Windows]

  1. #1
    Stocking Anarchy's Avatar
    Joined
    May 2016
    Posts
    1,371
    Userbars
    11
    Thanks
    929
    Thanked
    1,627/650
    DL/UL
    182/0
    Mentioned
    145 times
    Time Online
    47d 8h 56m
    Avg. Time Online
    23m

    Exclamation Keeping your python bots browser emulation updated. [Windows]

    First I would recommend reading (you need an account to see links) written by @(you need an account to see links) to learn more about what user-agents are and why they are important. Forgive me programmers of clraik but I am going to talk about this stuff with non-programmer speak from how I interpret user-agents work.

    In the most basic terms, user-agents tell Neopets what browser you are using when you are running a python bot. That is why I think of it as a browser emulator. The reason why keeping this information updated in your python bots is because Neopets does keep track of this data. So if you have been playing Neopets on Firefox 54 but you are using an older python bot that sends data as if you were playing Neoquest on a Firefox 40 browser that could potentially show red flags. Or if you play Neopets on Firefox but your python bots always sends data as if you were playing Google Chrome, another eyebrow raise.

    The good thing is, it is very simple to update the user-agents yourself.

    First open the browser you typically play neopets on and grab your User-agent data. A few sites you can get this info are:

    (you need an account to see links)
    (you need an account to see links)
    (you need an account to see links)

    Next go to your python bot folders and find the .py file that has the user-agent information contained. In Windows you can right click the .py file and choose Edit with Idle to see the code in each .py file. Some programmers will have the file that contains the user-agent info in a file called NeoAccount.py or NeoControls.py others may not have a .py file at all and you can set it in a text file. Good thing is, once you have found the .py file that contains this information, you don't have to keep looking. This will be the only .py file that you have to edit.

    The code will look something like this

    Code:
        headers = [('User-Agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36'),
    For the code above, that user agent is for a Chrome browser but I use Firefox. So I am going to change the code to the info the website useragentstring.com displays when I visit it on my browser.

    Code:
        headers = [('User-Agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0'),
    then you just save the file and you are done.

    Every time you have a browser update I would recommend updating your user-agents for bots you use regularly. If you use a bot only now and then, I would just double check the user-agent matches your browser before running the bot.
    Last edited by Stocking Anarchy; 02-16-2019 at 03:45 AM. Reason: updated Ua







  2. The Following 5 Users Say Thank You to Stocking Anarchy For This Useful Post:

    Aura (08-30-2017),chips (09-07-2017),Daviid (08-30-2017),Northern (08-31-2017),Nyu (08-30-2017)

  3. #2
    Stocking Anarchy's Avatar
    Joined
    May 2016
    Posts
    1,371
    Userbars
    11
    Thanks
    929
    Thanked
    1,627/650
    DL/UL
    182/0
    Mentioned
    145 times
    Time Online
    47d 8h 56m
    Avg. Time Online
    23m
    Just wanted to bump this since it has been a while since I made the guide. Chrome recently updated so wanted to give a friendly PSA and reminder to everyone to make sure your user agents are up to date.







Posting Permissions

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