Author Topic: Gaderian Simple BOD sorting  (Read 738 times)

0 Members and 1 Guest are viewing this topic.

Offline GaderianTopic starter

  • Elite
  • *
  • *
  • Posts: 386
  • Activity:
    4.6%
  • Reputation Power: 9
  • Gaderian has no influence.
  • Respect: +44
  • Referrals: 2
    • View Profile
Gaderian Simple BOD sorting
« on: January 01, 2022, 11:47:54 PM »
0
This is dependent on books setup named appropriately. There are 3 setup per craft skill. There are ways to get it to run through the sort with some manual effort and get it to end up fully sorting the book. It will sort if you empty 100 bods into your backpack - then it loads these into the book adding them in order - so there is some sorting element to the large and corresponding small bods.
There is a miscellaneous book for each skill. These are what I consider the junk bods - really these are just smalls that have no corresponding match for a large bod.

Books are named:
Alchemy Small to Large
Alchemy Small
Alchemy Miscellaneous
Blacksmith Small to Large
Blacksmith Small
Blacksmith Miscellaneous
Carpentry Small to Large
Carpentry Small
Carpentry Miscellaneous
Cooking Small to Large
Cooking Small
Cooking Miscellaneous
Fletching Small to Large
Fletching Small
Fletching Miscellaneous
Inscription Small to Large
Inscription Small
Inscription Miscellaneous
Tailor Small to Large
Tailor Small
Tailor Miscellaneous
Tinker Small to Large
Tinker Small
Tinker Miscellaneous

I stacked all these so I can stand in the middle and reach any.
This is the script I wanted to add more sophisticated sorting to so that it would use multiple intermediate books to complete a Merge-Sort operation. I doubt that will happen by me.

Some clever person could make that happen and front end these with a script and a pretty menu to drive all the scripts.

This has a very simple structure to accomplish the sort decisions, but it is not fast. Since I said that up front, it means no one else needs to say it.

I also know there is not one for Cooking. My opinion on Cooking BODS is reflected by that fact.

You have loose bods in your backpack and stand close enough to the books. Run the respective script for the skill.

The last attachment, BODPoints_Smith.txt is for calculating the points from turning in a Blacksmith BOD. This kind of evaluation can be the basis to sort by reward type. I only put that together for Blacksmith to assist another forum member, MeWonUO. It is just an idea for a different way to go about sorting. That doesn't run, but is simply a routine to be implemented in a BOD sorting script. It could be expanded to do other craft skill BOD point calculations.

There are 8 attachment(s) in this post. You must register and post an acceptable introduction to download
BODPoints_Smith.txt
BodSort_Alchemy.txt
BodSort_Blacksmith.txt
BodSort_Carpentry.txt
BodSort_Fletching.txt
BodSort_Inscription.txt
BodSort_Tailor.txt
BodSort_Tinkering.txt
« Last Edit: January 19, 2022, 01:51:06 AM by 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 CityKitty

  • Jr. Member
  • **
  • Posts: 39
  • Activity:
    1.2%
  • Reputation Power: 1
  • CityKitty has no influence.
  • Gender: Female
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: Gaderian Simple BOD sorting
« Reply #1 on: January 03, 2022, 01:43:38 PM »
0
Oh boy, I can't wait to try this script. It looks like it will really cut down on the time it takes to sort through all my BoD books. I'll let you know how it works for me.
If you ain't the lead dog, the view never changes

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13208
  • Activity:
    5.2%
  • Reputation Power: 153
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1346
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Gaderian Simple BOD sorting
« Reply #2 on: January 03, 2022, 03:12:51 PM »
0
What?!!? No cooking?!?!?  Killjoy.  :P
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline formerlyrara

  • Full Member
  • ***
  • Posts: 137
  • Activity:
    2%
  • Reputation Power: 2
  • formerlyrara has no influence.
  • Respect: +19
  • Referrals: 0
    • View Profile
Re: Gaderian Simple BOD sorting
« Reply #3 on: January 08, 2022, 11:52:42 AM »
0
Thank you! will give this a try this weekend. Wish we had this in beginning of December lol!

Offline GaderianTopic starter

  • Elite
  • *
  • *
  • Posts: 386
  • Activity:
    4.6%
  • Reputation Power: 9
  • Gaderian has no influence.
  • Respect: +44
  • Referrals: 2
    • View Profile
