View Full Version : Big Timer 1.31

03-05-2005, 05:06 PM
Version 1.31 is almost ready.

New features over 1.2:
Text to Clipboard ability in parser.
Advanced Timer triggers.
Scripts using the Python programming language.

Text to Clipboard reader.

This was designed for using a text-to-speech reader. A lot of them read off the clip board, so if cirtain text specified is matched, it's sent to the clip board. (i.e, looking for "Tells you, ") I used this primarily for when I'm having a little lie down and don't want to go see what it is when someone beeps me. This can not be used at the same time as Python scripts. (Python for some reason uses the clip board for parameter passing....)

Advanced Timer Triggers.
These are where the scripts are listed. There is a little bit more power in them then the old style where it ONLY matches text and plays a sound. You have the option of playing a sound on when two strings match, or when they don't. For example... you can set it to play a sound on "Tells you" , but not when "Tells you" is accompanied by "bank". But other things that will have bank will still be allowed. Unter the old system, it was all or nothing.

Sounds or scripts can be played at the beginning (When a timer is triggered) and/or at the end (When a timer expires) or both. Or neither. IT is possible to put in a timer just for another script to see if it's running. (To avoid getting overloaded).

Probably the best update this go 'round. The scripts allow a lot of flexibility and power to the timers.

For example, one of the scripts I run myself for tracking spawn times takes into account what zone I'm in and adjusts it's timer accordingly. I wrote it quickly, so this example code is a bit odd to look at.

There are three scripts to make this part work. The first is set for when I zone , by the text "You have entered" , but NOT "PvP".
gettrigger() is the method that gets the text that caused the event (The setting in pre-scripts, the actual trigger in post-scripts).
Then it retrieves it's known spawn timer, if any, and uses that. If not, it keeps it's current setting.

Sent = Methods.gettrigger();
Seek = "you have entered ";
Index = int(Sent.find(Seek));
if Index != -1:
Zone = Sent[Index + len(Seek):len(Sent)];
SpawnTime = Methods.fetchvarint("SpawnTime" + Zone);
if SpawnTime > 0:
Methods.setvar("CurrentZone","Error:" + Sent);

When the string "You gain party experience!" is found, it plays this script:

Time = Methods.fetchvarint("SpawnTime");
if Time >= 1:

"Spawntime" is the name, 0 is the minutes (I chose to use only seconds in this script), Time is Seconds, and the last param is the sound file to play when the timer expires.

It is a big help to change the times set for the current zone, so that's where this last example is handy:

Sent = Methods.gettrigger();
Seek = "set zone timer";
Index = int(Sent.find(Seek));
if Index != -1:
Times = Sent[Index + len(Seek):len(Sent)];
Zone = Methods.fetchvar("CurrentZone");
Methods.setvar("SpawnTime" + Zone,str(Times));
SpawnTime = Methods.fetchvarint("SpawnTime" + Zone);
if SpawnTime > 0:
Methods.setvar("CurrentTime","Error:" + Sent);

In game, I would say or tell "set zone timer 600" for 10 minute timer. There's another script so it understands minutes and seconds, but it's a bit more lengthy. :) hehe.