Author Topic: A little script help?  (Read 4615 times)

0 Members and 1 Guest are viewing this topic.

Offline seeriuslyTopic starter

  • Full Member
  • ***
  • Posts: 219
  • Activity:
    0%
  • Reputation Power: 6
  • seeriusly has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 0
    • View Profile
A little script help?
« on: October 23, 2010, 02:27:12 PM »
0
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!

Offline _C2_

  • AFK FtW
  • Global Moderator
  • *
  • *
  • Posts: 4077
  • Activity:
    0%
  • Reputation Power: 48
  • _C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!
  • RIP Pen Trick
  • Respect: +254
  • Referrals: 4
    • View Profile
Re: A little script help?
« Reply #1 on: October 23, 2010, 02:32:34 PM »
0
#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

Offline Dixie Wrecked

  • Full Member
  • ***
  • Posts: 124
  • Activity:
    0%
  • Reputation Power: 3
  • Dixie Wrecked has no influence.
  • Gender: Male
  • Respect: +31
  • Referrals: 1
    • View Profile
Re: A little script help?
« Reply #2 on: October 23, 2010, 02:38:06 PM »
0
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)...
"hmm, theres no examples and directions sticky in new member intros.  you have to admit script library would have been a good place to put it"
- karrde

Offline seeriuslyTopic starter

  • Full Member
  • ***
  • Posts: 219
  • Activity:
    0%
  • Reputation Power: 6
  • seeriusly has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 0
    • View Profile
Re: A little script help?
« Reply #3 on: October 23, 2010, 02:54:26 PM »
0
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.

Offline seeriuslyTopic starter

  • Full Member
  • ***
  • Posts: 219
  • Activity:
    0%
  • Reputation Power: 6
  • seeriusly has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 0
    • View Profile
Re: A little script help?
« Reply #4 on: October 23, 2010, 03:00:40 PM »
0
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!

Offline _C2_

  • AFK FtW
  • Global Moderator
  • *
  • *
  • Posts: 4077
  • Activity:
    0%
  • Reputation Power: 48
  • _C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!
  • RIP Pen Trick
  • Respect: +254
  • Referrals: 4
    • View Profile
Re: A little script help?
« Reply #5 on: October 23, 2010, 04:38:33 PM »
0
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
          }
     }
   

Offline seeriuslyTopic starter

  • Full Member
  • ***
  • Posts: 219
  • Activity:
    0%
  • Reputation Power: 6
  • seeriusly has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 0
    • View Profile
Re: A little script help?
« Reply #6 on: October 24, 2010, 11:14:07 AM »
0
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.
« Last Edit: October 24, 2010, 04:34:41 PM by seeriusly »

Offline Oracle

  • Hero Member
  • *
  • Posts: 888
  • Activity:
    0%
  • Reputation Power: 14
  • Oracle barely matters.Oracle barely matters.
  • Gender: Male
  • We always want something that we cannot have...!
  • Respect: +97
  • Referrals: 3
    • View Profile
Re: A little script help?
« Reply #7 on: October 24, 2010, 04:11:52 PM »
0
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!

« Last Edit: October 24, 2010, 04:14:05 PM by Oracle »
ORACLE
Get me a Straw...because I suck...!
PIXEL CRACK -- Love it! Crave it! Want it! Got to have it!

Offline Oracle

  • Hero Member
  • *
  • Posts: 888
  • Activity:
    0%
  • Reputation Power: 14
  • Oracle barely matters.Oracle barely matters.
  • Gender: Male
  • We always want something that we cannot have...!
  • Respect: +97
  • Referrals: 3
    • View Profile
Re: A little script help?
« Reply #8 on: November 03, 2010, 11:33:49 AM »
0
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...

 
 
ORACLE
Get me a Straw...because I suck...!
PIXEL CRACK -- Love it! Crave it! Want it! Got to have it!

Offline seeriuslyTopic starter

  • Full Member
  • ***
  • Posts: 219
  • Activity:
    0%
  • Reputation Power: 6
  • seeriusly has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 0
    • View Profile
Re: A little script help?
« Reply #9 on: November 03, 2010, 04:25:46 PM »
0
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.

Offline Khameleon

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: A little script help?
« Reply #10 on: November 03, 2010, 06:05:36 PM »
0
I guess I should talk to c2 about my Potion Factory additions...

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13303
  • Activity:
    0.4%
  • Reputation Power: 154
  • 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: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: A little script help?
« Reply #11 on: November 04, 2010, 12:04:54 AM »
0
I guess I should talk to c2 about my Potion Factory additions...

Heh, Kham has a new plaything......
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Khameleon

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: A little script help?
« Reply #12 on: November 04, 2010, 01:42:07 AM »
0
Don't worry TM I can split my playtime. :)

Tags: