![](templates/Classic/images/spacer.gif) |
savanna Beginner
Joined: 27 Mar 2004 Posts: 27
|
Posted: 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. |
|
|
![](templates/Classic/images/spacer.gif) |
Fang Xianfu GURU
![](images/avatars/1763170544a2093e7e85da.gif)
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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}. |
|
|
![](templates/Classic/images/spacer.gif) |
|
|
|
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
|
|