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


Joined: 23 Dec 2018
Posts: 1
Location: Norway

PostPosted: Sun Dec 23, 2018 8:51 am   

Trigger help CMUD (Lensmoor)
 
Hi,

I'll be the first to admit I don't understand how to code..at all. That said, I was hoping to get some help from the forum on a trigger I am trying to set up:

1) I play a game called Lensmoor. Here the players can teach other players skills and spells. I was hoping to set up a trigger so that if they send me a tell where they say "teach skilltheywanttolearn" I will then exit the command to teach them.

So the tell I would receive would look like this:
Mugin tells you 'teach armor'

The command the game sends is "teach mugin armor"

I would like to set up a trigger where it operates with two random/variables, the player (Mugin) and the skill (armor). So regardless of what player that sends me a tell and regardless of the skill they want to learn, the trigger will. So something like "teach x (the player) Y (the skill)"

Did that make sense?



As a follow-up question, what coding language is CMUD and any good guides out there so I can learn how to set up triggers with variables and several unknowns etc?

Thanks in advance,
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Sun Dec 23, 2018 11:01 pm   
 
This is not hard to do at all, you want a #TRIGGER.
First, we need a pattern to fire off of, which you have provided
Next, we need to insert pattern matching characters for the bits we expect to change (more on those can be found in the link in '#HELP #TRIGGER'), and add the command:

#TRIGGER {(%w) tells you 'teach (*)'} {teach %1 %2}

That can be inserted on the command line where you input commands to the game.

CMUD actually uses a proprietary language, zScript, though triggers are converted to REGEX behind the scenes.
Also, most settings will have a language option box to choose from when making settings via the GUI, you can choose any programming language you have installed locally if you have a preference.
_________________
Discord: Shalimarwildcat
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