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
Feanor
Novice


Joined: 12 Mar 2003
Posts: 37

PostPosted: Sun Mar 23, 2003 3:13 am   

Need help with looting alias/trigger
 
I can't seem to figure out how to approach this so I am going to post the two ideas I've had and see which ball anyone runs with.

I want to get all pouches of gold, coin purses, piles of coins, and moneybags. Sending the "item" command to the mud returns:

You see
1. a Pouch of gold
2. some light Chainmail (2 +0)
3. some Coins
4. a Pouch of gold
5. a Pouch of gold
6. some light Chainmail (2 +0)
7. a steel Ring
8. a Coin purse
9. a Moneybag
10. a Pouch of gold
11. a Pouch of gold
12. a Moneybag
13. a Pouch of gold
14. a Coin purse
15. a Moneybag
16. a Bag o' gems
17. a Pouch of gold
18. a Pouch of gold
19. a Pouch of gold
20. a Pouch of gold

Twenty items max in a room. I can "get" "pouch", "money", and "coin" to pick up the cash.

OR

Without looking I can "get pouch", etc.

If the item isn't there the MUD output is:

I don't see the 'money'.

Or pouch or coin.

I was thinking of an alias "loot" that would use the #until command with the "I don't see..." to turn off the loop, but I'm having problems figuring out which to use, loop, repeat, etc. I also need a 2 second delay after picking up each item, and #wait doesn't seem to be doing what I expect it to, either.

Ideas, comments, suggestions?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Mar 23, 2003 6:47 am   
 
There is almost never a reason to use #WAIT. So I will write a setup with an alarm. I will be using something like your second idea, because sending item, capturing and processing the list will take longer then just catching the 'not here' message.

#CLASS LootGrabber
#ALIAS loot {get money;#T+ LootAlarm}
#TR {^I don't see the 'money'.$} {#T- LootAlarm}
#ALARM "LootAlarm" {*2} {get money}
#CLASS 0
Reply with quote
Feanor
Novice


Joined: 12 Mar 2003
Posts: 37

PostPosted: Sun Mar 23, 2003 7:44 am   
 
Ok, I think I see where this is going. Since I have to pick up all three (money, pouch, coin) do I have to write three Alarms
CoinAlarm
MoneyAlarm
PouchAlarm
and enable them sequentially?
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sun Mar 23, 2003 9:48 am   
 
#ALIAS doloot {#T+ DoLoot;l}
#TRIGGER {You see} {#VAR V_DoLoot 0;#TEMP DoLootEndTrig {^$} {#T- DoLoot}} "DoLoot"
#TRIGGER {~. a Pouch of gold$} {#ALARM +@V_DoLoot {#SEND {get pouch}};#ADD V_DoLoot 2} "DoLoot"
#TRIGGER {~. some Coins$} {#ALARM +@V_DoLoot {#SEND {get coins}};#ADD V_DoLoot 2} "DoLoot"
#TRIGGER {~. a Coin purse$} {#ALARM +@V_DoLoot {#SEND {get purse}};#ADD V_DoLoot 2} "DoLoot"
#TRIGGER {~. a Moneybag$} {#ALARM +@V_DoLoot {#SEND {get moneybag}};#ADD V_DoLoot 2} "DoLoot"

How about something like that.

Ton Diening
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Mar 23, 2003 7:05 pm   
 
A single alarm can cover all three if you use a variable as the item to get.

#CLASS LootGrabber
#ALIAS loot {#VAR loot money;#T+ LootAlarm}
#TR {^I don't see the '@loot'.$} {#IF (@loot = "coin") {#T- LootAlarm};#IF (@loot = "pouch") {#VAR loot coin};#IF (@loot = "money") {#VAR loot pouch}}
#ALARM "LootAlarm" {*2} {get @loot}
#CLASS 0
#T- LootAlarm


LightBulb
Advanced Member
Reply with quote
Feanor
Novice


Joined: 12 Mar 2003
Posts: 37

PostPosted: Mon Mar 24, 2003 10:32 pm   
 
Thanks for the timely help, Lightbulb.

Where do I enter this info? I tried pasting it into zMUD's command line but it didn't work.
Reply with quote
doomfyre
Apprentice


Joined: 03 Jan 2002
Posts: 152
Location: USA

PostPosted: Mon Mar 24, 2003 10:58 pm   
 
You have to type loot to activate this. It doesn't work automatically.
Reply with quote
Feanor
Novice


Joined: 12 Mar 2003
Posts: 37

PostPosted: Tue Mar 25, 2003 4:47 pm   
 
I understand that, I can't get it to work at all, so I don't understand where to enter all the trigger setup info.

I have used zMUD since 3.x and registered 4.x. However it has been since about 4.x since I have used it regularly and there have been numerous changes in changing the class of a trigger and many other things I used to take for granted.

Lightbulb, I don't understand what the
#CLASS 0
does. I have seen that there is a place in the Class dialogs to enter, what? Scripts? And on that tab is #Class 0......
signed,

Clueless
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Mar 25, 2003 5:36 pm   
 
It's written to be pasted into zMUD's command line. It's just a slight modification to Vijilante's script so that it will get all three items.

#CLASS 0 returns the default class to the None class. It terminates the earlier #CLASS LootGrabber which made LootGrabber the default class.

quote:
The #CLASS command can also be used to set the "default class". The default class is used whenever a setting is defined without specifying a class name. Normally the default class is <None>. To set the default class, use #CLASS with a single argument, which is the name of the class you want to set as the default. To return to the <None> default, use a classname of "0" (zero).


LightBulb
Advanced Member
Reply with quote
Feanor
Novice


Joined: 12 Mar 2003
Posts: 37

PostPosted: Thu Mar 27, 2003 6:08 am   
 
That did it! Thanks LightBulb! No doubt I'll have more questions later. :)
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