Author Topic: Kali's Bod Sorter for openEUO  (Read 81397 times)

0 Members and 2 Guests are viewing this topic.

Offline KaliOfLSTopic starter

  • That's "Dr." Kali to you!
  • Sr. Member
  • *
  • Posts: 406
  • Activity:
    0%
  • Reputation Power: 6
  • KaliOfLS has no influence.
  • Gender: Male
  • Respect: +33
  • Referrals: 2
    • View Profile
Re: Kali's Bod Sorter for openEUO
« Reply #135 on: February 10, 2014, 09:23:33 AM »
0
that is a result of the hash function.

I basically assign values (I can't remember them without looking at it exactly right now)
2 for a large bod
1 for iron
# for size
2 for exceptional etc...

Then I push that into my hash function as a table {1,2,1,20,0} etc... and that hashes the table values.

Check out my bodindexcreator.lua file.  It creates the hash table values and checks for collisions of those values based on the input values.
R~~~~ B~~~~~~~~ 
^ real life signature for sure

Offline KaliOfLSTopic starter

  • That's "Dr." Kali to you!
  • Sr. Member
  • *
  • Posts: 406
  • Activity:
    0%
  • Reputation Power: 6
  • KaliOfLS has no influence.
  • Gender: Male
  • Respect: +33
  • Referrals: 2
    • View Profile
Re: Kali's Bod Sorter for openEUO
« Reply #136 on: August 18, 2015, 08:56:51 AM »
0
Okay for those of you on freeshards (specifically, this worked on demise)

I have narrowed down one style that causes problems on freeshards. 

You can paste this at the very top of the ClassifySmithBods function (~line 444ish)

Code: [Select]
--DEMISE CORRECTION CODE
   
 
     if not BOD[2] or not ( BOD[2]:find('Normal') or BOD[2]:find('Exceptional') ) then
        table.insert(BOD,2,'Normal')
     end
     
     if not BOD[3] or not BOD[3]:find('Ingots') then
        table.insert(BOD,3,'Iron Ingots')
     end   
 

R~~~~ B~~~~~~~~ 
^ real life signature for sure

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.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Kali's Bod Sorter for openEUO
« Reply #137 on: August 18, 2015, 04:36:11 PM »
0
This was build when I was doing lot of BOD and was trying to come up with a way to bride and sort them.   If anyone have a better way to sort then I'm open to suggestion.      

You will need to label each book with the name below.  You also to replace the 2 file below with my.  I sugest that you move the original file of Kali into a own folder as back up.
 
Enjoy

The Ghost mod book naming for Smithing
Code: [Select]
120 Smith PS
60 ASH'
30 ASH'
Valorite Runic
Verite Runic
Agapite Runic
Gold Runic
Bronze Runic
Copper Runic
Shadow Runic
Dull Runic
2 parts
POF 20
POF 90
Smith Trash --Larges that give poor rewards
Smith Turn In --smalls that belong to larges that give poor rewards. Ready for recycling
--

The Ghost mod book naming for Tailor
Code: [Select]
120 Tailor PS
Barbed Kit
Horned Kit
Spined Kit
CBD
Tailor Bribes
Tailor Trash
Bribes to Barbed
Tailor Turn In



There are 2 attachment(s) in this post. You must register and post an acceptable introduction to download
bodindexcreator.lua
bodsorterindex.lua
« Last Edit: August 18, 2015, 04:43:10 PM by The Ghost »

Offline Dread385

  • Jr. Member
  • **
  • Posts: 33
  • Activity:
    0%
  • Reputation Power: 1
  • Dread385 has no influence.
  • Respect: +9
  • Referrals: 0
    • View Profile
Re: Kali's Bod Sorter for openEUO
« Reply #138 on: August 19, 2015, 06:43:58 AM »
0

6.  User defined variables:
Code: [Select]

--=======================================================================--
-- User defined variables
--=======================================================================--
local fName = "bodsorterindex.lua"           --Index file name                              
local lagOffset = 0                          --ms offset if you have slow connection
local MaxBookCnt = 500                       --Set this to a specific value if you want less than 500 bods/book                                                                                        
--Optional hardcoded setup
local sBagID = nil                           --Bag with bodbooks to sort
local dBagID = nil                           --Bag(s) with reward bodbooks
--If you wish to set more than one reward bag, set it as a table:
-- { bag1ID, bag2ID, ... }
--=======================================================================--
fName is the file name of the index you wish to sort.  This file MUST be placed in the SCRIPTS folder in the openEUO directory.  You can add a subdirectory via naming it such:  "SubDir/bodsorterindex.lua" or "SubDir/AnotherSubDir/WhyWouldIDoThis/MyIndex.sav", etc...
You can adjust the lagOffset if you experience journal message 'you must wait'... It is in ms, so 250 = 1/4 of a second.
sBagID and dBagID can be hard coded to avoid targeting setup during run time.


First... PLEASE excuse my ignorance!  I'm just learning about these scripts and there isn't exactly an easy learning curve.  :)  When I press play in oEUO I get this message "!C:\OpenEUO\kalibodsorter.lua:34: could not open file".  I do have the file in the same folder as the oEUO.exe, but I don't see a "SCRIPTS" folder in any part of the EUO folder to place the files in.  Am I overlooking something?

