Author Topic: Brute Force Egg Hunter  (Read 13865 times)

0 Members and 1 Guest are viewing this topic.

Offline altiricTopic starter

  • Jr. Member
  • **
  • Posts: 81
  • Activity:
    0%
  • Reputation Power: 2
  • altiric has no influence.
  • Referrals: 1
    • View Profile
Brute Force Egg Hunter
« on: May 16, 2022, 08:55:04 PM »
*** FINAL VERSION! ***

Had a lot of fun with this one and learned a lot about what I have been doing wrong in some of my other scripts. Its time to wrap this one up with version 2.2 and move on to my other projects.

To run this script simply save the file into your Orion scripts folder. Either re-start your Orion Assistant to get the script to show up under "Scripts from folder" or load it from "Script file path" (at least on linux). Select Autostart from the drop down menu and click play. A gump will be displayed showing you a list of options you can edit.

-Items that are red are not setup, click the button beside it and it will turn green or ask for what it needs to get setup.
-When Max Backpack Items is reached, any combination of the following active actions will be performed:
---Turn in Eggs: Will travel to "Rune in Travel Book" and exchange eggs for fey ingots
---Turn in Ingots: Will approach the fey dealer and turn in all ingots for points
---Insure Eggs: Will insure eggs as you pick them up
---Insure Ingots: Will insure any Fey Ingots found in your pack
---Pause When Full: Will cause you to travel to "Rune in Travel Book" then pause the script
---Clicking Recall/Sacred journey will toggle your travel method to the one displayed
---Travel Rune Book: Will ask you to target a new rune book used with "Rune in Travel Book"
---Max Load Screen Delay: Sets the maximum amount of seconds to wait for a lag check to pass
---Delay Before next Recall: Creates a delay after scanning/collecting eggs, and travelling to the next rune
---Rune in Travel Book: This rune will be travelled too any time you go somewhere besides an egg rune
---Use portal for Destard: This will cause you to travel to "Rune in Travel Book", search for and approch, corrupted portal, then say "Dungeon Destard"
---Clicking cancel will return you to the main gump
---Click apply and the settings will be updated
---Selecting default will set all values to false or default.

To get back to the Options penal and make changes later, simply click the pause button on the egg gump, and select 'options' to make any changes.

You can name your rune books "egg book", add they will be cycled through the script automatically. If you don't have any books with that name in your backpack, you will be asked to select a book that contains your egg locations. Simply hit Esc to stop adding books to the list, you can have as many as you want.

If your a more experienced user, or would like to try adding further customization to the script without the risk of breaking it, There are two functions you can safely edit at the top of the script. customCodeOne() will be executed each time you travel, and before you scan for an egg. This allows you to add your own custom additions to the script such as checking for other players, checking your health, for pk's, etc. If your still learning, and make a mistake, simply correct or remove the code in the edit area and you're back to normal. customCodeTwo() works the same way but will be run after completing an egg scan and collecting any eggs and before travelling to the next rune.

The script will recall to each spot in each book, it reads how many runes each book has so they don't need to be full. It will do a quick scan in the area for Eggs and grab any it find before continuing to the next. Once you're pack is full, it will head to rune set in travel book and perform any active actions. This allows you to automatically turn in eggs for ingots, then turn in ingots for points, and continue hunting. You can easily change it to put all the eggs in a bag while collecting, go to a safe spot when pack is full and pause the script. Have it go to a custom spot when you're pack is full and run a custom function you create with the provided functions, like sorting eggs and putting a collection together! Simply edit the options and the script will respond to the updates real time.

