ScriptUO

Official ScriptUO EasyUO Scripts => Script Library => Crafting => Topic started by: pow on January 26, 2021, 09:24:06 PM

Title: Bod Book Lister
Post by: pow on January 26, 2021, 09:24:06 PM
Is there a script to list all bods in a book into a .txt file? I am a noob when it comes to this so hoping someone can help me find one or if someone has one I could use.
Thanks.
Title: Re: Bod Book Lister
Post by: Gaderian on January 27, 2021, 04:14:19 AM
There is a script that is close which could add quantity, quality and do what you need. It is attached in this post:
http://www.scriptuo.com/index.php?topic=15975.msg124167#msg124167 (http://www.scriptuo.com/index.php?topic=15975.msg124167#msg124167)

What it does now is make a list of the item. So the other fields need to be added.

Large bods often run the text together so have problems listing because of how the text is displayed and wrapped coming from OSI. You would have to accept it as is or figure your own solution. You or some kind soul may be willing to help adjust it for you’re needs. I created that but do not have the time now to revise it. Anyone is welcome to se it as a base for another script.

There may be a finished tool somewhere kicking around but I do not know...

Gaderian
Title: Re: Bod Book Lister
Post by: pow on January 27, 2021, 04:41:59 PM
Ill be honest. I have no idea how to insert fields or utilize these additional inserts or programs. Just looking for a point and click if you know what I mean.

Thanks.
Title: Re: Bod Book Lister
Post by: Gaderian on January 27, 2021, 05:06:04 PM
I can post an update to include quantity and quality.
It would take a bit of testing to determine how to identify large bods. I certainly do not have the bods to test that personally.
If you would like that moderate effort I could add those, but first run it as is and say whether that matches what you are looking for.
Title: Re: Bod Book Lister
Post by: pow on January 27, 2021, 05:39:09 PM
Guess I need step by step instructions. I copy paste script and hit run.
Where does the kalocr come in? Where do I copy that to. Like I said, I am a noob when it comes to this. All I want is to target a book and it lists the bods in that book into a text file?
Does this do that? I really appreciate the help on this. Thank you.
Title: Re: Bod Book Lister
Post by: Gaderian on January 27, 2021, 09:09:38 PM
kalocr.txt is saved to the same folder (subdirectory) where your EasyUO.EXE (EUO.EXE?) is.
You do not need to open the kalocr file and you do not run it directly. The other script calls it (so it needs to be in the directory I mentioned...)

You would open the bod lister script in easyuo. run it. it asks you to target the book. you can't really do much while the script is running. Don't go off surfing on the web... just let the script run for a short time to process the book. It will look like the screen flashes with a black box a few times. That is the process where it writes to the file.

It is even more simple than I thought.

If you want quality and quantity... it needs stuff added. I did not remember what I wrote. I just knew it reads bod items and writes to a file - which a greate part of matching what you requested.
It would not be hard to use the KalOCR routines that do smith and tailor bods. Expanding it to do the other newer bods will not be ready for a while  yet.

So, how do you run this?
1) save the files in the same directory as your Easyuo program
2) login as your character near your bod books. The books can be on a vendor, in a container, in your backpack... doesn't matter where.
3) open the BOD_lister.txt
4) Optionally change the name of the filename to create to hold the bod listing. The default is called TinkBOD.txt. It appends information to this file if it exists each time you run it. When I was doing this for a bunch of skills, I just kept the file open in my text editor and reloaded it after each run, then added a new line to say the next skill I was testing in the next bod book.
5) run the BOD_lister.txt

You now have a text file with the basic item name to craft on from the bod. it doesn't work clean for large bods because of the OSI text that overlaps the name of long items with the quality of the item. But that is problem with the bod book itself and not this script.