Offline KaliOfLSTopic starter

  • That's "Dr." Kali to you!
  • Sr. Member
  • *
  • Posts: 406
  • Activity:
    0%
  • Reputation Power: 6
  • KaliOfLS has no influence.
  • Gender: Male
  • Respect: +33
  • Referrals: 2
    • View Profile
Re: Kali's Bod Sorter for openEUO
« Reply #139 on: August 19, 2015, 06:55:34 AM »
0
When you download oEUO, it should have been zipped with a few .dll files, the exe, and a scripts, gui, and examples folder. 

This is the latest version.
http://download.easyuo.com/cheffe/openeuo/bin/openeuo_150415.zip


Alternatively, it does seem like you're using oEUO, or you wouldn't have gotten that message.  You can try leaving the scripts in the oEUO folder and delete 'scripts/' from the do file line.  I would suggest just checking the download again.  EasyUO (EUOX) doesn't need to be in the same folder as openEUO. 

Let me know if you don't understand what I mean
R~~~~ B~~~~~~~~ 
^ real life signature for sure

Offline Dread385

  • Jr. Member
  • **
  • Posts: 33
  • Activity:
    0%
  • Reputation Power: 1
  • Dread385 has no influence.
  • Respect: +9
  • Referrals: 0
    • View Profile
Re: Kali's Bod Sorter for openEUO
« Reply #140 on: August 19, 2015, 10:26:16 PM »
0
I have 3 folders in oEUO.  "docs", "examples", and "gui" along with 3 .dll files:  lua51, objects, and uo.  Then I have your 3 files bodsortersindex.lua, kalibodsorter.lua, and kalilib.lua.

This is the section as you have written for the do file line

dofile(getinstalldir().."/scripts/"..fName)
dofile(getinstalldir()..'/scripts/kalilib.lua')

I've tried deleting the "scripts" several ways and I'm still getting errors.

Offline KaliOfLSTopic starter

  • That's "Dr." Kali to you!
  • Sr. Member
  • *
  • Posts: 406
  • Activity:
    0%
  • Reputation Power: 6
  • KaliOfLS has no influence.
  • Gender: Male
  • Respect: +33
  • Referrals: 2
    • View Profile
Re: Kali's Bod Sorter for openEUO
« Reply #141 on: August 19, 2015, 10:55:05 PM »
0
Hah, so I just checked it, my bad.  It doesn't come with a /Scripts folder any longer. 

Simple fix method, just create a new folder called scripts in the oEUO directory and add it to the folder.  Trust me, you'll thank me later.. well actually, I create several sub directories.  I have one for my library scripts, my scripts, down loaded scripts, etc.. I have like several versions of scripts, it becomes a mad house.


Second fix, just change those lines to

dofile(getinstalldir()..fName)
dofile(getinstalldir()..'kalilib.lua')

If you already made them exactly like that, then what is the errors you're getting?
R~~~~ B~~~~~~~~ 
^ real life signature for sure

Offline Dread385

  • Jr. Member
  • **
  • Posts: 33
  • Activity:
    0%
  • Reputation Power: 1
  • Dread385 has no influence.
  • Respect: +9
  • Referrals: 0
    • View Profile
Re: Kali's Bod Sorter for openEUO
« Reply #142 on: August 20, 2015, 11:13:20 PM »
0
Alright! Time for the update!  I added the "scripts" folder in oEUO and it worked with no problem.  I added Ghost's index and renamed my books so I could get some of the other rewards I wanted.  This thing flew through the BODs like crazy!  It stopped a few times but reading the bottom of the script told me what books I needed to name in order to place rewards.

I wouldn't have been able to do this without your script... Thank you very much to both you and Ghost!  If you have any idea what would cause it to hang up please let me know, but even as is I will continue to use it!

Now that that's complete... which BOD filler should I go with?
« Last Edit: August 20, 2015, 11:29:06 PM by Dread385 »

Offline KaliOfLSTopic starter

  • That's "Dr." Kali to you!
  • Sr. Member
  • *
  • Posts: 406
  • Activity:
    0%
  • Reputation Power: 6
  • KaliOfLS has no influence.
  • Gender: Male
  • Respect: +33
  • Referrals: 2
    • View Profile
