#wait funtion in Mudlet

Post Reply
Sivan
Posts: 49
Joined: Tue Jun 23, 2009 3:54 am

#wait funtion in Mudlet

Post by Sivan »

On zmud I have an alias that checks for dead objects. These are objects which are in an old zone. The zone has since been removed and once all the objects are no longer on players, I can remove them from the game. I would like to know how to make something similar for Mudlet. I am not sure if an alias in Mudlet is the right way of going about it. As Mudlet has "Pattern" and "Substitution" for use in the alias and I am not sure what to put in those fields. Below is part of the alias, it has more in it, but this will give you an idea of what it's doing.

Name: deaditems
#echo last checked on March 26th, 2009.
ostat 601
#wait 500
ostat 602
#wait 500

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

#wait function

Post by Heiko »

The Mudlet sleeping function would be tempTimer(). For example tempTimer( 0.5, "check123()" )
installs a timer that calls the Lua function check123() after 0.5 seconds.
some more examples:
tempTimer( 2.3, [[send("kill troll")]] ) would send "kill troll" to the MUD after 2.3 seconds
tempTimer( 0.1, [[send("ostat ]] .. myIDforOstat .. [[")]] )

Sivan
Posts: 49
Joined: Tue Jun 23, 2009 3:54 am

Re: #wait funtion in Mudlet

Post by Sivan »

How would I use your example to make an alias that checks the items I want to look at?

Ostat is a command on the mud I help admin that shows the properties of a piece of equipment. I don't program or know lua so I really need detailed help to get this to work.

Thanks!

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: #wait funtion in Mudlet

Post by Heiko »

This alias would check ostat 601+602 whenever you type check
pattern:^check

Code: Select all

tempTimer(0.5, [[send("ostat 601")]] )
tempTimer(0.5, [[send("ostat 602")]] )
If you'd like to add the object ID as a parameter to the alias e.g. check 876 would do ostat 876:
pattern:^check (\d+)
script:

Code: Select all

myIDforOstat = matches[2]
send("ostat " .. myIDforOstat )

Sivan
Posts: 49
Joined: Tue Jun 23, 2009 3:54 am

Re: #wait funtion in Mudlet

Post by Sivan »

Hm, I copied the example and now the alias will save. But how do I run it?

It looks as though an alias in Mudlet behaves different than how Zmud does it. In Zmud an alias is just a substitution for many commands or to make a command shorter so you do not have to type it all out.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: #wait funtion in Mudlet

Post by Heiko »

I can post a ready made example you can import on a click if you tell me exactly what you want to do ;)
You can also make a button that sends ostat 601; ostat 602 to the MUD, but you need to tell me *exactly* what you want.

Sivan
Posts: 49
Joined: Tue Jun 23, 2009 3:54 am

Re: #wait funtion in Mudlet

Post by Sivan »

I guess I first need to know how Aliases work. It does not sound like it's a substitution mechanism like it is in Zmud. Which is no big deal, I just don't know how it differs.

What I want to do is make a command called "limitiedstocheck". The name really does not matter. And then by inputting that command into the command line of Mudlet, run the example you provided.

Another example is below:
This is also useful when playing a mortal on the mud. We have spells like the following.
"c 'detect invis'. To run that command in zmud I would make an alias and then just input "invis" and then it runs "c 'detect invis'" for me.

Thanks for the help, it's appreciated.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: #wait funtion in Mudlet

Post by Heiko »

I'll post a ready-to-import alias later tonight. Until then have a look at the manual. Mudlet alias allow you to do anything you can think of really. You'll find the manual if you click on the manual button.
Here is a direct link to the alias documentation: http://mudlet.git.sourceforge.net/git/g ... HEAD#alias

Sivan
Posts: 49
Joined: Tue Jun 23, 2009 3:54 am

Re: #wait funtion in Mudlet

Post by Sivan »

I got it to work. I was not entering a pattern before. I just tried it with the pattern being the same name as the alias and now it works.

Thanks

Post Reply