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


Joined: 27 Mar 2004
Posts: 27

PostPosted: Sun Jun 10, 2007 5:44 am   

how to build a stuff database and inter-access with zmud?
 
hello all, I am intereted more in using zmud programming than play the games:) Here I have an issue without any idea to work out. Could anyone show me a clue please?

The problem is that, I always see some good guys to help newbie in my Mud to find out where NPC and Stuff is. Instead of doing it by themselve, they have a system or program to help them deal with. Once anyone types "ask NPC/Stuff" in SOS channel, it automatically reply with answers.

To make the desription clear, if I don't know where sword is, the only thing I do is to type "SOS ask sword" to SOS channel, it will feedback with "Sword is in the centrel park" on SOS channel automatically and immediately. I guess they use "ask" to triggle the check system and "sword" is used as key figure to search.

How these guys achive this magic functions? Thanks in advance.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Jun 10, 2007 6:14 am   
 
There are a couple of ways. The simplest is with a bunch of #if statements:

#if (%1="sword") {SOS Sword can be found...}
#if (%1="haddock") {SOS Haddock can be found...}

and so on. You could use a database variable to make this much more simple, though:

#if (%iskey(%1,@Help)) {#exec %db(@Help,%1)} {SOS Sorry, I don't know where you can find %1}

And then you add items to the list by doing #addkey Help {item to add} {whatever you want it to do}.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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