You can also assign a hot key to eggScan that will automatically move you to an egg it finds and pick it up if you want to just run around scanning for eggs. To do this, go into your Orion Assistant -> Hotkeys -> Scripts -> Double click here to add new script hotkey. Then, in the box to the right click in the Hotkey: entry and assign your hotkey. Active the "Run one script" box, under script name select the drop down and choose eggScan. You can now use it any time in game as long as the eggHunter.oajs script is active in your Orion Assistant's Scripts tab.

 * Version 2.2
 * -Created travel function to cleanup some code.
 * -General code cleanup
 * -Added Options button while script is paused
 * -Moved all script options to Options panel in game, now even easier to set up!
 * -Added ability to use corrupt portal to get to destard instead of relying on rune book

 * Version 2.1
 * -Added grab bag option, eggs picked up will be put in selected bag if true.
 * -Will now stop walking to egg if pause button is pressed.
 * -Added optional delay between recalls, to uhh slow it down(?).
 * -Can now name rune books to egg book and avoid being asked to target books.
 * -Will no longer be asked for destard book once set, Remove from
 *  OrionAssistant->Lists->Objects->destardBook to be asked for a new book.
 * -Added customCodeOne and customCodeTwo functions to add your own behaviours
 * -Updated gump to display egg count individually

 * Version 2.0
 * -Faster and more responsive than the original!
 * -Better Egg scanning, more range.
 * -Better interaction with NPCs.
 * -Ability to insure eggs/ingots.
 * -Can now toggle EggTurnin and IngotTurnin on/off.
 * -Added pause once pack is full (Will still recall to destard book location first, it does not have to be destard in this case).
 * -Added function to move Eggs from backpack to a container.
 * -Can now switch between recall/sacred journey.
 * -Added Pause/Resume button.
 * -Added ignore egg button (For those porch locked eggs)

 * Version 1.0
 * -Will recall to array of rune books scanning for and picking up eggs.
 * -Will recall to destard book when full and exchange eggs for ingots.
 * -Will turn in eggs for points and continue hunting.

There are 3 attachment(s) in this post. You must register and post an acceptable introduction to download
eggHunter_v1.oajs
eggHunter_v2.2.oajs
eggHunter_v2.oajs
« Last Edit: May 31, 2022, 07:17:05 PM by altiric »

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Referrals: 0
    • View Profile
Re: Brute Force Egg Hunter
« Reply #1 on: May 16, 2022, 09:40:56 PM »
Wow  that a nice surprise.  Thx  for sharing this build. 

Offline altiricTopic starter

  • Jr. Member
  • **
  • Posts: 81
  • Activity:
    0%
  • Reputation Power: 2
  • altiric has no influence.
  • Referrals: 1
    • View Profile
Re: Brute Force Egg Hunter
« Reply #2 on: May 16, 2022, 09:44:12 PM »
Wow  that a nice surprise.  Thx  for sharing this build.

 Thanks for the first comment on any script ive ever written lol! They seem to be few and far between.

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Referrals: 0
    • View Profile
Re: Brute Force Egg Hunter
« Reply #3 on: May 16, 2022, 09:50:36 PM »
Was trying to accomplish the same via EasyUO, but wasn't able.     The pathfind within Orion, is was superior.   This will kept me busy for a while trying to understand the flow and how to use function.     

Offline altiricTopic starter

  • Jr. Member
  • **
  • Posts: 81
  • Activity:
    0%
  • Reputation Power: 2
  • altiric has no influence.
  • Referrals: 1
    • View Profile
Re: Brute Force Egg Hunter
« Reply #4 on: May 16, 2022, 09:52:21 PM »
The pathfinding is quite impressive, but it was the speed of executing scripts that made me change. Also get access to a lot more information a lot easier :)

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Referrals: 0
    • View Profile
Re: Brute Force Egg Hunter
« Reply #5 on: May 16, 2022, 09:59:23 PM »
Event on laggy shard,  client run smooth. 

Hope I read this right, look like you forget to add the VAR eggbook.,  I dont see the place to add my ID. 

Offline altiricTopic starter

  • Jr. Member
  • **
  • Posts: 81
  • Activity:
    0%
  • Reputation Power: 2
  • altiric has no influence.
  • Referrals: 1
    • View Profile
Re: Brute Force Egg Hunter
« Reply #6 on: May 16, 2022, 10:00:53 PM »
You shouldnt need to edit anything in the file, just click Autostart and it will ask you for the info in game :)

Offline Gaderian

  • Elite
  • *
  • *
  • Posts: 486
  • Activity:
    0%
  • Reputation Power: 10
  • Gaderian barely matters.Gaderian barely matters.
  • Referrals: 3
    • View Profile
Re: Brute Force Egg Hunter
« Reply #7 on: May 17, 2022, 07:02:47 PM »
Orion's built in pathfind routines probably look as good as one could get. I was playing with it for about an hour the other night and it was fun watching it navigate correctly around obstacles.

