Author Topic: [py] EggFarmer  (Read 4395 times)

0 Members and 1 Guest are viewing this topic.

Offline unisharpTopic starter

  • Elite
  • ***
  • *
  • Posts: 196
  • Activity:
    0%
  • Reputation Power: 4
  • unisharp has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 0
    • View Profile
[py] EggFarmer
« on: October 01, 2020, 07:46:52 AM »
0
Located under repo: https://github.com/unisharpUO/StealthUO-Scripts
https://github.com/unisharpUO/StealthUO-Scripts/blob/master/EggFarmer.py

About:
EggFarmer is a 100% AFKable script.  I split the nest areas into 5 different regions, each has their own rail.  Your character will walk around, and stop when it finds BOTH a snake and a nest, and then will proceed to use your charmer flute on it.  You must have Stealth (the skill.... and the program, of course.)  If you get revealed it will attempt to use egg/smoke bombs.  If you get poisoned it will attempt to use cures.  Make sure you have plenty of snake charmer flutes in your inventory and also make sure they are insured.

Items Needed:
  • Flutes
  • Cures Potions
  • Smoke/Egg Bombs

Rails:
Color chart to come...

Settings:
Near the top of the script look for:
Code: [Select]
Path = Areas[0]Rails 0 through 4 represent the 5 different rails.

Status:
The status is: working, optimizations needed to improve eggs over time.

Offline daymorn

  • Jr. Member
  • **
  • Posts: 21
  • Activity:
    0%
  • Reputation Power: 1
  • daymorn has no influence.
  • Respect: +3
  • Referrals: 0
    • View Profile
Re: [py] EggFarmer
« Reply #1 on: October 05, 2020, 11:19:59 AM »
0
Thank you for rewriting this in python!

Offline daymorn

  • Jr. Member
  • **
  • Posts: 21
  • Activity:
    0%
  • Reputation Power: 1
  • daymorn has no influence.
  • Respect: +3
  • Referrals: 0
    • View Profile
Re: [py] EggFarmer
« Reply #2 on: October 06, 2020, 11:31:45 AM »
0
What version of python are you running? I can get the script to start, but as soon as it calls:
if FindTypesArrayEx(_types, _colors, _container, _subs):
inside of your NewFind function, then it throws an exception and infinitely loops.

Offline daymorn

  • Jr. Member
  • **
  • Posts: 21
  • Activity:
    0%
  • Reputation Power: 1
  • daymorn has no influence.
  • Respect: +3
  • Referrals: 0
    • View Profile
Re: [py] EggFarmer
« Reply #3 on: October 06, 2020, 12:19:27 PM »
0
I got past the first problem. EggFarmer.py was passing lists as nested lists:
Bombs = NewFind([BombTypes], [0xFFFF], [Backpack()], True)
vs
Bombs = NewFind(BombTypes, [0xFFFF], [Backpack()], True)

Next problem seems to happen when no more nests. I just ran out of time to debug, but will try again later.
Code: [Select]
15:10:45:024 [daymorn-2d]: Traceback (most recent call last):
15:10:45:026 [daymorn-2d]:   File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
15:10:45:035 [daymorn-2d]:     "__main__", mod_spec)
15:10:45:036 [daymorn-2d]:   File "C:\Python34\lib\runpy.py", line 85, in _run_code
15:10:45:036 [daymorn-2d]:     exec(code, run_globals)
15:10:45:036 [daymorn-2d]:   File "C:\Users\****\Desktop\Stealth_v8.10.2\py_stealth\__main__.py", line 80, in <module>
15:10:45:037 [daymorn-2d]:     main()
15:10:45:037 [daymorn-2d]:   File "C:\Users\****\Desktop\Stealth_v8.10.2\py_stealth\__main__.py", line 59, in main
15:10:45:037 [daymorn-2d]:     module = __import__(os.path.splitext(filename)[0])
15:10:45:037 [daymorn-2d]:   File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
15:10:45:038 [daymorn-2d]:   File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
15:10:45:038 [daymorn-2d]:   File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
15:10:45:038 [daymorn-2d]:   File "<frozen importlib._bootstrap>", line 1129, in _exec
15:10:45:038 [daymorn-2d]:   File "C:\Users\****\Desktop\Stealth_v8.10.2\py_stealth\py34.py", line 33, in exec_module
15:10:45:040 [daymorn-2d]:     exec(code, module.__dict__)
15:10:45:041 [daymorn-2d]:   File "C:\Users\****\Desktop\Stealth_v8.10.2\Scripts\EggFarmer.py", line 171, in <module>
15:10:45:042 [daymorn-2d]:     WaitTargetObject(_nestsFound[0])
15:10:45:043 [daymorn-2d]: IndexError: list index out of range

Offline unisharpTopic starter

  • Elite
  • ***
  • *
  • Posts: 196
  • Activity:
    0%
  • Reputation Power: 4
  • unisharp has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 0
    • View Profile
Re: [py] EggFarmer
« Reply #4 on: October 07, 2020, 06:26:30 AM »
0
Interesting it's possible that the nest disappeared after checking to see if there were any, and before it went to target it.

EDIT: There's a couple ways to handle this, we could add an if statement that checks to see if _nestsFound[0] is set  before the waittarget, or we could wrap everything in a try/except so that if it happens again the script will still continue working.
« Last Edit: October 07, 2020, 06:32:31 AM by unisharp »

Offline daymorn

  • Jr. Member
  • **
  • Posts: 21
  • Activity:
    0%
  • Reputation Power: 1
  • daymorn has no influence.
  • Respect: +3
  • Referrals: 0
    • View Profile
Re: [py] EggFarmer
« Reply #5 on: October 07, 2020, 08:21:01 AM »
+1
I forked your repo and tweaked it just enough to get it to work. I've ran the following for at least a couple of hours. i've seen it successfully use smoke bombs twice, and have obtained about 30 eggs.

https://github.com/Daymorn/StealthUO-Scripts/blob/master/EggFarmer.py

Biggest change I made was that I put the egg searching section into a function, and then added EggSearch() inside of MoveNextSpot() in order to be more aggressive on picking the eggs up. I had several times where the character would leave the area with an egg on the ground.

There have been a few times where the script seems to stall out after a 'Trying to persuede snakes..." section, but it could honestly be from me switching off focus from my windows VM causing it. I've never encountered the problem while actively watching it so far.

Fantastic work and thank you again!

Offline unisharpTopic starter

  • Elite
  • ***
  • *
  • Posts: 196
  • Activity:
    0%
  • Reputation Power: 4
  • unisharp has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 0
    • View Profile
Re: [py] EggFarmer
« Reply #6 on: October 07, 2020, 09:18:15 AM »
0
Nice! Good job and thanks :)

Tags: