Jump to content

How to disable a single trigger or trigger group in MUSH.


kaboomer

Recommended Posts

*Before we start, I'd like to ask all to please not give me the "don't use triggers line." I haven't used them much in the past, but I'd like to try them to see if it improves my PK performance.*

I just got a new PC, so I decided to try a new client. MUSH seems to have a lot of nice features, but it requires knowledge of code to make them work. I have 0 knowledge on coding.

Setting up a trigger is easy enough. Copy and past the text into the trigger set up and create a reaction. Done.

Now I'd like to be able to give that trigger a group name and be able to disable that particular group easily. MUSH does allow you to group triggers very easily.

For example, let's say I have triggers set up to 'murder bob' for these lines:

- Bob is here

- Bob rides in

They would be under a trigger group called 'Bob.'

I would like to be able to quickly disable this trigger group without having to open a separate window.

The MUSH forum offers various scripts for this exact purpose: http://www.gammon.com.au/scripts/function.php?name=EnableTriggerGroup

But I really don't know how to implement this at all. I've been messing around with this for about two hours, and I'm still at square one.

Can anyone help?

Link to comment
Share on other sites

If possible, make it so that the script checks what value a variable has. If it is 1, then continue with the action, else just drop.

With tintin++ I'd do it somewhat like this:

#var {assault} {0}
#var {target} {}
#var {attack} {murder}
#action {$target is here|$target {walks|rides|crawls} in.}
{
#if {$assault}
{
$attack $target
}
}

That should give you the idea, regardless do MUSH and TT share method/syntax.

Then you can have an alias to toggle it:

#alias {.aa}
{
#if {$assault} {#var assault 0};
#else {#var assault 1}
}

Extremely easy way to get yourself killed, if you can't toggle the trigger off in less than second.

[EDIT] Maybe I should read the original post more closely before posting, eh?

Link to comment
Share on other sites

you should really go to Mush's fun with triggers site to really get a hold of it but you can do something like this.

trigger: @chase walks in

send: murder @chase or send: murder @target

ignore case/regular expression/expand variables - all enabled

send to world

this works off a variable you created simply called chase

create an alias to quickly change and disable @chase and/or @target

alias: bb

send: whoever you know you will be chasing

ignore case/expand variable enabled

send to: Variables

Variable: chase

next option

alias: bb *

send: %1

ignore case/expand variable enabled

send to: Variables

Variable: chase

now you only need to type bb then their name to set your chase trigger to the person. It's also best to set a seperate one for target and to set your trigger to attack target instead of chase. That way you can set a fail safe alias to change your chase to some nonsense like cookies to quickly turn it off but still have target set to the person your fighting. Also triggers with Mush are pretty useless I think when chasing for the most part and only really come into their own to catch someone moving past you. Reason being if you have any other commands going through first you'll miss them moving by or standing there as you race past them.

As a side note, I don't think you really need ignore case/expand variables set for your targetting aliases but I'd check them anyways.

Link to comment
Share on other sites

Bob is here also requires something a little different.

you would need to do something like

@chase .+ is here

since bob probably has a title like Bob the Big Boy Bad ***, the .+ will allow the trigger to skip over from Bob to the, is here.

Link to comment
Share on other sites

I slew someone, who was using a trigger like that with my halfling.

I ran in, he used his triggered command, I fled and returned, and he just kept doing it till he died.

on that note however..

in wintin you just need to create a variable...lets call it STRIKER, set striker to 0 or 1. Use STON to turn it on, STOFF to turn it off..

#alias {stoff} {#var striker 0} //trigger is off

#alias {ston} {#var striker 1} //trigger is on

#alias {set %1} {#var target %1;#panel 1 %1} //this will display who your current target is in the bottom panels, and set the $target variable.

...like so, then you use these lines to check striker and execute...

#action {$target walks in} {#if {$striker=1}{murder $target};}

#action {$target rides in} {#if {$striker=1}{murder $target};}

#action {$target flies in} {#if {$striker=1}{murder $target};}

obviously, this if statement makes it so if striker i set to anything but 1, the trigger will not go off. This allows you to easily toggle the striker, you can enable/disable this even if lagged by in game commands as tintin will handle the variables internally.

Additional functinality can be added to set a type of attack, and giv eyou more versatility.

#alias {atk %1} {#var atktype %1;#panel 2 %1} //this creates a variable for the type of attack...

now your final lines would be something like..

#action {$target walks in} {#if {$striker=1}{$atktype $target};}

#action {$target rides in} {#if {$striker=1}{$atktype $target};}

#action {$target flies in} {#if {$striker=1}{$atktype $target};}

letting you set the type of attack so you would enter into the client..

set //establish the target (displays target in bottom panel)

atk //this can be a mud alias here, (displays queued attack in bottom panel next to target name)

ston //this turns on the trigger.

stoff //when the fight gets rough this shuts it off.

..and you're set. Keep in mind this will sorly ruin your pk skills if you use it for a long time. Anyone who is sneaking will just pwn you if you rely on such triggers,good luck!

Link to comment
Share on other sites

Sorry, even with zmud and all the scripting and variables available, there is no way to make it flexible enough to handle all situations, so you just learn to gimp yourself... Targeting macros and highlighting triggers for the win!!! Well, that is, if I could actually win at a PK... :-p

Link to comment
Share on other sites

@Kyzarius - In my post I said, That way you can set a fail safe alias to change your chase"a variable" to some nonsense like cookies to quickly turn it off but still have target"a seperate variable" set to the person your fighting.

So unless your halfling's name was Cookies there's really no difference except yours turns it off and mine sets the variable to something irrelvant with an alias similar to, STOFF.

Link to comment
Share on other sites

@Kyzarius - In my post I said, That way you can set a fail safe alias to change your chase"a variable" to some nonsense like cookies to quickly turn it off but still have target"a seperate variable" set to the person your fighting.

So unless your halfling's name was Cookies there's really no difference except yours turns it off and mine sets the variable to something irrelvant with an alias similar to, STOFF.

yeah but thats half-assed. For example, you cant turn off the striker but Keep the target identified for highlights and alias targeting if you do that.

Just throwing jibberish into your target variable to stop your triggers works, but you sacrifice every other advantage using a target variable could bring (highlights, targeted alias'). I geuss if you want to have TWO variables to store target names in, but why do that when a boolean will replace the second variable and you could make a toggle command so many different ways, very easily.

Link to comment
Share on other sites

I don't have MUSHclient on the PC i'm working on at the moment to check the exact syntax but this is pretty easy from what i remember when i wrote mine.

The LUA script command was TriggerEnable is i remember correctly - so you set an alias to write to script ie have alias of chaseoff

then in the output have it

EnableTrigger ("Whateveryourchasetriggeriscalled" , "False")

You can also do it with groups - again not sure of the exact syntax but its pretty similar.

Disclaimer - i haven't found time to play for months - and haven't written a script in ages so the syntax will be off - there are loads of good script examples for LUA at gammon forums.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...