I think the problem atm is that the manual is fairly technical for people with no prio programming/scripting experince and as such makes it hard for them to use mudlet atm, but im sure with time a more "newbie" friendly version will come out.
Regarding your attempt to make another trigger seems like a great idea to build on previous experience
building on the previous trigger using the rabbit as an example i would guess (and it is only a guess since i am abit of a newbie myself at this) that it would look something like this:
The small rabbit arrives. <--- the line the mud sends when the rabbit arrives into the room your in.
^(.+) arrives.\$ <--- this seems right to me since its the same as "^
(.+) leaves (\w+).\$" but without the second match and "leaves" changed with "arrives".
Code: Select all
if matches[2] then
echo("examine it")
end
now this is the code piece that is abit wierd if you ask me, because what you are doing here is saying:
If "something" then i shall echo examine it to the screen. now im asking myself: if "something"? why would i have this in the trigger? (now i think know why but i will come to that in abit)
what you need is fairly simply, since you want to echo"examine it" everytimes something arrives, you simply have a trigger with the code:
insted of
Code: Select all
if matches[2] then
echo("examine it")
end
now to the reason i think you are using if....
In the other trigger the people helping have being using a variable called "target" that was what the :find(target) was for. Im also guessing that you dont have the alias mention earlier and therefor it cannot find the "target".
the problem with your first trigger now is:
Code: Select all
A room [exits: north, south, east, west]
tiny spider
small rabbit
hp: over9000!>
Lets say you wanna follow the rabbit, but the spider moves first sending the line:
tiny spider leaves south.
Your trigger would fire off and you will follow the spider insted of the rabbit.
thats no good. So what can we do to make sure you follow the one that you want too. Here is it the alias comes into play.
You type: af rabbit
now the alias tells mudlet to put the rabbit into a variable called target.
now when the spider leaves the trigger fires off
but this time you have the :find(target) in your trigger and you have set the target to rabbit, so it looks for who left? tiny spider, is that the same name as the one in the variable "target"....no, ok then i will not follow it. And if the rabbit leaves then it will say, yes its the same name as the variable "target" so i will follow it.
so here is what you need for the triggers:
first you make an alias:
Code: Select all
pattern: ^af (\w+)$
script:
target = matches[2]
then you make the trigger:
Code: Select all
pattern: ^(.+) leaves (\w+).$
script:
if matches[2]:find(target) then
send(matches[3])
end
now each time you wanna follow a specific monster or player you type: af nameofmonster (example: af rabbit), however if the rabbit is called: a tiny rabbit and the mud send the line: a tiny rabbit leaves south, then you wanna change things around abit, so insted of the (\w+) in the alias you put in (.+) this way you can put more than 1 word into the variable target.
for the second trigger:
Code: Select all
pattern: ^(.+) arrives.$
script:
echo("examine it")
or if your mud have a command to examine the monsters:
send("examine ".. matches[2])
that will send the command: examine whoeverarrives to the mud
i hope this make any sense, but also i hope this shows what is required in the "newbie" manual the details you need to show and how much you need to make stuff simple (not that i think what i just wrote is simple
)
Yugosan