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
ddro
Newbie


Joined: 23 Mar 2006
Posts: 4

PostPosted: Wed Apr 19, 2006 6:01 am   

Script Function Help
 
Alright, I found this script in the finished script section, and thought "Great! a way to keep track of how much money I've made, and have a rough idea of the xp I've gained!" However, I cannot get it to work at all. zMUD picks up nothing from the mud 's far as I can tell, wich is odd as I have other triggers that work fine. Any suggestions on how I can either modify this to make it work, or change my settings to fix it? Please and thanks!

Loto wrote:
#CLASS {Ratting}
#ALIAS rreset {brat=0;yrat=0;rat=0;orat=0;blrat=0;trat=0;money=0}
#VAR rat {0}
#VAR money {0}
#TRIGGER {You pick up the corpse of a black rat.} {#add money 35;#add blrat 1;#add trat 1}
#TRIGGER {You pick up the corpse of a baby rat.} {#add money 7;#add brat 1;#add trat 1}
#TRIGGER {You pick up the corpse of an old rat.} {#add money 28;#add orat 1;#add trat 1}
#TRIGGER {You pick up the corpse of a young rat.} {#add money 14;#add yrat 1;#add trat 1}
#TRIGGER {You pick up the corpse of a rat} {#add rat 1;#add money 21;#add trat 1}
#TRIGGER {then smiles at you and hands you} {rreset}
#TRIGGER {old rat} {#cw white,darkgray}
#TRIGGER {black rat} {#cw black,darkgoldenrod}
#TRIGGER {a rat} {#cw green,burlywood}
#TRIGGER {baby rat} {#cw rosybrown}
#TRIGGER {young rat} {#cw cyan,bold}
#TRIGGER {full-grown rat} {#cw green,burlywood}
#TRIGGER {Entrance to the Medina.} {sell rat to Hakhim}
#STAT {Baby Rats: @brat | Young Rats: @yrat | Rats: @rat | Old Rats: @orat | Black Rats: @blrat | Total: @trat = @{money}gp}
#CLASS 0

With the triggers (not part of the script):

#TRIGGER {You will now notice the movement of rats. Happy hunting!} {#T+ Ratting}
#TRIGGER {You will no longer take notice of the movement of rats.} {#T- Ratting}
Reply with quote
tomcat025
Wanderer


Joined: 30 Dec 2001
Posts: 66
Location: USA

PostPosted: Wed Apr 19, 2006 6:21 am   
 
A little bit more information would be useful. Things such as what mud you play, what version of Zmud you are using, as well as perhaps some sample output from your mud.
_________________
You can pick your nose. You can pick your friends... but you can't pick your friends nose.

~Arwin Hochhauser
Reply with quote
ddro
Newbie


Joined: 23 Mar 2006
Posts: 4

PostPosted: Wed Apr 19, 2006 6:44 pm   
 
Oops, sorry. I play Achaea, and use 7.21 (I plant to eventually use the ACP curing system on sourceforge).

Obviously, "You pick up the corpse of a (type) rat." is one of the mud outputs which I want the script to pick up, with the other being "You have slain (type) rat." There are five types of rat, being baby rat, young rat, rat, old rat, and black rat. The only part of this script wich seems to work is the on/off trigger,
Quote:
#TRIGGER {You will now notice the movement of rats. Happy hunting!} {#T+ Ratting}
#TRIGGER {You will no longer take notice of the movement of rats.} {#T- Ratting}


Other than that, there's no info I can think of to give. I just did a fresh install of zMUD, and am trying to get this working, but so far, no luck. Any help would be great! Thanks!
Reply with quote
edb6377
Magician


Joined: 29 Nov 2005
Posts: 482

PostPosted: Wed Apr 19, 2006 7:21 pm   
 
Sounds almost like your class isnt being enabled. Check the triggers the do #T+ ratting and #T- ratting. Make sure they are in fact triggering.

If they are copy the output from the mud directly and place it into the TEST area of the trigger it should match. See if it says pattern matches.

I would start there. WIthout actual displays of the mud output when you kill a rat its hard to go further
Reply with quote
ddro
Newbie


Joined: 23 Mar 2006
Posts: 4

PostPosted: Wed Apr 19, 2006 8:49 pm   
 
Thanks for the help and suggestions so far tomcat025 and edb6377. I've checked to see that the Class was enabled, and it was. The patterns also matched as well, but still I get nothing. I've fiddled with the Script a bit, and here's what I've come up with:

Code:
#CLASS {Mud Class|Ratting Counter}
#ALIAS rreset {
  @brat=0
  @yrat=0
  @rat=0
  @orat=0
  @blrat=0
  @trat=0
  @money=0
  }
#VAR rat {0}
#VAR money {0}
#VAR trat {0}
#VAR brat {0}
#VAR yrat {0}
#VAR orat {0}
#VAR blrat {0}
#TRIGGER {{You pick up the corpse of a black rat.|You have slain a black rat}} {
  #ADD @money 35
  #ADD @blrat 1
  #ADD @trat 1
  }
#TRIGGER {{You pick up the corpse of a baby rat.| You have slain a baby}} {
  #ADD @money 7
  #ADD @brat 1
  #ADD @trat 1
  }
#TRIGGER {{You pick up the corpse of an old rat.|You have slain an old}} {
  #ADD @money 28
  #ADD @orat 1
  #ADD @trat 1
  }
#TRIGGER {{You pick up the corpse of a young rat.|You have slain a young}} {
  #ADD @money 14
  #ADD @yrat 1
  #ADD @trat 1
  }
