Didnt know where else to ask, but its about triggers

Posted by Madrox on Tue 13 Dec 2005 04:44 PM — 3 posts, 15,109 views.

#0
Is there a way to make trigger groups? Say I have a set I use for one char, but dont want happening for a different char. Is it possible to group them, and disable them as a whole, rather than disableing each one by itself
Australia Forum Administrator #1
Sure, that is what groups are for.

In each trigger, alias or timer that only applies to one group, put a group name in the "Group" box. It would be the same for each one that is related. That name could be your character name, for example.

Then you can type:


/EnableGroup ("abc", true) -- enable group "abc"


or


/EnableGroup ("abc", false) -- disable group "abc"


However a nice thing to do then would be to automate the whole thing. You can write a small script and make it be run when you connect to your character. Here is an example in Lua:


function OnWorldConnect ()
  if GetInfo (3) == "Madrox" then
    EnableGroup ("abc", true)
    Note "Enabling group 'abc'"
  else
    EnableGroup ("abc", false)
  end -- if
end -- function


Then put "OnWorldConnect" into the "World Events -> Connect" in the scripting configuration screen. This enables or disables the group depending on the character name in the "Connecting" configuration screen.




However if you type the character name in manually then you might simply need to ask whether or not to enable the group. Here is one way of doing that:


function OnWorldConnect ()
  local result = utils.msgbox ("Enable triggers for 'Madrox'?",
                               "Use special triggers", "yesno", "?")
  if result == "yes" then
    EnableGroup ("abc", true)
  else
    EnableGroup ("abc", false)
  end -- if
end -- function


This will display a small Windows dialog box whenever you connect, and enable or disable the group according to your response. Again, you need to put OnWorldConnect into the "world connect" event.




Another approach is to detect what character you have logged onto by detecting the usual "welcome" message with a trigger, and do the enabling then.


<triggers>
  <trigger
   custom_colour="2"
   enabled="y"
   match="Welcome to Realms of Despair, *"
   send_to="12"
   sequence="100"
  >
  <send>
if "%1" == "Madrox" then
  EnableGroup ("abc", true)
  Note "Madrox triggers enabled."   
else
  EnableGroup ("abc", false)
  Note "Madrox triggers disabled."   
end -- if
</send>
  </trigger>
</triggers>


Of course, you need to customise this slightly to match your welcome message, if indeed you get one.




A different approach again is to have two different world files, one for each character.
#2
Wow, thanks a lot :) I never noticed the GROUP option before. This is a major help.