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
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Fri Dec 23, 2011 8:31 pm   

Two questions, 1 Alias
 
Code:
<alias name="psi" id="12040">
  <value>#if (%-1 = "") {#send psi %item( @ChatDefault, %random( 1, 8))} {#send psi %-1}</value>
</alias>


First question. How can I expand @ChatDefault without having to tell this alias that I've added something to it? (The 1,8.. can't I use 1,.. and have it automatically use however many items are listed?)

Secondly, I like to type :) or :( etc on the chatlines.. If I pass these, it breaks the alias and results in an error. How can I get it to ignore my entire arg and pass it all?

Thanks.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Fri Dec 23, 2011 8:53 pm   
 
Try this:
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <trigger type="Command Input" priority="34160" regex="true" copy="yes">
    <pattern>^psi(?: (.+))?$</pattern>
    <value>#if (%1 = "") {#sub {psi %item( @ChatDefault, %random( 1, %numitems( @ChatDefault)))}} {#sub {psi %1}}</value>
  </trigger>
</cmud>
Reply with quote
Loftaris
Adept


Joined: 24 Aug 2004
Posts: 277

PostPosted: Fri Dec 23, 2011 9:02 pm   
 
Okay, that sorta works, but I just realized a problem..

Every time I use the command, an item disappears from my list.. I want to keep the list permanently?

What am I doing wrong?

(It did it in both yours and my alias..)
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Fri Dec 23, 2011 9:15 pm   
 
There must be some other code doing that, this wouldn't.
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