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 ➜ General ➜ Triggers/Aliases

Triggers/Aliases

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


Posted by Penguin   (46 posts)  Bio
Date Tue 21 May 2002 02:17 AM (UTC)
Message
Is there a way to be able to group some triggers/aliases(normally not enabled) together and only enable them when you want to by entering like a single command or something?
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 21 May 2002 04:48 AM (UTC)
Message
There is no built-in method right now.

However what you could do is name each one (with a label), all starting with the same word (eg. group1_xxx) and then make a small script that calls world.gettriggerlist, checks the first (say) 6 characters of the label, and enables and disables them as required.

- Nick Gammon

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

Posted by Penguin   (46 posts)  Bio
Date Reply #2 on Tue 21 May 2002 02:00 PM (UTC)
Message
Sorry about this, but I am lost when it comes to scripts.. if it doesn't take too much time, could you write it out?
I tried writing my own script but got errors all over the place. Thanks.
Top

Posted by Penguin   (46 posts)  Bio
Date Reply #3 on Thu 23 May 2002 09:31 AM (UTC)
Message
I've managed to write my own script.. goes something like this...

Sub FB_mode (AliasName, TriggerLine, arrWildcards)
dim trList

trList = World.GetTriggerList

If Not IsEmpty (trList) then

For Each t In trList
world.Note t
Next

World.EnableTrigger "FB_conc", 1
World.EnableTrigger "FB_fireball", 1

End If
End Sub

Sub FB_mode_off (AliasName, TriggerLine, arrWildcards)
World.EnableTrigger "FB_conc", 0
World.EnableTrigger "FB_fireball", 0
End Sub

It works ok now, but how do I load those 2 specific triggers only? Like.. what do I add to the world.gettriggerlist in order to activate those 2?
Top

Posted by Penguin   (46 posts)  Bio
Date Reply #4 on Thu 23 May 2002 10:06 AM (UTC)
Message
Oh nevermind, I seem to have got it... the gettriggerlist part seems a bit redundant so I got rid of it.. Thanks anyway
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #5 on Thu 23 May 2002 09:35 PM (UTC)

Amended on Thu 23 May 2002 09:36 PM (UTC) by Nick Gammon

Message
What I had in mind was something like this:


Sub FB_mode (AliasName, TriggerLine, arrWildcards) 
dim trList 

trList = World.GetTriggerList 

If Not IsEmpty (trList) then 

  For Each t In trList 
 
    if left (t, 3) = "FB_"
       World.EnableTrigge t, 1
    end if

  Next 
End If 

End Sub


Then you can add as many triggers as you like, and provided they start with "FB_" it will enable them. The disable code is the same, except the "1" becomes "0".

- 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.


19,519 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.