name="FlTicker"
author="Mattamue"
id="4217787a996a35824e97226a"
language="VBscript"
purpose="Notify a player of an incoming tick."
date_written="2006-04-11 23:57:16"
requires="3.73"
version="1.0"
>
Get out your favorite text editor and open up the plugin file. You'll need to change some of the code for this plugin to work with your own personal promt. The promt will need to have the hour listed somewhere. If you don't know how to list the hour in your promt you're already in trouble. Ask on the forums and you should get friendly hugs and help.
enabled="y"
match="^\[(\d+)\/(\d+) (\d+)\/(\d+) (\d+)\/(\d+) (\d+) (\d+) (D|M) (\d+)\]"
name="TickTrigger"
regexp="y"
script="TickTimer"
sequence="100"
>
enabled="y"
match="Abandon hope, all ye who enter here..."
script="OnLoad"
sequence="100"
>
>
world.note "Twenty-five past."
' Dim globals - I don't know what dim is, I just know you have to dim things.
dim hour
dim hourly
' Called from the "Abandon hope, all ye who enter here..." trigger
' this script gives the hour variable a numeral when you connect - can't hurt to be safe
sub OnLoad (name, line, wildcards)
hour = 0
end sub
' this next subroutiene is called from the trigger that matches my promt:
'
' [715/715 752/752 412/412 3850 16623 D 22] which is, in regular terms:
' ^\[(\d+)\/(\d+) (\d+)\/(\d+) (\d+)\/(\d+) (\d+) (\d+) (D|M) (\d+)\]
'
' This is the trigger you'll have to change to get the thing to work with
' your promt.
sub TickTimer (name, line, wildcards)
' "hourly" is a variable that gets checked every time the mud spits out my
' promt. When I "GetTriggerWildcard" blah blah 10 - I'm telling the script
' to get the 10th variable which is the hour of the day I've put into my promt.
'
' If you put your own promt in you'll have to figure out its regular expression
' and what variable place it holds.
hourly = GetTriggerWildcard ("TickTrigger", "10")
' Here's the simple if statement that runs the ticker. Every time I hit enter
' the promt is spit out again. The script sees the promt and grabs the number
' for the hour and puts it into the "hourly" variable.
'
' If it's the same as the "hour" variable then nothing happens. If it's different
' that means that the hour changed and THAT means that a tick happened. The script
' puts the new number for the hour into the "hour" variable and starts watching
' for another change. Simple.
'
' It's a lot of variable checking, but Mush is fast enough to handle it.
if hour <> hourly then
hour = hourly
world.resetTimer "Ticker"
end if
end sub
script="OnHelp"
match="FlTicker:help"
enabled="y"
>
Sub OnHelp (sName, sLine, wildcards)
world.Note world.GetPluginInfo (world.GetPluginID, 3)
End Sub