My suggestion is to run it as is... see if that is something like what you want. If it is then it may be worth adding the quality/quantity information if that is required by you. If this is nothing like what you want... you tried and evaluated and nothing other than a couple posts worth of time has been wasted.
Title: Re: Bod Book Lister
Post by: pow on January 28, 2021, 10:13:37 PM
Appreciate the step by step. I tried what you said and after I targeted book, UO Crashed ( Not responding) and spinning blue wheel of death. Not sure why it didnt work:( I tried multiple times.
Thanks.
Title: Re: Bod Book Lister
Post by: Gaderian on January 28, 2021, 10:57:58 PM
double check that kalocr.txt is in the same directory with your euo.exe
restart your euo and all uo clients

Title: Re: Bod Book Lister
Post by: pow on January 30, 2021, 10:48:47 AM
Well this is what I got that was listed in the TINKbod.txt file??? I thought it listed out the bods in book? Did I do something wrong here?

$platemail arms$helmet$platemail legs$hammer pick$chainmail coif$chainmail leggings$chainmail tunic$broadsword$short spear$N/A$platemail gorget$platemail gloves$plate helm$platemail tunic$buckler$maul$katana$$$$
Title: Re: Bod Book Lister
Post by: Gaderian on January 30, 2021, 12:29:12 PM
How would you like the data formatted? Type out an example of what you would like to see from a BOD.
Title: Re: Bod Book Lister
Post by: pow on January 30, 2021, 01:23:31 PM
I would like it to list it as it looks in the book.


Title: Re: Bod Book Lister
Post by: Gaderian on January 31, 2021, 11:29:50 AM
I updated Kal's bod book lister. His format was more like what you would receive from an event property on a BOD when not in a book. It is currently only written for Blacksmithy and Tailoring BODs.

Small BODs would be simple to change the format to something a little more readable.
Large BODs share information and have a list of how many items are on the BOD.

EUO is not very good at processing and formatting text. So while Kal's script does a nice job of extracting the data, EUO is not really good at breaking it back apart to format over several lines.

If it were me, I would use a text processing tool to reformat the output into what I wanted. While it can be chained in order with EUO, it would require you to install another tool on your computer. If you are up to that - great! If you want to look elsewhere, or give it a stab yourself, I can post the code. Here is an example of the current output for a small and a large BOD:
Code: easyuo
  1. a bulk order deed$blessed$Small bulk order$all items must be made with Shadow Iron ingots.$normal$amount to make: 20$platemail gorget: 0$price: 0$  
  2. a bulk order deed$blessed$Large bulk order$all items must be made with Bronze ingots.$normal$amount to make: 20$chainmail coif: 0$chainmail leggings: 0$chainmail tunic: 0$price: 0$

I would love for it to look like this, but I can't think of a simple way requiring a little bit of effort by me to make it happen in EUO alone:
Code: [Select]
Small Shadow normal amount: 20 price: 0
platemail gorget: 0
Large Bronze normal amount: 20 price: 0
chainmail coif: 0
chainmail leggings: 0
chainmail tunic: 0

It can be done with a routine to break apart the string into tokens, using the $ as a delimiter for the information.
Use the str functions to grab all the items between "amount to make:" and "price" - to give the items on the bod.
print the first line
then loop to print each of the items

Gaderian
Title: Re: Bod Book Lister
Post by: pow on January 31, 2021, 07:34:25 PM
I would love for it to look just his. I want to list out my thousands of bods into excel sheets so I can filter out. I need to know what type I have total in each book. Just like this would be perfect:

Small Shadow normal amount: 20 price: 0
platemail gorget: 0
Large Bronze normal amount: 20 price: 0
chainmail coif: 0
chainmail leggings: 0
chainmail tunic: 0
Title: Re: Bod Book Lister
Post by: Gaderian on January 31, 2021, 07:59:59 PM
If you are looking to pull it into a spreadsheet, then you could simply use the original script and parse the fields at each $ character.

Gaderian
Title: Re: Bod Book Lister
Post by: pow on January 31, 2021, 08:01:04 PM
Yes, but that doesnt provide the entire bod name, type, quality or amount to make.
Thats what Im looking for. Not sure if I am explaining correctly.
Title: Re: Bod Book Lister
Post by: Gaderian on January 31, 2021, 08:05:08 PM
Right.
So then that first method would be ideal if the price column were moved ahead of the items on the bod?
Title: Re: Bod Book Lister
Post by: pow on January 31, 2021, 08:24:18 PM
I want it to list it like the book, like the photo in a txt format. Pretty simple, I just dont know anything about writing these, just using them.

Title: Re: Bod Book Lister
Post by: Gaderian on January 31, 2021, 08:43:49 PM
So you need an additional column to keep it together as a set for the large bods, if you want to sort in a spreadsheet. Maybe a number to keep the records together like the time stamp when it was read would be simple enough.

On the other hand, if it listed as a single record for small or large, then it wouldn't require that ID column.

A lot of the data is fluff (like the "A bulk order deed" and "blessed"). If the price were moved before any of the items that make up the deed, then it would be able to pull into a spreadsheet and keep all the data for the individual BOD intact - even if you wanted to sift and sort the information.

So just kicking around ideas on how the data would be useful...
Code: [Select]
Large : Material : Normal|Exceptional : Qty : Price : item1 : item1 qty : item2 : item2 qty : item 3 : item3 qty : item4 : item4 qty : item5 : item5 qty : item6 : item6 qty
Small : Material : Normal|Exceptional : Qty : Price : item1 : item1 qty

The one missing thing would be linking up matches of small with large to allow filling a large.

Code: [Select]
Artificial ID (time stamp) : Large : Material : Normal|Exceptional : Qty : Price : item1 : item1 qty
Artificial ID (time stamp) : Large : Material : Normal|Exceptional : Qty : Price : item2 : item2 qty
Artificial ID (time stamp) : Large : Material : Normal|Exceptional : Qty : Price : item3 : item3 qty
Artificial ID (time stamp) : Large : Material : Normal|Exceptional : Qty : Price : item4 : item4 qty
Artificial ID (time stamp) : Large : Material : Normal|Exceptional : Qty : Price : item5 : item5 qty
Artificial ID (time stamp) : Large : Material : Normal|Exceptional : Qty : Price : item6 : item6 qty
Artificial ID (time stamp) : Small : Material : Normal|Exceptional : Qty : Price : item1 : item1 qty

This organization would allow sorting by the original book order, or making a set out of the Large items together, but also sorting by the Item# column which would bring the large and small together which could be used to fill a bod. I think that would be a more useful format.

Think about what you want to accomplish using the spreadsheet and let me know.

Gaderian
Title: Re: Bod Book Lister
Post by: pow on February 01, 2021, 11:30:52 AM
I am onboard with what your thinking. I don't need to know price or if its blessed. All I need to know is the content of the bod:

1. Large : Material : Normal|Exceptional : Qty :
sm bods within large :
Material-Exc/Normal/ item to be made and qty

2. Small : Material : Normal|Exceptional : Qty

Again, just looking for it to list out the bods on boo kin a basic format so I can filter and list what I need. Thanks again!
Title: Re: Bod Book Lister
Post by: pow on February 01, 2021, 12:50:37 PM
The spreadsheet is just a means of listing out the BODS total that I have. Then I can use this list to either sell, or use to organize in a way I will understand better:)

Thank you:) :) ;)