|
only85 Beginner
Joined: 17 Jul 2002 Posts: 11 Location: USA
|
Posted: Tue Mar 11, 2003 8:26 am
Need Help picking up Items *magical* |
Ok,,, here is my desire
I play on a mud that has a Random Code for items.. So I can't have specific items "targeted" for pick up or know what they are... My character has the True seeing spell so I can see the Magic level of the items.. Weak magic..Moderate magic..etc
And I want to be able to pick up Items that are moderate magic and put them in a bag..
BUT.. there are more potions that are moderate and above then there are items, but I don't want the potions..
here is a few lines from the mud..for refrence.. with diff magic levels
(Potent magic) a cloudy blue potion with black swirls
(Moderate magic) the dazzling sea shell ring
(Moderate magic) a bright orange potion with green swirls
(Moderate magic) a pair of reinforced leather boots
Ok.. Ideally..sine I'm not a metal wearer..I wouldn't pick up metals at all..but I'll take it one step at a time
I want to be able to pick up everything but the potions... and sac them if possible.. then put the items I picked up in one of 6 empty bags...filling up each one..etc
Randoms can be in corpses...but..they could also be on ground...hrm.. lets assume for now on ground..I'll butcher the corpses so they will be....
I appriciate the help!!!
Collin - Only85 |
|
|
|
only85 Beginner
Joined: 17 Jul 2002 Posts: 11 Location: USA
|
Posted: Tue Mar 11, 2003 8:29 am |
oh..is there any way to make it not set off when I'm looking in my inventory or at myself?..hrm because that would be a pain in the ass!
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Mar 11, 2003 5:35 pm |
#TR {^~({Potent|Moderate} magic~) (*)} {#IF (%pos( "potion", %1) > 0) {sac %1} {get %1;put %1 in a bag}} Pickup
#AL i {#T- Pickup;~i;#ALA +2 {#T+ Pickup}}
#AL inv {#T- Pickup;~i;#ALA +2 {#T+ Pickup}}
#AL look {#IF (%1 = "self") {#T- Pickup;~look %-1;#ALA +2 {#T+ Pickup}} {~look %-1}}
LightBulb
Advanced Member |
|
|
|
only85 Beginner
Joined: 17 Jul 2002 Posts: 11 Location: USA
|
Posted: Wed Mar 12, 2003 12:25 am |
Hrm thats not bad...
Unfortunatly.. It doesn't seem to work quite yet...
I tested with this item
(Potent magic) You see a guard's standard issue mace here.
Was on ground
It put in this as commands
get You see a guard's standard issue mace here.
put You see a guard's standard issue mace here. bag
It obviously didnt work
is there a way to take what we have so far and when you see it it checks for a list of identifiers in the line, like ring..and gets ring if its ring..or get bracelet if bracelet ..etc
Also..not sure why but when I did I for inventory it tried to pick it all up
..hrm
Thanks for your help!
Collin |
|
|
|
joebeta Newbie
Joined: 12 Mar 2003 Posts: 4
|
Posted: Wed Mar 12, 2003 7:20 am |
You could do this
store the item in @item beforehand...
also make an string array like
#VAR a %array(ring,sword,poopoo,etc) <- syntax
#LOO 0,%arrhigh(a) {
#IF (@item ~= %arrget(i)) {get %arrget(i)}
}
it's not bug free... but it should work
Hehehehehehehe Bopalopia |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Mar 12, 2003 7:23 am |
quote: It obviously didnt work
Actually, there's nothing obvious about that. Many MUDs do things one way, while many others do the same things in other ways. Without specifics, nothing is obvious.
If you want to make a list of common keywords for things you want go ahead. Expect to miss some things that don't have common keywords in their descriptions (a flowing hoop of water).
#VAR get {potion|ring|bracelet}
#ADDI get mace
#TR {^~({Potent|Moderate} magic~) *({@get})} {#IF (%pos( "potion", %1) > 0) {sac %1} {get %1;put %1 bag}} Pickup
The simplest solution is probably:
#TR {~({Potent|Moderate} magic~)} {get all;drop all.potion;put all bag;sac all.potion} Pickup
As for why it tried to pick up your inventory, there are two possibilities.
1. You didn't copy my script exactly
2. It took the MUD more than two seconds to do your inventory
The first one is the most likely, and is easily checked. Just look in the editor for the class (folder) "Pickup" and see if that's where the trigger is at.
LightBulb
Advanced Member
P.S. In zMUD, lists are much easier to work with than arrays
P.S.S For myself, I just get everything and dispose of the junk periodically while resting. Evaluating what's worth keeping is a task which requires human judgment to do well. |
|
|
|
|
|