ScriptUO

Official ScriptUO EasyUO Scripts => Script Library => Crafting => Topic started by: Guadah on August 16, 2011, 02:14:04 PM

Title: Guadah's Alchimests Assistant
Post by: Guadah on August 16, 2011, 02:14:04 PM
Code: [Select]
;  #############################################
; Script Name:  Guadah's Alchemist Assistant
; Author: Guadah
; Version: 1.2.0
; Client Tested with: EA 7.0.16.3 (Patch 53)
; EUO version tested with: 1.5 Version 199
; Shard OSI / FS:  OSI
; Revision Date: 8-22-2011
; Public Release: 7-11-2008
; Purpose: To Craft Alchemy Items
; Special Thanks:
;  * Trailmyx Persistant Variable Sub, advice & support
; ############################################

Title: Guadah's Alchemists Assistant

Current Version(s): v1.2.0
Beta Version: None

Special Thanks:
* TrailMyx Persistant Variable Sub, advice & support

Purpose: To Craft Potions

Set-up Difficulty:  Minimal

Comments:
This script is designed to craft potions.  I have created this script to make multiple potions in one sitting, or you can just make one.  In the future I will add the ability to make empty potion kegs, and fill kegs as well as just potions, however with stack-able potions that option may never hit the market unless it is highly requested.

The Menu is designed to be interactive for the user.  It starts small, but if you want to make more then just one type of pot in one sitting, it will expand by clicking on the + to add more chores for the script.  If you click on it too many times, you can click on the - and remove an option or two.

Makes:
 

Script supports Non-Tinkering crafters.  If you have under 50.0 Tinkering, the script will NOT attempt at making mortar's and pestle's, but instead will pull them out of our resources bag.  If you have over 50.0 Tinkering it will automatically craft the tools.

* Requires High Sea's Booster pack

1.2.0
Items Added:
Items to add to next patch:
* Security check for when users do not enter an amount, or if they enter other then numbers in the box.
* Keg Making (input data from the Keg Maker Script and update to work with the current menu)
Title: Re: Guadah's Alchimests Assistant
Post by: Guadah on August 17, 2011, 07:49:16 AM
Uploaded new version.

Added Greater Poison for those training poisoning.  May add Lesser and Normal in the future.
Corrected an issue when checking for resources.  (So update if you have an older version)
Title: Re: Guadah's Alchimests Assistant
Post by: _C2_ on August 17, 2011, 12:54:46 PM
I always enjoyed your menu for this script!  Good to see you around.
Title: Re: Guadah's Alchimests Assistant
Post by: Guadah on August 17, 2011, 02:19:44 PM
Thanks Cake.  This was my favorite, still to this day.
Title: Re: Guadah's Alchimests Assistant
Post by: Paulonius on August 18, 2011, 11:08:24 AM
Another nice contribution.
Title: Re: Guadah's Alchimests Assistant
Post by: MeWonUo on August 18, 2011, 02:01:24 PM
Running extremely well, and FAST!  Thank you.

Did run into a small issue where it isn't stopping once it has made the amount I input into the menu.  Which really isn't a problem since I usually make an extremely large amount per sitting.  I tested to make 200 GHeal, went to make a snack, came back and it had made 400 and was still going. :D 
Title: Re: Guadah's Alchimests Assistant
Post by: Guadah on August 18, 2011, 06:39:15 PM
Running extremely well, and FAST!  Thank you.

Did run into a small issue where it isn't stopping once it has made the amount I input into the menu.  Which really isn't a problem since I usually make an extremely large amount per sitting.  I tested to make 200 GHeal, went to make a snack, came back and it had made 400 and was still going. :D 

I'll take a look at it tonight.
Title: Re: Guadah's Alchimests Assistant
Post by: Guadah on August 18, 2011, 09:43:19 PM
I have uploaded the Beta of this script for v1.1.2, there are a few issues that I have left unresolved.  May be because it is late and I'm tired, or that I've just been plugging away at this script for hours trying to fix it.

