ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: seeriusly on October 23, 2010, 02:27:12 PM

Title: A little script help?
Post by: seeriusly on October 23, 2010, 02:27:12 PM
I am working on a script to make blackpowder using another crafting script...

I don't have much experience with scripting, though I have better than average puzzle solving abilities.  I am just wondering how I can set %blackpowder AFZ , %charcoal AFZ, & %saltpeter AFZ to where the scripts knows the color since they are all the same ID.

Can anyone shed light?  thanks in advance!
Title: Re: A little script help?
Post by: _C2_ on October 23, 2010, 02:32:34 PM
#FINDCOL when you find item may show a difference but if it doesn't

then event property would be a function to look at names and see if there are differences
Title: Re: A little script help?
Post by: Dixie Wrecked on October 23, 2010, 02:38:06 PM
I am working on a script to make blackpowder using another crafting script...

I don't have much experience with scripting, though I have better than average puzzle solving abilities.  I am just wondering how I can set %blackpowder AFZ , %charcoal AFZ, & %saltpeter AFZ to where the scripts knows the color since they are all the same ID.

Can anyone shed light?  thanks in advance!

I haven't upgraded, so I can't give specifics, but if you specify #findcol as another search parameter, it will help to differentiate them.  An alternate idea is to use event property and search for either black_powder, charcoal, or saltpeter in the name, assuming those are the actual names of the items:

Code: [Select]
set %itemtofind black_powder (or whichever you want)
findAFZ:
finditem AFZ c_ , Container
if #findkind = -1
  code to do whatever when out of it
event property #findid
if %itemtofind notin #property
  {
  ignoreitem #findid
  goto findAFZ
  }
continue on doing whatever you wanted to do once the right one is found...

that should work (with obvious things to be changed) for using the #property for the items...for #findcol, just compare the color of the found item to the known color for the item and go from there (and if you don't know the colors to start, put 1 piece of black powder in your backpack, then find it and note #findcolor...move that out of backpack and have 1 piece of charcoal in pack and do the same, then repease for saltpeter and you should have all 3 colors)...
Title: Re: A little script help?
Post by: seeriusly on October 23, 2010, 02:54:26 PM
Thankyou guys for your fast replies.

So I can't put the color in the start of my script?  I know the colors...

Code: [Select]
set %saltpeter AFZ ;*COLOR 1150*
set %ash SZF
set %instruments RQF ;*mortar pestal=RQF*
set %blackpowder AFZ ;*COLOR 1109*
set %charcoal AFZ ;*COLOR 1190*
set %blackpowderfinal

If I can't I guess I will have to learn how to use the code you wrote me.  It makes sense, just was hoping I could plug these items into this script, and code menu buttons accordingly.
Title: Re: A little script help?
Post by: seeriusly on October 23, 2010, 03:00:40 PM
I haven't upgraded, so I can't give specifics, but if you specify #findcol as another search parameter, it will help to differentiate them.  An alternate idea is to use event property and search for either black_powder, charcoal, or saltpeter in the name, assuming those are the actual names of the items:

Code: [Select]
set %itemtofind black_powder (or whichever you want)
findAFZ:
finditem AFZ c_ , Container
if #findkind = -1
  code to do whatever when out of it
event property #findid
if %itemtofind notin #property
  {
  ignoreitem #findid
  goto findAFZ
  }
continue on doing whatever you wanted to do once the right one is found...

that should work (with obvious things to be changed) for using the #property for the items...for #findcol, just compare the color of the found item to the known color for the item and go from there (and if you don't know the colors to start, put 1 piece of black powder in your backpack, then find it and note #findcolor...move that out of backpack and have 1 piece of charcoal in pack and do the same, then repease for saltpeter and you should have all 3 colors)...

This makes sense, and I think there is an area that looks similar in the script for where I can replace it.  Thankyou for your help!
Title: Re: A little script help?
Post by: _C2_ on October 23, 2010, 04:38:33 PM
something like that may work too


Code: [Select]
finditem AFZ c_ , Container
if #findkind <> -1
    {
    for #findindex 1 #findcnt
         {
          if #findcolor <> 1150
                ignoreitem #findid
          if #fincolor = 1150
                gosub do whatever u need
          }
     }
   
Title: Re: A little script help?
Post by: seeriusly on October 24, 2010, 11:14:07 AM
okay, so this worked... Thanks to you guys.

Code: [Select]
 finditem %grains C_ , %box
  for #findindex 1 #findcnt
    {
     IF  #Findcol = %saltcolor
       {
       exevent drag #findid 300
       exevent dropc #backpackid
       wait 30
       }
   }
 
Now I need help figuring out how to code the following:
1.
 a. check resources
 b. if saltpeter, charcoal, or ash is below what I need to make the item
 c. then return to beginning of script

Then I think the script will be done.  Well it will work, but won't be the prettiest thing we ever did see.

Thank you in advance for any help I can receive.
 

I have figured this part out...  Script works, and makes blackpowder effortlessly.  Going to clean it up before I post to debug.  Thankyou guys for your help.
Title: Re: A little script help?
Post by: Oracle on October 24, 2010, 04:11:52 PM
The Powder Charges are "the" most tedious item to make in the game.  First you have to make the black powder with an alchemist and either tinker up all the mortar and pestles you are going to need, or have them in a secure ready to use.  After you make over 1k in Black Powder (less is just not enough), then you switch to your tailor to make the Powder Charges in Light or Heavy.  Personally I think Light Cannon Supplies are pointless.  Three Skills and and over 5 ingredients to make 1 item!

Seriously (play on words, get it?), this is a good idea for a Script...Good Luck with it!

Title: Re: A little script help?
Post by: Oracle on November 03, 2010, 11:33:49 AM
Seeriusly,

Did you ever get this Script to work the way that you wanted it to?  Having spent hours making 'Black Powder' and Heavy cannon Charges, this would help deter Carpal Tunnel...

 
 
Title: Re: A little script help?
Post by: seeriusly on November 03, 2010, 04:25:46 PM
NO, I can't differentiate the same item id's that are different colors.  Don't make me waste all night again getting nowhere... lol I  have been working a ton of hours, so will have to be a weekend thing.  Not to mention, I am out of saltpeter to test with.
Title: Re: A little script help?
Post by: Khameleon on November 03, 2010, 06:05:36 PM
I guess I should talk to c2 about my Potion Factory additions...
Title: Re: A little script help?
Post by: TrailMyx on November 04, 2010, 12:04:54 AM
I guess I should talk to c2 about my Potion Factory additions...

Heh, Kham has a new plaything......
Title: Re: A little script help?
Post by: Khameleon on November 04, 2010, 01:42:07 AM
Don't worry TM I can split my playtime. :)