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
meyn
Beginner


Joined: 06 Mar 2008
Posts: 27

PostPosted: Fri Apr 18, 2008 6:08 pm   

can i send a command to zmud?
 
The following script prompts for a enemy trigger + enemy kill name, it correctly formats for what i want but only shows text on screen doesnt set up the class in zmud like i hoped.

Is there a command to make the output of @setupnewtrig as if i typed it straight into command line,

I've tried #ECHO, #SAY, #SHOW and #SEND and i've tried just @setupnewtrig but none of them set up the trigger

Code:
#CLASS {AddEnemys}
#ALIAS addenemy {
  #PR newtrig "Enter the enemy trigger"
  #PR newenemy "Enter the enemy kill name"
  setupnewtrig=%concat( "#CLA {enemys}; #TR {", @newtrig, "} {#VAR tgt ", @newenemy, "}; #CLA 0")
  #SEND @setupnewtrig
  }
#CLASS 0


if i type "a* rat* standing here" at first prompt
and "rat" at second prompt

the output is:

#CLA {enemys}; #TR {a* rat* standing here} {#VAR tgt rat}; #CLA 0


Thank in advance for any help given
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri Apr 18, 2008 7:04 pm   
 
Change your code to this:
Code:
#ALIAS addenemy {#PR newtrig "Enter the enemy trigger";#PR newenemy "Enter the enemy kill name";#CLA {enemys};#EXEC {%concat( "#TRIGGER {", @newtrig, "} {#VAR tgt {", @newenemy, "}}")};#CLA 0}


This will work out better for you.

Charneus
Reply with quote
meyn
Beginner


Joined: 06 Mar 2008
Posts: 27

PostPosted: Fri Apr 18, 2008 7:30 pm   
 
Thanks it works perfectly,

Is there any reason for writing the class opening and closing outside the statement:

#CLA {enemys}
#EXEC {%concat( "#TRIGGER {", @newtrig, "} {#VAR tgt {", @newenemy, "}}")}
#CLA 0

Instead of inside:

#EXEC {%concat( "#CLA {enemys}; #TRIGGER {", @newtrig, "} {#VAR tgt {", @newenemy, "}}; #CLA 0")}

Its works both ways so i was wondering if it makes a differance.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri Apr 18, 2008 7:37 pm   
 
Cleaner code. I don't like things to be too messy. ;) Plus, it's not necessary to have it inside the statement. Just adds a headache.

Charneus
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