Re: Kali's Bod Sorter for openEUO
« Reply #143 on: August 20, 2015, 11:23:27 PM »
0
Hi Hi,

What were the bods that didn't get placed in a book?  That is strange, I didn't have this problem, but who knows with the different index.  Even in that case, it should havqe errored with a 'table index is nil' message if it couldn't find a book for it.  Also, when it does 'stop', if it prints anything, please let me know and it can help me track down what is happening.  Anyway, I use snicker's bod filler, I'm not sure if he's here on SUO, but I thought he was.  Let me ask, because his bod filler doesn't allow one to fill bods that are in books. 

He did make it 'callable' though (it is euox, not openEUO script) and I wrote a script that manages removing bods from books, calling his filling functions, and then stuffing them back in a book. 
R~~~~ B~~~~~~~~ 
^ real life signature for sure

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.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Kali's Bod Sorter for openEUO
« Reply #144 on: August 21, 2015, 07:59:24 AM »
0
All the credit go the Kali, he the one with the brain to build this.  I just made a few chance that were more to my  favor.


I change those variable due to lag on other shard and don`t have issue anymore.   and less deeds in the book so I can move then around.

local fName = "bodsorterindex.lua"           --Index file name                             
local lagOffset = 150                          --ms offset if you have slow connection
local MaxBookCnt = 300                       --Set this to a specific value if you want less than 500 bods/book                                                                                         
--Optional


Dread , I`m still trying to come up with a chart to BoD to bride to get reward, I had started and never finish it.   I was thinking of Bribe one,  Bribe twice and Bribe tree time.   

Offline Dread385

  • Jr. Member
  • **
  • Posts: 33
  • Activity:
    0%
  • Reputation Power: 1
  • Dread385 has no influence.
  • Respect: +9
  • Referrals: 0
    • View Profile
Re: Kali's Bod Sorter for openEUO
« Reply #145 on: August 21, 2015, 09:15:36 AM »
0

