Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
nazradin
Apprentice


Joined: 23 Mar 2003
Posts: 114
Location: New Zealand

PostPosted: Sun Mar 30, 2003 8:21 pm   

Loot script for GS3 help needed
 

trying to get a script to work that will look in a room(if the look is needed) identify loot from a string pick it up and put it away, would be nice if it kept running till all the loot identified in the string had been picked up, but having to run it again, thinking best would be either a trigger set to a T+- button or an alias with a temp trigger. It is not a good idea to have this script running 100% of the time even with stow weapons as part of the trigger there are definatly times when picking up loot is a very bad idea.

this has a lot of potental uses i have many escape scripts that could be converted into this sort of format.


room format is...

[ROOM NAME]
You notice a(or an)
Also here:
Obvious paths: north, south, east, west


somthing along the lines of maybe?
below is a short string list of some of the kinds of loot found

#CLASS {GEMSTONE|LOOT}
#VAR gems {despanal|blazestar|shell|orb|wand|amulet|diamond|emerald|lapis lazuli|opal|mother-of-pearl|pearl|ruby|sapphire|topaz|coral|amethyst|bloodstone|garnet|gem|jasper|crystal|quartz|moonstone|tourmaline|spinel|diopside|cordierite|zircon|carbuncle|feystone|glimaerstone|hyacinth|jacinth|faenor-bloom|shard|gold ring|chalcedony|turquoise|stone|dust|obsidian|amber}
#TRIGGER getloot {#IF (%ismember(%1, @gems)) {match = %1)
{open my @gemcontainer;get @match;put @match in my @gemcontainer;close my @gemcontainer}}
#CLASS 0


it is possible to turn off the room name with set !room and back on with set room, i currently do this with my escape scripts and many rooms have words like stone in them which is problematic at least in escape.


i have been reading the documents and there seem so many ways to go about this that the above with some help from shalimar is what i have comeup with so far. Any help appreciated


Nazradin
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Apr 03, 2003 12:46 am   
 
You appear to have omitted the trigger pattern. It also has a typo or two.
#TR getloot {You notice %w (*).} {#IF (%ismember( %1, @gems))
{open my @gemcontainer;get %1;put %1 in my @gemcontainer;close my @gemcontainer}}

LightBulb
Advanced Member
Reply with quote
nazradin
Apprentice


Joined: 23 Mar 2003
Posts: 114
Location: New Zealand

PostPosted: Sat Apr 05, 2003 4:58 pm   
 
quote:

You appear to have omitted the trigger pattern. It also has a typo or two.
#TR getloot {You notice %w (*).} {#IF (%ismember( %1, @gems))
{open my @gemcontainer;get %1;put %1 in my @gemcontainer;close my @gemcontainer}}

LightBulb
Advanced Member



#CLASS {Gemstone|Variables}
#VAR gemcontainer {longcoat} {longcoat}
#CLASS 0
#CLASS {Gemstone|Highlights}
#ALIAS gems {#VAR gems {%additem( %0, @gems)}}
#TRIGGER {{@gems}} {#CW 15}

#VAR gems {despanal|blazestar|shell|orb|wand|amulet|diamond|emerald|lapis lazuli|opal|stone|mother-of-pearl|pearl|ruby|sapphire|topaz|coral|amethyst|bloodstone|garnet|gem|jasper|crystal|quartz|moonstone|tourmaline|spinel|diopside|cordierite|zircon|carbuncle|feystone|glimaerstone|hyacinth|jacinth|faenor-bloom|shard|gold ring|chalcedony|turquoise|stone|dust|obsidian|amber}
#CLASS 0

#CLASS {Gemstone|LOOT}
#TRIGGER {You notice (*) (%w){,|and|.}} {#IF (%ismember( %2, @gems)) {open my @gemcontainer;get %2;put %2 in my @gemcontainer;close my @gemcontainer}}
#CLASS 0


#BUTTON 40 {LOOT OFF} {#T+ LOOT} {LOOT ON} {#T- LOOT} {} {1} {} {Size} {72} {20} {Pos} {21} {796} {} {} {} {} "" {Inset} {} {} {3}

seems to have a few issuse when there are many items in the room especialy no loot items like armor and swords, been told to try %x for %w.

button for T-+ seems to be the wrong way around but thats what works .

if anyone has any suggestions for setting this up in a different more effective way or sees an obvious error please reply

cheers Nazradin
Reply with quote
nazradin
Apprentice


Joined: 23 Mar 2003
Posts: 114
Location: New Zealand

PostPosted: Sat Apr 05, 2003 5:32 pm   
 
to clarify trouble

the loot script only seems to work with things in room that are in the loot VAR, will pick up a stone and a gem for instance but if a stone and an arrow are in room will not pick up the stone. tried useing %w and %x if %w is a word variable then that is preferable so doesnt pick up words in the middle of others.

[Ta'Vaalor, Victory Court]
You notice a bright chrysoberyl gem and some cactacae spine.
Obvious paths: east, west

doesnt work yet

Ta'Vaalor, Victory Court]
You notice some cactacae spine and a bright chrysoberyl gem.

does work
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Apr 05, 2003 7:57 pm   
 
You can find the meaning of %w, %x, and other wildcards by looking in the helpfile
index under "patterns". You'll also find links to the same page in the help for
triggers. Instead of taking someone else's word (including mine) for whether you should
use %w, %x, *, or some other wildcard, look them up and decide for yourself which fits
your situation best.

Try not to make your pattern longer than is actually needed. The less you have to match,
the easier it is to write.

In this case, the key portions of the phrase seem to be:
You notice means there's something you might want to get
gem is one of the desired items listed in @gems.

Therefore, you want a pattern that starts with You notice, a wildcard for
possible additional text, and ends with the list in @gems. Anything that comes after the
keyword from @gems won't matter.
#TR {You notice* ({@gems})} {get %1}

LightBulb
Advanced Member
Reply with quote
nazradin
Apprentice


Joined: 23 Mar 2003
Posts: 114
Location: New Zealand

PostPosted: Sun Apr 06, 2003 12:57 am   
 

thanks for the help again Lightbulb that works great.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net