autohunt toggle

Posted by Demptus on Fri 28 Mar 2003 09:58 AM — 5 posts, 16,800 views.

#0
Hi folks,
I'm new to VBscripting so I'm liable to need a lot of help. I've been working on trying to make a toggle for my autohunt. Right now I have the standard 6 autohunt trig's in the triggers panel. I'm looking at typing a command that will disable all autohunt triggers and once disabled and once they're disabled, I'd like to type another command to reenable them. Any suggestions?
Clueless
Australia Forum Administrator #1
Edit each trigger and change their "group" to "autohunt".

Then make aliases to enable/disable the group, eg.


<aliases>
  <alias
   script="DisableAutoHunt"
   match="dah"
   enabled="y"
  >
  </alias>
  <alias
   script="EnableAutoHunt"
   match="eah"
   enabled="y"
  >
  </alias>
</aliases>


The relevant scripts would be:


sub EnableAutoHunt (name, line, wildcards)
dim count
  count = world.EnableTriggerGroup ("autohunt", 1)
  world.note count & " triggers enabled."
end sub

sub DisableAutoHunt (name, line, wildcards)
dim count
  count = world.EnableTriggerGroup ("autohunt", 0)
  world.note count & " triggers disabled."
end sub


I have put a "note" in there so you can see how many triggers were enabled/disabled, but you could take that out. The simpler code would be:


sub EnableAutoHunt (name, line, wildcards)
  world.EnableTriggerGroup "autohunt", 1
  world.note "Autohunt enabled."
end sub

sub DisableAutoHunt (name, line, wildcards)
  world.EnableTriggerGroup "autohunt", 0
  world.note "Autohunt disabled."
end sub

#2
Ok, things are starting to come together a bit but a quick question, you mentioned that I need to group my triggers, how do I do that?
Total Newb
Australia Forum Administrator #3
When you edit a trigger in the trigger editor, down near the bottom-left corner is a field called "group" - put the name of the group in that.
#4
Nick,
It works like a charm, thanks so much for your help.
Cheers,
Demptus