Dread , I`m still trying to come up with a chart to BoD to bride to get reward, I had started and never finish it.   I was thinking of Bribe one,  Bribe twice and Bribe tree time.   

That'd be awesome!  Please keep me in the loop when you get it finished up if you don't mind sharing.  As I am using it I'm keeping notes on anything out of character.  I was too excited about using it and working out what ever issues I caused by improper set up or what not to take notes before.  I'm at work now, but when I get home and work through more I will share that info.  Earlier today I filled a bod that was marked as 30 ASH ' and got a 105 PS.  Then I did bods marked as Shadow Runic and got Dull Copper hammers as the reward.  I'll go through some more later, but is this a set up issue on my end or something more?

Offline Dread385

  • Jr. Member
  • **
  • Posts: 33
  • Activity:
    0%
  • Reputation Power: 1
  • Dread385 has no influence.
  • Respect: +9
  • Referrals: 0
    • View Profile
Re: Kali's Bod Sorter for openEUO
« Reply #146 on: August 21, 2015, 09:23:13 AM »
0
Hi Hi,

What were the bods that didn't get placed in a book?  That is strange, I didn't have this problem, but who knows with the different index.  Even in that case, it should havqe errored with a 'table index is nil' message if it couldn't find a book for it.  Also, when it does 'stop', if it prints anything, please let me know and it can help me track down what is happening.

I didn't know what I was looking for but I looked at the script and noticed an error at the bottom stating Verite Runic not available or something similar to that.  That being the case I looked back through my books and noticed there was no book named that.  I renamed a blank one and put it in place.  That fixed that problem, and it flowed flawlessly after that.

I commented on Ghost's thread down from this one about the rewards not matching to what the book states.  So far 30 ASH ' = 105 PS, and Shadow Runic = Dull copper hammer.  Have you experienced this or is it something I did wrong in setting it up?

Offline KaliOfLSTopic starter

  • That's "Dr." Kali to you!
  • Sr. Member
  • *
  • Posts: 406
  • Activity:
    0%
  • Reputation Power: 6
  • KaliOfLS has no influence.
  • Gender: Male
  • Respect: +33
  • Referrals: 2
    • View Profile
Re: Kali's Bod Sorter for openEUO
« Reply #147 on: August 21, 2015, 09:34:09 AM »
0
Well, I can't comment for the accuracy of ghosts index.  Mine was based on the tower of roses table here:
http://tor.bplaced.net/bods-srw.htm

If you look at for instance, small valorite bods, 10/15 sized ones, you have a 40% chance at a dull hammer and 60% chance for a shadow hammer.  In these situations it might not yield what you want/expect. 

With that being said, yes, I am working on swapping my bods today and will sort my next batch.  When I do, I'll try to hunt down my bugs in my next bod sorter version, which I've worked out some of the kinks already.  In this version, it will grab an empty bod book and rename it for you!  No more stopping because it can't find your bod book :D
R~~~~ B~~~~~~~~ 
^ real life signature for sure

Offline Dread385

  • Jr. Member
  • **
  • Posts: 33
  • Activity:
    0%
  • Reputation Power: 1
  • Dread385 has no influence.
  • Respect: +9
  • Referrals: 0
    • View Profile
Re: Kali's Bod Sorter for openEUO
« Reply #148 on: August 21, 2015, 10:13:07 AM »
0
Well, I can't comment for the accuracy of ghosts index.  Mine was based on the tower of roses table here:
http://tor.bplaced.net/bods-srw.htm

If you look at for instance, small valorite bods, 10/15 sized ones, you have a 40% chance at a dull hammer and 60% chance for a shadow hammer.  In these situations it might not yield what you want/expect. 

With that being said, yes, I am working on swapping my bods today and will sort my next batch.  When I do, I'll try to hunt down my bugs in my next bod sorter version, which I've worked out some of the kinks already.  In this version, it will grab an empty bod book and rename it for you!  No more stopping because it can't find your bod book :D

That's probably all it was.  I wasn't thinking about the fact that I got the most probable reward out of the BOD I was turning in.  I did 6 of the BODs from Shadow Runic and all came out dull copper but that could have just been a coincidence.  I'm not a smart man when it comes to anything BOD related.  That's why these BOD scripts are a life saver for me and I really appreciate all the help I'm receiving!  Please keep me posted on your update.  I'm already amazed at how great this currently works I can't wait to see how much better it can get! 

Offline KaliOfLSTopic starter

  • That's "Dr." Kali to you!
  • Sr. Member
  • *
  • Posts: 406
  • Activity:
    0%
  • Reputation Power: 6
  • KaliOfLS has no influence.
  • Gender: Male
  • Respect: +33
  • Referrals: 2
    • View Profile
Re: Kali's Bod Sorter for openEUO
« Reply #149 on: August 21, 2015, 10:55:09 AM »
0
Thanks, I appreciate the kind words on my script.  Makes me feel good that other people find it as helpful.  It started because I was trying to mod this old Razeil one and didn't like how it worked and how hard it was to customized.  If I recall right, the think even would pull a book, drop a bod, return the book over and over again instead of dropping all the bods for that book at that time.  So these were the things I wanted to focus on- making it customizable for what a person wants AND to make it more efficient.  I am sure there are many ways to problem solve it, but when I wrote it at this time, I was huge into looking up information security, cryptology, and hash functions.  That is the core of this script.  It hashes the bods (value associated) but in hind sight, I could simply concat the values into a string, and I *may* change this. 


i.e.
The bod gets assigned values for
Size (Large/Small)
Quality (Exceptional/Normal)
Material (iron/dull/etc..)
Amt (10/15/20)
Item (Ring/Chain/Plate/blah)

Imagine a small, exceptional, shadow iron ingot, 20, ringmail sleeves
And a small, exceptional, shadow iron ingot, 20, chainmail sleeves

The bod values are { 1,2,3,20,1 } and { 1,2,3,20,2 }
I hash those values
Hash( 1,2,3,20, 1 )
Hash( 1,2,3,20, 2 )

Which returns two values that are different.  The sorter then looks up those hash values which are keys in the index associated with a string, that string is the name of the book.
Index[ Hash( 1,2,3,20,1 ) ] = Book For this Reward
Index[ Hash( 1,2,3,20,2 ) ] = Book for another reward

However, I realize that I could simple use

Index[ "123201" ]
Index[ "123202" ]

But alas, what's done is done and the result probably isn't any different.

What's faster, appending a value to a string or hashing a few values, I'm not entirely sure.

The issue here is that I would be calling a lot of functions
tostring(1)..tostring(2)..tostring(3)..tostring(20)..tostring(1)
veruss

sum = 0
sum = sum * 41 + 1
sum = sum * 41 + 2
sum = sum * 41 + 3
sum = sum * 41 + 20
sum = sum * 41 + 1
sum = sum % 67735

Which is faster? I don't know.  tostring(1) undoubedtly is a mathmatically operation to turn the number value into the ascii (or UTF/UNICODE) value associated with it, and then string concat I have absolutely no idea since I'm unfamiliar with pascal memory management.  In C++ I believe a string is a contigious block of memory so it would involve memory allocation and movement.  In short, would it be worth my effort to make the sorting guts easier for others to understand and an index that is intuitive to look at?  Short answer, it's fast enough so I will probably never change this aspect.

R~~~~ B~~~~~~~~ 
^ real life signature for sure

Tags: Bods  Bod