#TRIGGER {{You pick up the corpse of a rat.|You have slain a rat}} {
  #ADD @rat 1
  #ADD @money 21
  #ADD @trat 1
  }
#TRIGGER {then smiles at you and hands you} {rreset}
#TRIGGER {{old {rat|rats}|old;{rat|rats}}} {#CW white,darkgray}
#TRIGGER {{black {rat|rats}|black;{rat|rats}}} {#CW black,darkgoldenrod}
#TRIGGER {{{a|%n} {rat|rats}|a;{rat|rats}}} {#CW green,burlywood}
#TRIGGER {{baby {rat|rats}|baby;{rat|rats}}} {#CW rosybrown}
#TRIGGER {{young {rat|rats}|young;{rat|rats}}} {#CW cyan,bold}
#TRIGGER {{full-grown {rat|rats}|full-grown;{rat|rats}}} {#CW green,burlywood}

#STAT {Baby Rats: @brat | Young Rats: @yrat | Rats: @rat | Old Rats: @orat | Black Rats: @blrat | Total: @trat = @{money}gp}
#CLASS 0


Also, here is the _exact_ output from the mud:

Types of rat: baby rat, young rat, rat, old rat, black rat

Entering, exiting, and sitting in the room:
Quote:
(A|An) (type of rat) wanders back into its warren where you may not follow.

With a flick of its small whiskers, (a|an) (type of rat) dashes out of view.

(A|An) (type of rat) darts into the shadows and disappears.


With a squeak, (a|an) (type of rat) darts into the room, looking about wildly.

(A|An) (type of rat) noses its way cautiously out of the shadows.

(A|An) (type of rat) wanders into view, nosing about for food.

A grizzled old rat sits here, fearlessly.

A pitch-black rat is almost blended into the shadows.

A baby rat timidly moves in the shadows here.

A full-grown rat prowls near your feet.

A young rat cautiously noses about for food here.

There are (%n) (type of rats) here.


Full-grown, pitch-, and grizzled only show up when there is one type of that rat in the room, and never in any other setting (combat, death, aquiring the corpse, ect.)

Combat Output:
Quote:
You reach out and clench a fist before (a|an) (type of rat), who screams and doubles over in
agony as (his|her) skin suddenly bubbles with gangrenous growths.
Unable to maintain cohesion, (a|an) (type of rat)'s mutated and warped flesh sloughs off from
(his|her) bones as (he|she) collapses to the ground in a twisted heap.
You have slain (a|an) (type of rat), retrieving the corpse.


Picking up/Dropping a rat:
Quote:
You pick up the corpse of (a|an) (type of rat).

You drop the corpse of (a|an) (type of rat).

The corpse of (a|an) (type of rat) falls out of your inventory.



The script currently doesn't have any triggers for removing rats or gold from the #VAR count, however I had planned to add those after I got everything else working, so I included the corpseloss strings here too. Some of the descriptions can be on multiple lines like

Quote:
A grizzled old
rat sits here, fearlessly.


and if anyone know how I can take this into account, please let me know. If not, it's not a big deal. Other than that, I don't know what else to include. Please let me know whats wrong/what I need to fix. As you can see, I'm a total novice when it comes to scripting in zMUD.
Reply with quote
edb6377
Magician


Joined: 29 Nov 2005
Posts: 482

PostPosted: Mon Jun 12, 2006 2:35 pm   
 
Code:

#CLASS {Mud Class}
#TRIGGER {You will now notice the movement of rats. Happy hunting!} {
#T+ {Mud Class|Ratting Counter}
#ECHO Rat Tracking ON
}
#TRIGGER {You will no longer take notice of the movement of rats.} {
#T- {Mud Class|Ratting Counter}
#ECHO Rat Tracking OFF
}
#CLASS 0
#CLASS {Mud Class|Ratting Counter} {disable}
#ALIAS RRESET {#RESET {Mud Class|Ratting Counter}}
#VAR rat {0} {0}
#VAR money {0} {0}
#VAR trat {0} {0}
#VAR babyrat {0} {0}
#VAR youngrat {0} {0}
#VAR oldrat {0} {0}
#VAR blackrat {0} {0}
#TRIGGER {{You have slain a (*) rat.|You pick up the corpse of {a|an} (*) rat.} {
  #ADD @money 35
  #ADD @{%1}rat 1
  #ADD @trat 1
}
#TRIGGER {{You pick up the corpse of a rat.|You have slain a rat}} {
  #ADD @rat 1
  #ADD @money 21
  #ADD @trat 1
  }
#TRIGGER {then smiles at you and hands you} {rreset}
#TRIGGER {{old {rat|rats}|old;{rat|rats}}} {#CW white,darkgray}
#TRIGGER {{black {rat|rats}|black;{rat|rats}}} {#CW black,darkgoldenrod}
#TRIGGER {{{a|%n} {rat|rats}|a;{rat|rats}}} {#CW green,burlywood}
#TRIGGER {{baby {rat|rats}|baby;{rat|rats}}} {#CW rosybrown}
#TRIGGER {{young {rat|rats}|young;{rat|rats}}} {#CW cyan,bold}
#TRIGGER {{full-grown {rat|rats}|full-grown;{rat|rats}}} {#CW green,burlywood}
#STAT {Baby Rats: @babyrat | Young Rats: @youngrat | Rats: @rat | Old Rats: @oldrat | Black Rats: @blackrat | Total: @trat = @{money}gp}
#CLASS 0
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