Re: Gaderian Simple BOD sorting
« Reply #4 on: January 08, 2022, 02:01:45 PM »
0
This is so simple that I consider it unworthy.

It does give a method to save those that fill large bods, from those that do not - without having to memorize it. But that was it's only point - so it succeeds at that.

This can show you how you can VERY SLOWLY sort some bods, but is screaming to be optimized. For me it was functional, because I wanted to siphon off the non-LBOD filling ones to fill and get more to fill large - for my testing.

If this satisfies a niche other than my own, then it will be good. There are better methods of organization for BODs though... just saying.
"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 formerlyrara

  • Full Member
  • ***
  • Posts: 137
  • Activity:
    2%
  • Reputation Power: 2
  • formerlyrara has no influence.
  • Respect: +19
  • Referrals: 0
    • View Profile
Re: Gaderian Simple BOD sorting
« Reply #5 on: January 15, 2022, 05:02:47 PM »
0
Gaderian,

Okay so far testing out Smith and Tailor, neither are working. First the smith has two item ids it is asking for, book id and container ID. I am going to assume the container is where the 3 smith bod books you are putting the bods into would go, no problem simple fix, find it add it in. The other one for the bookID, you have it hardcoded i assume some sort of possible testing on your end because you state to have them loos in your bag. So i do put a ID in there after testing with what was present in hopes it is not looking for it. Now it does see the bods, it picks it up and puts it right back down in back pack. Goes and does this with each one over and over and does not move them. Yes i used your list you provided for naming the books and yes I see the names the script is looking for on the sorting end (Large, Small etc).

Tailor script is different in that it does not have the id lines like in the smith (no issue), but the same set up and same result.

Suggestions?

I am not using any _ in the names of the bod books.. it is straight as you posted.  Thanks!
Alchemy Small to Large
Alchemy Small
Alchemy Miscellaneous
Blacksmith Small to Large
Blacksmith Small
Blacksmith Miscellaneous
Carpentry Small to Large
Carpentry Small
Carpentry Miscellaneous
Cooking Small to Large
Cooking Small
Cooking Miscellaneous
Fletching Small to Large
Fletching Small
Fletching Miscellaneous
Inscription Small to Large
Inscription Small
Inscription Miscellaneous
Tailor Small to Large
Tailor Small
Tailor Miscellaneous
Tinker Small to Large
Tinker Small
Tinker Miscellaneous

Offline GaderianTopic starter

  • Elite
  • *
  • *
  • Posts: 386
  • Activity:
    4.6%
  • Reputation Power: 9
  • Gaderian has no influence.
  • Respect: +44
  • Referrals: 2
    • View Profile
Re: Gaderian Simple BOD sorting
« Reply #6 on: January 15, 2022, 05:40:13 PM »
0
So you have loose tailor BODs in your backpack. (The BODs are *NOT* in a book already.)
You have the 3 tailor books locked down on the floor of your house, within 2 tiles of where you stand.
You run the script and it doesn't put any of the bods away?

Am I understanding correctly?
"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 formerlyrara

  • Full Member
  • ***
  • Posts: 137
  • Activity:
    2%
  • Reputation Power: 2
  • formerlyrara has no influence.
  • Respect: +19
  • Referrals: 0
    • View Profile
Re: Gaderian Simple BOD sorting
« Reply #7 on: January 16, 2022, 04:12:47 AM »
0
Yup that is correct. I did it first with 3 smiths first, then 3 tailor bods. Tried with both in main backpack and then with just same type. I even changed the backpack back to default (I use snow backpack), and still continued. I can see it pick up the BOD in backpack and then drops it right there in same pack, then moves to next one.

Offline GaderianTopic starter

  • Elite
  • *
  • *
  • Posts: 386
  • Activity:
    4.6%
  • Reputation Power: 9
  • Gaderian has no influence.
  • Respect: +44
  • Referrals: 2
    • View Profile
Re: Gaderian Simple BOD sorting
« Reply #8 on: January 16, 2022, 05:10:17 AM »
0
Sounds like the books are not in reach (2 tiles) or are not type DYM on your shard. I never checked if books can be turned and have a different type - can you verify the type for the BOD books?
"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 formerlyrara

  • Full Member
  • ***
  • Posts: 137
  • Activity:
    2%
  • Reputation Power: 2
  • formerlyrara has no influence.
  • Respect: +19
  • Referrals: 0
    • View Profile
