|
Mhildrum Beginner
Joined: 03 Aug 2004 Posts: 11 Location: Seattle
|
Posted: Tue Aug 03, 2004 9:09 pm
Inventory Maintenance long post |
Okay, this is a problem I could solve many different ways. First, let me say what I am trying to accomplish. when I type eqcond I see all my equipment, and what kind of shape it is in. (Example output below, probably with whitespace messed up) I want to create an alias that will identify which pieces need repair and then go repair them, then return to home. I use the settings editor to create my triggers and alias, so my format will be different than you are used to.
Output
o---------------------------------------------------------------------o
| Equipment Condition |
o---------------------------------------------------------------------o
| Slot | Description | Condition |
o---------------------------------------------------------------------o
| HEAD | a shimmering crown, made of ice | BAD |
| NECK | A shimmering sharks tooth necklace | VERY BAD |
| ARMS | Vambraces of Ghaal | QUITE GOOD |
| HANDS | a pair of gloves of human flesh (pulsing) | QUITE GOOD |
| LRING | amethyst ring | GOOD |
| RRING | amethyst ring | GOOD |
etc.
the conditions are color-coded, so at first I thought of matching colors, anything red or yellow needed to be fixed. Then I decided it was easier just to match with the words (Meriocre, bad, quite bad) etc. An example of the trigger pattern for catching this information is
| ARMS | Vambraces of Ghaal%s|%s(%*)%s|
I realized that I could get more and more general and end up with something along the lines of |%s(%w)%s|*|%s(%*)%s| and capture the slot and condition, and use generalized names for the contents of the slot. (i.e identifying my necklace as "A shimmering sharks tooth necklace" doesn't work, but necklace does. I can create a nickname for it of something like neck)
However, with this general trigger for all items, I can't specify simply armrepair = 1 if it needs repairs. should I go with a separate trigger for each slot? or is there something cool i could do to use only one trigger. (I can obviously turn on this generalized trigger in my alias and turn it off when I am done repairing.)
oh yes, and I don't know if it matters, but the format for repairing my item is something like
Remove 'eqname'
buy 1 'eqname'
wear 'eqname'
Thanks
Michael |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Aug 03, 2004 9:44 pm |
#TR {|%s(%w)%s|*|%s{MEDIOCRE|BAD|QUITE BAD|VERY BAD}%s|} {%1repair = 1}
|
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
|
Mhildrum Beginner
Joined: 03 Aug 2004 Posts: 11 Location: Seattle
|
Posted: Tue Aug 03, 2004 9:49 pm |
You see, some of us scribble with crayons, and some of us write poetry.
Thanks |
|
|
|
Mhildrum Beginner
Joined: 03 Aug 2004 Posts: 11 Location: Seattle
|
Posted: Fri Aug 06, 2004 3:57 pm |
Okay. I capture the conidtions fine. I have a alias that will get my repairing accomplished. I am just going to post it to see if anyone wants to streamline it, or has a better way of doing things. (again, not in the usual format posted here)
Alias reapairme
#t+ repair
totrepair = 0 // 0 items to repair. totrepair is used to get money for repair
eqcond
#alarm +1 {#show arqx595} // This is just a string that will set off the following trigger after
// the conditions have be en read. a better way to do this?
trigger arqx595
(move to bank)
#math gold (@totrepair*1000)
withdraw @gold
(move to blacksmith)
#if (@ARMSrepair) {remove ARMS;buy 1 ARMS;wear ARMS; #add totrepair -1}{}
#if (@LEGSrepair) {remove LEGS;buy 1 LEGS;wear LEGS; #add totrepair -1}{}
etc. through all 12 eq slots //
(move home)
#t- repair
so basically it works. don't fret over improving it or anything like that, I was just curious to see if there are better ways to do it.
Thanks
Michael |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Aug 06, 2004 6:21 pm |
You could put the script into the alarm instead of using the alarm to set off the trigger.
|
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
|
Mhildrum Beginner
Joined: 03 Aug 2004 Posts: 11 Location: Seattle
|
Posted: Mon Aug 09, 2004 3:09 am |
Okay, so I lied. I didn't really have the script working before, I just assumed it was. for some reason it is not working like I want. Probably some little bug that I can't find. Here it is..
#t+ repair
totrepair = 0
eqcond
#show @totrepair
#alarm +1 {#if (@totrepair != 0) {Do lots of stuff, bank withdraw ifs for eq and repair} {#say EQ is fine}}
#t- repair
and instead of doing lots of stuff, it just shows me in yellow letters
{Do lots of stuff, bank withdraw ifs for eq and repair} {#say EQ is fine}
(I would have copied the actual stuff in here, but it is about 100 lines unformatted, and making it look nice in a post is a pain for me)
Like I said, it is probably something minor that I missed, but any ideas on what would cause this? |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Aug 09, 2004 5:37 am |
Did you leave a space between {Do lots of stuff, bank withdraw ifs for eq and repair} and {#say EQ is fine}? I notice in your first post you skipped the space.
#if (@ARMSrepair) {remove ARMS;buy 1 ARMS;wear ARMS; #add totrepair -1}{} |
|
_________________ LightBulb
Senior member
Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious. |
|
|
|
Mhildrum Beginner
Joined: 03 Aug 2004 Posts: 11 Location: Seattle
|
Posted: Mon Aug 09, 2004 6:23 am |
There you have it. That was my mistake. Thanks a lot.
|
|
|
|
|
|