I am going to be offline until tomorrow evening, so I will try to get back at this script then (Driving from my Mother-in-laws house in Cleveland back home to Pittsburgh).  If any of you feel motivated, and think you can decipher my mumbojumbo, please knock yourself out, I'd love the feedback and input.
Title: Re: Guadah's Alchimests Assistant
Post by: MeWonUo on August 18, 2011, 09:45:46 PM
I'll give it a run here in a few minutes and let ya know.
Title: Re: Guadah's Alchimests Assistant
Post by: Neo on August 18, 2011, 09:52:56 PM
What kind of issues are people having? My alchemist was banned together with my miner, so I couldn't give this a try and check for myself lol...

I'd love to try and help out though...
Title: Re: Guadah's Alchimests Assistant
Post by: MeWonUo on August 18, 2011, 11:18:29 PM
What kind of issues are people having? My alchemist was banned together with my miner, so I couldn't give this a try and check for myself lol...

I'd love to try and help out though...

It's not really a true problem.  Just noticed that it doesn't stop when it is finished making the amount you selected. 
Title: Re: Guadah's Alchimests Assistant
Post by: Guadah on August 19, 2011, 01:35:58 PM
I need to redo how the potion counts for potions, it's just a math issue.
Title: Re: Guadah's Alchimests Assistant
Post by: MeWonUo on August 19, 2011, 01:37:28 PM
Gave the new beta version another run last night.  

First test was 100 GHeal, 100 GCure, 100 GPoison.  No problems at all.  Once the correct number was made, the "Done!" message appeared and it moved onto the next potion type.

Second test was 600 GHeal, 400 GCure, 400 GPoison.  This time, it did the same thing as before.  I came back to check on it after quite some time and found that it had made almost 1000 GHeal and had not moved onto the next type.

Hope this info is of some use to you. :)
Title: Re: Guadah's Alchimests Assistant
Post by: Guadah on August 19, 2011, 01:49:55 PM
I just realized that the beta version of this script is the same as the old version.  I put about 2-3 hours of coding into the script, and 2-3 hours of testing and it did not save.

Back to square one.
Title: Re: Guadah's Alchimests Assistant
Post by: Guadah on August 19, 2011, 01:52:52 PM
I know what the problem is and where it is in the script.  I've re-written some of it, and am testing it, but have to re-write a lot of the changes I made last night... since I saved over them with the previous version of the script.

@#^@**@)#%$
Title: Re: Guadah's Alchimests Assistant
Post by: MeWonUo on August 19, 2011, 02:00:13 PM
I know what the problem is and where it is in the script.  I've re-written some of it, and am testing it, but have to re-write a lot of the changes I made last night... since I saved over them with the previous version of the script.

@#^@**@)#%$

OUCH!  Sorry to hear it Guadah...that really blows.
Title: Re: Guadah's Alchimests Assistant
Post by: gimlet on August 19, 2011, 02:23:44 PM
Been there done that - I feel your pain!
Title: Re: Guadah's Alchimests Assistant
Post by: Guadah on August 19, 2011, 07:18:56 PM
Alright, beta is back up.

I have added a counter to the right side of the Amount box that counts up as you get closer to your desired amount, have also cleaned up the code in a number of different subs... mostly because as I corrected one thing, I broke 2 others... etc etc.

Now I'm at the final stages, but there is just one hitch...

The way this script works is I have put in a base amount of resources to grab of each item.  i.e. Empty Potions are set at 100.  So when you run out it will clear the Finished Potions and grab more... however I've also tied the counter into this process.

Each time a potion is made I count.  example:
Code: [Select]
finditem %finished_items C_ , #backpackid
set %finished_count ( #findstack + %old_stack )
menu set %currently_crafting %finished_count

%finished_items are a list of every single 'finished' item the script makes.  %old_stack I will get to in a minute... but just assume that at this point the value is 0, so the second line will add up to whatever you have currently in your backpack (which is ONLY what your making because I clear the backpack during the beginning of the script)

Now after you run out of the empty potion bottles, it will clear the backpack of finished items.  Here is where I run into my major problem.  If somebody wants to make 2000 Greater Cure potions, they obviously can not keep that many in their backpack, so I used the variable %old_stack to count how many you cleared out of your backpack.  Example:

Code: [Select]
finditem %finished_items C_ , #backpackid
set %old_count ( %old_stack + #findstack )

The first time through the sub, it just does

set %old_count #findstack

Which would set %old_count at the value of 10.  Now I know I've only had Calculus, and that was over 15 years ago, but the second time it goes into that Sub, %old_stack should still be the value of 10, and the #findstack value will be 10 (if you're making something that has no failure %, which we are assuming for this experiment)... so it should be

set %old_count ( 10 + 10 )

and now %old_count should be 20... but THIS Is not the case.

The rest of the sub just clears out Finished items, so I left that out.  Now that part above I STILL think should work, but after the second cycle through, it keeps resetting back as if it was just the first time through.

Example
Say the Max amount you can pull into your pack is 10.  The script will make 10 potions, transfer those finished into the chest, then grab 10 more.  The counter will work as intended up to 20.  At this point the script takes those new 10 finished potions out of your backpack, drops into the chest, grabs 10 more but the counter starts back up at 11, not at 21.

I hope to God this makes sense to somebody here, even reading it I get a little confused.  I have to do something different because it's not like I can count attempts (Deadly Poison has a lot of failures), and at times I've lost Empty Potions when you fail and lose resources.  So I can't guarantee that I will ALWAYS send an equal amount to the chest each time and just do a multiplier.

At this point I've been fighting with this for a day and a half, and have tried everything I can think of.  Any of you have an idea?
Title: Re: Guadah's Alchimests Assistant
Post by: camotbik on August 20, 2011, 08:35:32 AM
e.g you could use something like this.
Code: [Select]
if #findcol = 333
set %Green_potion_ammount %Green_potion_ammount + #findstack

or
Code: [Select]
 event Property #findid
  if Apple , #spc , Crab in #property
    set %Apple_Crab_ammount %Apple_Crab_ammount + #findstack
Title: Re: Guadah's Alchimests Assistant
Post by: Guadah on August 20, 2011, 06:47:16 PM
Isn't that the same as
Code: [Select]
set %old_count ( %old_stack + #findstack )
So if I write it as
set %old_count %old_stack + #findstack

That will return different results?
Title: Re: Guadah's Alchimests Assistant
Post by: camotbik on August 21, 2011, 01:48:43 AM
Well yeah, but why use two variables if you can use just one(the one you need for the exact potion type)? e.g. in the future if you will insert an option to make 2000 greater heals and 2000 stamina potions your timer would be f up.

yeah and your problem is
Code: [Select]
if %old_stack >= 1 ; <--------- LOOK HERE!
   {
   set %old_count ( %old_stack + #findstack ) ; < ------ LOOK HERE
   for %i 1 #findcnt
       {
       finditem %finished_items C_ , #backpackid
       exevent drag #findid #findstack
        wait 10
       exevent dropc %dump_bag
        wait 15
       }
   return

You are setting %old_count %old_stack e.g. 55 + #findstack e.g. 33 so %old_count is 88 - you never use the variable latter in the code. The other thing after a lap you again are doing the same thing,getting  %old_count 55 to #findstack e.g. 44. I hope you understand this. I would use the method i stated above, it would eliminate much problems.
Title: Re: Guadah's Alchimests Assistant
Post by: Guadah on August 21, 2011, 07:28:34 AM
I think I get what your saying.  I have had an idea on what to do, but if I open up Easy UO and/or UO before helping clean the house, my wife may remove one, or both, of my testicles.

So off to fold some laundry, then I'll get knee deep into this.
Title: Re: Guadah's Alchimests Assistant
Post by: Guadah on August 22, 2011, 12:56:05 PM
Fixed the counting issue.  Thank god.

Still need to get my account upgraded to the High Sea's Booster pack to get the ID value of the Endless Water and test it in the script.  Will need to add a bit of code in to pull that before grabbing normal water's etc.  Otherwise the script is working like a boss.
Title: Re: Guadah's Alchimests Assistant
Post by: MeWonUo on August 22, 2011, 01:21:58 PM
Endless Decanter of water = VBM

I think that's what you were referring to. :)
Title: Re: Guadah's Alchimests Assistant
Post by: Guadah on August 22, 2011, 01:58:54 PM
I thank you sir.

* Front page is updated.
Title: Re: Guadah's Alchimests Assistant
Post by: NecroFox on August 29, 2011, 08:30:57 PM
Works like a dream thank you very much
Title: Re: Guadah's Alchimests Assistant
Post by: Endless Night on November 02, 2011, 08:04:54 PM
Congratulations your Script has been moved to the script library
(if you dont think the section is appropriate please pm me)
Thank you for your submission
Title: Re: Guadah's Alchimests Assistant
Post by: LV on March 31, 2012, 01:41:12 PM
Hi Gudah,

Wondering if your still updating this script.  I tried using it on siege to make black powder, and it is not working right.  The object id's are good, but it moves things around in a very strange way.  I have not had time to debug it, and before I do wanted to see if you are or are not actively updating it.  If not, let me know (or will assume if I dont hear from you that you are not.).  Anyways, it is moving 100 (i think) of the ingredients in, making one black powder, then moving ALL the ingredients out (2 extra moves), increments the counter by like a couple thousands, then says complete after making a couple black powders if i set quantity to say 10000.  If you need more info let me know, but I am sure this problem is not shard specific, and it DOES make 1 or 2 black powders so its not an object id problem due to upgrade either.


Regards,
LV


Title: Re: Guadah's Alchimests Assistant
Post by: Guadah on May 06, 2012, 06:14:53 PM
Hi Gudah,

Wondering if your still updating this script.  I tried using it on siege to make black powder, and it is not working right.  The object id's are good, but it moves things around in a very strange way.  I have not had time to debug it, and before I do wanted to see if you are or are not actively updating it.  If not, let me know (or will assume if I dont hear from you that you are not.).  Anyways, it is moving 100 (i think) of the ingredients in, making one black powder, then moving ALL the ingredients out (2 extra moves), increments the counter by like a couple thousands, then says complete after making a couple black powders if i set quantity to say 10000.  If you need more info let me know, but I am sure this problem is not shard specific, and it DOES make 1 or 2 black powders so its not an object id problem due to upgrade either.

Regards,
LV

If you feel up to digging through the code please feel free.  My class schedule is currently keeping me out of any games, I hardly have time to do anything but attend class, study, drink and sleep.  I need to install UO on my computer anyways!  If you find something go ahead and post it in an attachment and shoot me a PM.  I'll update the script and post your credits in the front page and in the script.  This is my favorite script of everything I wrote back in the day, so I'd love to see it continue to get updated.
Title: Re: Guadah's Alchimests Assistant
Post by: cdavbar on August 06, 2012, 05:17:52 PM
After looking through the script I found two things concerning the black powder.

The first was an easy fix.  The script was pulling the wrong amounts of each resource (pulling 600 charcoal and only 1 saltpeter and 1 sulfurous ash).

Code: [Select]
set %resource3 SZF ; sulfurous ash
   set %resource2_name Charcoal
   set %resource1_name Saltpeter
   set %resource3_name Sulfurous , #spc , Ash
   set %amount_to_grab1 600
   set %amount_to_grab2 100
   set %amount_to_grab3 100
   set %minimum_required_resource1 6
   set %minimum_required_resource2 1
   set %minimum_required_resource3 1

Should read like this:

Code: [Select]
set %resource3 SZF ; sulfurous ash
   set %resource2_name Charcoal
   set %resource1_name Saltpeter
   set %resource3_name Sulfurous , #spc , Ash
   set %amount_to_grab1 100
   set %amount_to_grab2 600
   set %amount_to_grab3 100
   set %minimum_required_resource1 1
   set %minimum_required_resource2 6
   set %minimum_required_resource3 1

The second issue concerning blackpowder I am a little stumped on since I am not used to using resourse names or color id's.  However I believe the reason the script ends after just making a few blackpowders is becuase it is counting the saltpeter and charcoal as blackpowder based of the code AFZ.

Code: [Select]
set %finished_items ZUF_AVF_NUF_UUF_XUF_YUF_TUF_OUF_AFZ
Since they all use that AFZ id then the script assumes you have made the requested amount based off of the resources it pulls to make the blackpowder.

*EDIT*

I also came to this conclusion on the %finished_items AFZ code since the script places the saltpeter and charcoal in the finished items container instead of back into the resource container.
Title: Re: Guadah's Alchimests Assistant
Post by: cdavbar on August 06, 2012, 05:19:11 PM
Once I can figure out how to make the %finished_items to use the resource name for blackpowder instead of the id, then this will work flawlessly for blackpowder! :)
Title: Re: Guadah's Alchimests Assistant
Post by: LV on October 08, 2012, 06:45:11 PM
I have worked around similar issues using event property to further refine a search on an object type (like blackrock having the same object type as diamonds, or discerning between runic hammers for example) if that helps.  I never got around to fixing it when i posted the problem for Gudah, but if you are stumped I could take a look.
Title: Re: Guadah's Alchimests Assistant
Post by: Grandewd on December 02, 2012, 03:44:52 PM
Just grab'd this script, and it's not recognizing the Endless Water Pitcher that's in my resource box. I check'd and the item type for it is VBM, just like regular water pitchers.  All references to water in the script are already set to VBM, so not sure what's wrong.  I'll look thru it and see if I can figure it out...
Title: Re: Guadah's Alchimests Assistant
Post by: cdavbar on March 11, 2013, 12:45:28 PM
After frying my brain, then taking a small break from UO, I think its time for me to give this black powder thing another shot.  Hopefully within the week I will have it fixed and working then post an update!
Title: Re: Guadah's Alchimests Assistant
Post by: NObama on March 11, 2013, 01:58:33 PM
Recommend:

- finditem SFZ in backpack
- Event Property #findid
- if "Saltpeter" IN #PROPERTY, ignoreid
- if "charcoal" IN #PROPERTY, ignoreid
- Then count the remaining SFZ items

That should get around the problem.
Title: Re: Guadah's Alchimests Assistant
Post by: cdavbar on March 12, 2013, 03:07:57 PM
Recommend:

- finditem SFZ in backpack
- Event Property #findid
- if "Saltpeter" IN #PROPERTY, ignoreid
- if "charcoal" IN #PROPERTY, ignoreid
- Then count the remaining SFZ items

That should get around the problem.

Ill give this a shot.
Title: Re: Guadah's Alchimests Assistant
Post by: J E T S on April 26, 2013, 11:09:01 AM
Just got this script and I am having the same problem with the endless water container not being recognized.  I even put pitchers of water in the resource container also and its still not recognizing any water.  Anyone look into this and find the problem yet?
Title: Re: Guadah's Alchimests Assistant
Post by: cdavbar on May 08, 2013, 07:56:47 AM
Just got this script and I am having the same problem with the endless water container not being recognized.  I even put pitchers of water in the resource container also and its still not recognizing any water.  Anyone look into this and find the problem yet?

I've never had any issues with the Endless Water Decanter.  Just my issues with the cannon ingredients that I for some reason cannot get fixed. 
Title: Re: Guadah's Alchimests Assistant
Post by: chiangwei on November 09, 2013, 02:09:44 AM
need  fix Greater Heal
Garlic 7


line 620:36 5 >>> 7
   set %minimum_required_resource2 7
 
Title: Re: Guadah's Alchimests Assistant
Post by: rwek on February 04, 2015, 06:06:13 AM
It seems the script requires 500 ginseng whenever it draws from container.

I had 270 left, and it said not enough (needed to finish 10 more potions)

Also had 2 stacks of ginseng, one stack has 27 the other 800, got the msg not enough in container halting script.


Also wouldn't start when i was testing it to make 1 potion until I had hundreds in there. Kept saying not enough.


I don't know if this is by design but its not making sense to me just yet.


Still testing it -



Fixed the typo where it was saying out of garlic when It should say out of ginseng (it had the correct item type, just typo for Gheal)


Title: Re: Guadah's Alchimests Assistant
Post by: Hoby on February 04, 2015, 11:15:43 AM
Don't know if Guaduh is still around
Title: Re: Guadah's Alchimests Assistant
Post by: Toymaker on July 01, 2020, 09:19:58 PM
First time i tried this script. wanted to say thank you for it because it is awesome!  ;D saved my trigger finger from the several thousand clicks..
Title: Re: Guadah's Alchimests Assistant
Post by: dirtmcgirt on July 07, 2020, 09:13:35 PM
This script is fantastic.  Great job!!  Would you ever consider adding lesser poison?  Trying to train poisoning and need a ton of lesser to get from 25-45.