Re: Gaderian Simple BOD sorting
« Reply #9 on: January 16, 2022, 05:38:40 PM »
0
Added three screenshots here to assist, findtypes, and you can see what i am pointing at, the books are within 2 tiles of me, and you can see the names on the books.

There are 3 attachment(s) in this post. You must register and post an acceptable introduction to download
Screenshot_7.jpg
Screenshot_8.jpg
Screenshot_9.jpg

Offline GaderianTopic starter

  • Elite
  • *
  • *
  • Posts: 386
  • Activity:
    4.6%
  • Reputation Power: 9
  • Gaderian has no influence.
  • Respect: +44
  • Referrals: 2
    • View Profile
Re: Gaderian Simple BOD sorting
« Reply #10 on: January 16, 2022, 06:21:18 PM »
0
So the script is looking for the BOD books to be stacked and locked down on the ... ground.
It does a 'finditem DYM G' statement to locate the books.

You have your books in a container which requires a different finditem parameter:
'finditem DYM C'

Lock those books down on your floor and stack them - it will sift and sort BODS like crazy out of your backpack. ;)
"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 formerlyrara

  • Full Member
  • ***
  • Posts: 137
  • Activity:
    2%
  • Reputation Power: 2
  • formerlyrara has no influence.
  • Respect: +19
  • Referrals: 0
    • View Profile
Re: Gaderian Simple BOD sorting
« Reply #11 on: January 18, 2022, 04:28:35 AM »
0
Apologies in delay of response, was out of town. Okay locked the bod books down on floor, ran script, seems to be sorting fine, with exception of larges, which i understand. Once i removed larges from the mix it works flawless.

This was with smith (sorting 1k plus right now) once done will run through rest of them to see how it fairs and provide feedback. Thanks.

One suggestion is on smith, i use all the weapons to fill and turn in 1 at a time to get a new bod (better faster way to get armor types), do you have any issues with me modifying (learning how) to adjust the iron weapons to the misc bag for crap bods?

Offline formerlyrara

  • Full Member
  • ***
  • Posts: 137
  • Activity:
    2%
  • Reputation Power: 2
  • formerlyrara has no influence.
  • Respect: +19
  • Referrals: 0
    • View Profile
Re: Gaderian Simple BOD sorting
« Reply #12 on: January 18, 2022, 05:33:30 AM »
0
Okay testing done!!

Larges - to fix the problem with larges not being sorted, i had to rename the skill small, to skill large... that worked.. all the smalls were beign sorted properly into the small to large category.. in the script it was looking for specific word large first (way i am reading it first)  set %bod_carpentry_large #findid .. so recommend changing the instructions to making skill large.. I have to assume that the small to large is sufficient (but can probably change it to small and will work). Will test that next go around.

All bods sorted (didnt do cooking).

Thank you for this script -- SUPER fast and went through 3k bods in literally 10 minutes..

PS dont run the scripts all at once together.. they work, but tinker messes up :)

Offline GaderianTopic starter

  • Elite
  • *
  • *
  • Posts: 386
  • Activity:
    4.6%
  • Reputation Power: 9
  • Gaderian has no influence.
  • Respect: +44
  • Referrals: 2
    • View Profile
Re: Gaderian Simple BOD sorting
« Reply #13 on: January 18, 2022, 10:46:06 AM »
0
Glad it is working for you.

I do not believe these could run in parallel. The whole of the #FIND... variables, along with #LOBJECTID and #LTARGETID would be stomping on each other, unless you are using separate characters in parallel. The drag/drop timers would be a mess. I tried to setup a script to run each in succession because I would go collect all the bods from various NPC's and return home to unload.

I think your efficiency comment (3k in 10 minutes) is a bit over the top. ;) It can push about 500 Miscellaneous bods in 10 minutes, but the SBOD/LBOD would take longer. I have run this plenty and my results have been dismal compared to those numbers.

As for changing it - knock yourself out. This is not so much a script as snippets of logic.

I think sometimes people dream about what could be on another authors hard drive, but the reality is there are some great scripts and a bunch of tools to just avoid mouse actions.

