Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Suggestions ➜ Interaction, Random timers, some other things.

Interaction, Random timers, some other things.

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Oberon   (4 posts)  Bio
Date Mon 03 Sep 2001 10:26 PM (UTC)
Message
Interaction- what I mean by this is that it would be nice if a timer could execute an alias, if a trigger could turn a timer/another trigger/etc on or off, and so on and so forth. (Maybe this has allready been implemented, I'm not sure. It's not in the help file I have, if it has.)

Random timers- it'd be nice if you could make a timer fire randomly, within a specified interval. For example, if you wanted to return the command "look" sometime between every 10 and 30 seconds, as opposed to exactly every 15 seconds.

Databases- if you had auto-updateable databases, that'd be nice too. It could work like this-
First, you'd have to define the database. This would be a typical database, with tables and fields and relations.

Second, you'd define a template that the data would be taken from. Let's say a whois from a MUD looks like this:
Joe
Race: human Sex: male Age: 22 Level: 5
Rp: 0 Kills: 898 Deaths: 7
Email:
Url:

You would define a template that looks like this:

*
Race: * Sex: * Age: * Level: *
Rp: * Kills: * Deaths: *
Email: *
Url: *

Or, for more control:

<name>
Race: <race> Sex: <male|female> Age: <age> Level: <level>

And so on. Then, when the client receives text that fits your template, it automatically updates your database accordingly. This way, you can keep a database of friends/players to keep an eye on, items, mobs, etc.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 04 Sep 2001 04:59 AM (UTC)
Message
Most of that is possible right now.

Take a look at this web page:


http://www.gammon.com.au/mushclient/functions.htm


A trigger, timer or alias can enable or disable triggers, timers or aliases using script functions such as:


  • EnableTrigger
  • EnableTimer
  • EnableAlias


You could make a timer fire randomly by making a "one-shot" timer that, when it fired, added another one using a random time interval (using a random function in the script).

As for databases with fields, relations and so on, there was a recent post about interacting with an ODBC database using JScript. You could also do that with the other scripting languages.

For instance, you could use MySQL database (which is free, and there is a version for Windows) as your database engine, MyODBC as its ODBC interface, and then add tables, data etc. using script calls.

Then with appropriate triggers you could do a MODIFY or INSERT on the database data to keep the data up-to-date.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


14,244 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.