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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
TiJay
Beginner


Joined: 15 Aug 2004
Posts: 13

PostPosted: Wed Mar 25, 2009 2:37 am   

yet another issue....
 
I'm trying to create a fletch program for my archer in my mud...Here's what i have so far:

Arrow Menu:
Code:

<menu subclass="ArrowSubMenu" priority="11930" id="1193">
  <caption>Arrow</caption>
</menu>

ArrowSubMenu:
Code:

<class name="ArrowSubMenu" submenu="true" id="818">
  <menu priority="11890" id="1189">
    <caption>Splinter</caption>
    <value>#var fletching 1;#var missile arrow;#var type splint;#var fletched 0;#PR tofletch "How many Splinter Arrows would you like to make?";fletch arrow splint</value>
  </menu>
  <menu priority="11900" id="1190">
    <caption>Piercing</caption>
    <value>#var fletching 1;#var missile arrow;#var type pierc;#var fletched 0;#PR tofletch "How many Piercing Arrows would you like to make?";fletch arrow pierc;</value>
  </menu>
</class>

The Bolt menu is the same, just uses bolts in stead of arrows...

Then off to the bread and butter of the script...the triggers:
Code:

<class name="Fletch" id="1177">
  <trigger priority="11780" id="1178">
    <pattern>You discard your empty toolkit.</pattern>
    <value>#var fletchkit 0
#IF (@fletching = 1) {fletch @missile @type}
#var fletchkit 1</value>
  </trigger>
  <trigger priority="11830" id="1183">
    <pattern>Your efforts produced (%d) (*)</pattern>
    <value>#var fletched %eval(@fletched + %1)
#var fletchbuffer %eval(@fletchbuffer + 1)
#IF (@fletchbuffer > 20) {emote is *|BW|SICK|N|* of fletching!!;#var fletchbuffer 0;#IF (@fletched < @tofletch) {#IF (@fletchkit = 0) {get fletch carc;wear fletch;#var fletchkit 1;fletch @missile @type} {fletch @missile @type;#var fletchbuffer 0}} {#echo You have finished with @fletched @type @missile;#var fletching 0}} {#var fletchbuffer 0;#IF (@fletched < @tofletch) {#IF (@fletchkit = 0) {get fletch carc;wear fletch;#var fletchkit 1;fletch @missile @type} {fletch @missile @type}} {#echo You have finished with @fletched @type @missile;#var fletching 0}}</value>
  </trigger>
</class>


My reasons for some of the stuff I did...after about 30 fletches, the mud will kick me saying 'use a variety in commands' it's not spamming, cuz there is tons of lag there, but still, it won't let me...so I added the @fletchbuffer variable, I want it to throw in the emote and reset the counter, but for some reason, when I'm error checking this code, i would type #echo @fletchbuffer in the mud, and get 0...so I try to manually set the fletchbuffer to 10 and see if it adds 1 correctly...and it takes it back down to 0...

I've tried using:
#var fletchbuffer %eval(@fletchbuffer + 1)
-------------------------------------------------
#var stock 1
#var fletchbuffer %eval(@fletchbuffer + @stock)
-------------------------------------------------
#add fletchbuffer 1
-------------------------------------------------
fletchbuffer = @fletchbuffer + 1


NONE OF IT'S WORKING!! I origionally put that part of the code in the #IF statements, but when it didn't work, i moved it out to see if the problem was in the placement...no change...Thanks in advance for any help you can offer...I'm trying to learn this new fangled cmud scripting, but zmud taught me all kinds of backwards, so i'm playing catchup!
Reply with quote
calesta
Apprentice


Joined: 07 Dec 2008
Posts: 102
Location: New Hampshire, USA

PostPosted: Wed Mar 25, 2009 1:18 pm   
 
I believe the problem is that in your trigger 'Your efforts produced (%d) (*)', you set fletchbuffer to 0 in both the then and else clauses of your first if statement.
Code:
#IF (@fletchbuffer > 20) {...;#var fletchbuffer 0;...} {#var fletchbuffer 0;...}

If fletchbuffer is not greater than 20, you shouldn't be changing it's value at all in the else clause since you already incremented it's value at the start of the trigger.
Reply with quote
TiJay
Beginner


Joined: 15 Aug 2004
Posts: 13

PostPosted: Wed Mar 25, 2009 2:01 pm   
 
did i mention i'm dense? LOL thanks, that answered the question, and fixed the script...well...that part at least, after many a long...minutes going through the code, i found the reason for my other issues, and now it all works grand...thanks for the help, calesta!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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