The "sort" option of these scripts is worse than even a Bubble Sort. There are 3 changes that I can count off the top of my head to get it to the Bubble Sort level of efficiency. This could be 1/3 it's execution speed with about 20 lines of code added.
1) On each pass, determine the lowest entry in the sort list for the next pass - since reading each one anyway. This shortcut might be in one of the scripts already, but it would be the most speed improvement to these scripts with about 2-3 lines of code added.
2) Keep track of the event property data so it only happens once per BOD in your backpack in an array.
3) Initially do step 2 for all BODs in backpack, then create a list on how to sort those. Add to the book in that order. This is "sorting a linked list" method common in languages like C.

That kind of rewrite would allow sorting 125 BODs from your backpack in probably 2.5 minutes. That does not count removing BODs from a book. I never timed how fast a BOD can be removed from a book, but if it is 1 second then this becomes an overall 4.5 minute operation.

That is about as good as speed gets for BOD/time. The limit is how much can you hold in your backpack. If you want to go beyond that, it needs a more complex organization, but it will still sort at about 125 in 4.5 minutes - just extended to sort more BODs.

Here is a rough outline to extend this to multiple books:
When we were doing the research last year for the BODs, there is a BOD book reading script which uses OCR to get the data. It consistently flakes out on a few BOD names (IIRC 'Summon Air Elemental' is one example) which we fixed manually to generate the lists that were posted. Since those mistakes are consistent, it is possible to just know that it is the right name of that BOD.
1) Start with that tool as a basis to read the contents of several BOD books, then generate arrays for each book's contents.
2) Create the sort (linked list) as another array.
3) Determine in order for each source book the matching BODs to remove.
Now Repeat for each BOD book in the source group:
 4) Open the BOD book
Go through each page of the book
 4a) Remove each BOD from the front to back of this book. Each time a BOD is removed, adjust all BODs after that for a correct page and entry.
 4b) keep track of how many you have removed and before you get to your backpack limit add the BODs to the final book. When done Re-Open this book and restore the page.
 4c) Repeat 4a until the end of the book.
 4d) Next source book -> goto step 4)
5) Add these BOD to the final book.

This allows pulling from multiple books and only handling each BOD once to remove it from it's source book and add it to the final sorted book.

There are still further optimizations that could happen, but most users wouldn't be able to follow the rules needed to get this any faster - because mostly it involves not touching your PC while it runs. :)
(Instead of exevent drag/exevent dropc - go back to the old "event drag/mouse p" method. The major risk is that it lead to client crashes, but the CEOTurbo training scripts use it pretty reliably and get drag/drop times < .7 second by my personal testing/estimation. I would not advise the work required to make that happen in a public script - too many people with their own setup who will expect you to support them personally. CEO did a great job with it, but has a lot of code to support freeshards, production shards, screen setup, etc. If there is a list of "Top Scripts Ever", then those saturate the Top 10!)

As slow as this is, it functions. I think the first one required about 1 hour to get working (Inscription) and the other crafting copies mainly just changed the list for how to order these and the value for how many BOD-Titles there were for the loops. I run it and go cook dinner. I come back and it's done. So taking it to more extremes for me is just an exercise in "what can I make it do?" and doesn't give much personal benefit - other than being able to have a scripted solution to sort a book which holds more items than my backpack.
"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 GaderianTopic starter

  • Elite
  • *
  • *
  • Posts: 386
  • Activity:
    4.6%
  • Reputation Power: 9
  • Gaderian has no influence.
  • Respect: +44
  • Referrals: 2
    • View Profile
Re: Gaderian Simple BOD sorting
« Reply #14 on: January 18, 2022, 08:07:45 PM »
0
I think Inscription may be different, because it was the first one of these I wrote. Regardless, at one point there were 2 ways to determine any Miscellaneous bods.

Either these were defined explicitly, or they were not defined and assumed to be Miscellaneous.

Most of the scripts do the 'not defined and assumed Miscellaneous' when the bod did not match a Large Bod definition.

If you re-order (renumber?) the Large Bod definition and do not include (comment out?) the bods that you want to become Miscellaneous, then those will be added the that book.

Since this was really about a discussion for how to sort BODs, there is also the "Reward" sort idea. I helped MeWonUO with a routine to evaluate points for a BOD. I can't give you his whole scripts, but I can share the routine snippet that I wrote to calculate those point values. This can serve as an example for how to extend that to other Bod craft rewards. I will add it in on the first post when I locate it on my computer in a minute.
"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.

Tags: