Ok, well, I've used MUSHclient for a while, but I've never bothered to get into the scripts, 'cause I don't know much about code... Anyways, here's my problem.
Is there anyway that I could make a script/trigger for the following:
Every 30 seconds, its to gtell "Tick in 5 seconds."
But, to avoid complications due to lag and whatnot, I also what it to reset the timer on every:
(Advice: These show ticks, every 35 seconds. )
So it would go something like this:
You tell the group 'Tick in 5 seconds.'
--5 seconds--
(Advice: Mud Advice here )
--Timer reset--
--30 seconds--
You tell the group 'Tick in 5 seconds.'
--etc...--
<timers>
<timer enabled="y" name="TickWarn" second="30" >
<send>grouptell Tick in 5 seconds</send>
</timer>
</timers>
<triggers>
<trigger
enabled="y"
match="(Advice: These show ticks, every 35 seconds. )"
name="ResetTicks"
script="ResetIt"
sequence="100"
>
</trigger>
</triggers>
sub ResetIt (name, output, wilds)
world.resettimer "TickWarn"
end sub
Note however that using a timer set to 35 seconds to call ResetIt instead of using the advice bit to syncronize (except for the first time) would work better, since the client won't be what lags. ;)
The part with the <timers> and <triggers> can both be copied directly into the respective editors for them. They are in the same format that mushclient used for cutting and pasting to and from those editors. ;)
The sub has to go into a script file. Basically just use something like notepad, copy the sub part into there and save it into c:\program files\mushclient\scripts as something like "MyScript.vbs". The "" are important if using MS notepad here instead of mushclient's, since MS notepad will try to save it as MyScript.vbs.txt if you don't force it to use the name you want with quotes. One you have that file saved you go into the mushclient settings for scripting, enable scripting, set the script name to the file you created and set the script type to VBScript. There is also a setting for 'Recompile when script changes:' that is useful to set to 'Always' in order to make later editing easier, otherwise changes made to the script would require you to manually reload the script each time using the 'reload script' button.
You can ignore most everything else here. Most are special named subs that perform tasks, 'if' you add them, depending on certain events like actually connecting to the mud. One setting though to consider is 'Choose Editor'. Normally scripts are edited in mushclients notepad, but if you ever make a large script (over 32k) it won't edit properly. I use one called WScite (don't remember the link right now, but google can find it) instead, which is free. There are some other decent ones around that make editing easier, though as with everything the ones that cost money are better.
Now... I hate to be such a newbie, but if you don't mind, could you help me with one other thing? :>
Here's the string it would show first off:
You can momentarily see in all directions..
And then after that, it shows a list of names of everyone in the area you are currently in. For example:
Anfarel......................Stomping Ground Training
Norris.......................Center Square of Kael
Vasp.........................West Kael Road
Gomli........................Center Square of Kael
Nalad........................Stomping Ground Training
Now, heres the main part of it. I want to set a trigger so whenever I see an enemy, who would show up as:
*Duke Name*..................Stomping Ground Training
Now, I want it to report that in gtell, but, I have problems with 1) variables, which can be disabled by /*, but again, as it shows on a new line, it also has problems with things like:
*Duke Name*'s slash misses you. [0]
and:
*Duke Name* is here.
*Duke Name* is sleeping here.
And many other positions that would make *Duke Name* show up on a new line.
So, if anyone could help me out a little with this one too, that'd be awesome :>
PS: The .....'s in the lines of where people are are spaces. When I posted this, it took out all the excess spaces... so yea.
Ok. For his you need to use regular expressions for one thing. Second, I assume that the ...... is actually in the line? So you would need a 'regular expression' like:
^\*(.*)\*\s{3,}(.*)
This would ^ - match at start of line, followed by any string, followed by 3 or more spaces (the number before the comma is the minimum, the second being the maximum, which is left blank for 'infinite'), then followed by more text. It should only match on those lines.
You would then just place 'gtell %0' in the send field, since %0 will be 'everything that matched', not just the wildcards. ;) However, since the name and the location are both in (), those can be used as wildcard %1 and %2 if you decide to do something different with the send text or use them in a sub.