Did you remove this script intentionally? I wanted to see what you were doing with it, as Orion is new to me. The first post states nothing more descriptive than "Updated", it has the little icon to mean it has an attachment in the thread, but no attachments.

Gaderian
"Go ahead ask me: 'Should I use hard waits or timers?'"
You say:"Should I"
Gaderian:"Timers!"
You Say:"use hard waits or timers?"

The serious side of timer use is illustrated here: http://www.scriptuo.com/index.php?topic=12094.msg101926#msg101926

However, every time I go back and look at this [AutoLooter] script, I realize I had wrote it in my zen state of EUO scripting - so it makes my brain hurt.

Offline altiricTopic starter

  • Jr. Member
  • **
  • Posts: 81
  • Activity:
    0%
  • Reputation Power: 2
  • altiric has no influence.
  • Referrals: 1
    • View Profile
Re: Brute Force Egg Hunter
« Reply #8 on: May 17, 2022, 07:40:02 PM »
Ran into a glitch... I only tested it on one shard and did not realize every shard used different NPCs. Had to rework a couple things to get it running on all shards. Seems to be working quite smooth now.

Yes, the pathfinding is exceptional. You do run into glitches when you get into really long runs, but there are creative ways around them that still let you pull them off! Something i found really handy was using:
Code: [Select]
if(Orion.WalkTo(x, y, z, dist)){
    //something;
}

will return false if it cannot make it to that location (within dist), that was a game changer!

Offline Bulldog

  • Jr. Member
  • **
  • Posts: 10
  • Activity:
    0%
  • Reputation Power: 1
  • Bulldog has no influence.
  • Referrals: 0
    • View Profile
Re: Brute Force Egg Hunter
« Reply #9 on: May 17, 2022, 11:49:44 PM »
There is an inbuilt function Orion.CanWalk you can use that to see if character can reach the x,y,z before you even start the move

Offline altiricTopic starter

  • Jr. Member
  • **
  • Posts: 81
  • Activity:
    0%
  • Reputation Power: 2
  • altiric has no influence.
  • Referrals: 1
    • View Profile
Re: Brute Force Egg Hunter
« Reply #10 on: May 18, 2022, 12:23:18 AM »
There is an inbuilt function Orion.CanWalk you can use that to see if character can reach the x,y,z before you even start the move

using if(WalkTo) does the same thing but includes the distance check, it will return false if it can not make the walk, will walk if it returns true. :)
« Last Edit: May 18, 2022, 12:29:14 AM by altiric »

Offline Bulldog

  • Jr. Member
  • **
  • Posts: 10
  • Activity:
    0%
  • Reputation Power: 1
  • Bulldog has no influence.
  • Referrals: 0
    • View Profile
Re: Brute Force Egg Hunter
« Reply #11 on: May 18, 2022, 12:46:06 AM »
Ah did not know that! I am trying to get some archer movement going at the moment

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Referrals: 0
    • View Profile
Re: Brute Force Egg Hunter
« Reply #12 on: May 19, 2022, 04:44:55 PM »
Simple enough 
I have  a question . what does the 1,255,1 mean
 while(!Orion.WalkTo(egg.X(), egg.Y(), egg.Z(), 1, 255, 1)

Im curious

Offline altiricTopic starter

  • Jr. Member
  • **
  • Posts: 81
  • Activity:
    0%
  • Reputation Power: 2
  • altiric has no influence.
  • Referrals: 1
    • View Profile
Re: Brute Force Egg Hunter
« Reply #13 on: May 19, 2022, 04:48:35 PM »
Simple enough 
I have  a question . what does the 1,255,1 mean
 while(!Orion.WalkTo(egg.X(), egg.Y(), egg.Z(), 1, 255, 1)

Im curious

distanceToObject, Zoffset, walkRun
walkRun / 0 walks, 1 runs, 2 uses client default

Offline gruntman

  • Full Member
  • ***
  • Posts: 168
  • Activity:
    0%
  • Reputation Power: 2
  • gruntman has no influence.
  • Gender: Male
  • Referrals: 0
    • View Profile
Re: Brute Force Egg Hunter
« Reply #14 on: May 19, 2022, 04:49:49 PM »
Altiric thanks for your contribution to the community!!

script works well :)

Tags: