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
darmir
Sorcerer


Joined: 10 Oct 2000
Posts: 706
Location: USA

PostPosted: Fri Oct 01, 2010 5:51 pm   

Script Help
 
I have a package that is used to keep track of your friends. The mud just shows their description so I have a database variable that is created to store their name with their description.
Now I also have a window that displays the description and name when the mud see the description. My only issue is I don't want the trigger to show the information everytime it see it from the text, just when you do a look in the room description or when someone new arrives in the room and you know them. Any ideas how to fix this.
Here is my code:
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<module name="Character Short Description" global="true">
  <uid>{EE7BE685-DB0C-4F06-B6AF-A513B3C7D969}</uid>
  <menu priority="20">
    <caption>Add Character</caption>
    <value>#local $Name $desc
$desc = %selected
$Name = %prompt("","Enter the name of the character")
#addkey friends  $desc $Name
</value>
  </menu>
  <class name="Friends">
    <trigger priority="190">
      <pattern>({@friends})</pattern>
      <value><![CDATA[#local $temp1
$temp1 = %1
//#PRINT {temp value: $temp1}
//#clr Friends
#window Friends {<color red>$temp1 -</color> <color cyan>%db(@friends, $temp1)</color>}
// #CAPTURE "Friends"
]]></value>
    </trigger>
    <var name="friends" type="Record">
      <value>A honey-haired, blue-eyed woman=Cami|A tall man with blue eyes=Andri</value>
      <json>{"A tall man with blue eyes":"Andri","A honey-haired, blue-eyed woman":"Cami"}</json>
    </var>
  </class>
</module>
</cmud>
_________________
Run as hard as a wild beast if you will, but you won't get any reward greater than that destined for you.
Source: (Egyptian)
Reply with quote
complex
Apprentice


Joined: 12 Apr 2004
Posts: 134
Location: USA

PostPosted: Fri Oct 01, 2010 8:13 pm   
 
The first thing that comes to mind is toggling the script on and off. It would be simple for the looking in the room portion. Just name your trigger something in the ID field. The ID field ca be found by opening the package editor, clicking on the trigger @friends, at the bottom of the right pan you you can see the word more, if you click on it you can enter the ID of the trigger.

Lets say you named it trFriends
Code:

<alias name="look" id="93">
  <value>#t+ trFriends //turn on trigger trFriends
~look         //send the command look to the mud exactly one time
#t- trFriends //turn off the trigger trFriends</value>
</alias>


Now the trigger on the other hand is a little more complicated. Is there any indication from the mud that someone has entered the room prior to the string that you are matching with @friends? By that I mean if someone enters the room does it simply say

Code:
A honey-haired, blue-eyed woman has entered the room


or something else?
_________________
<Clever text here>
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