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 ➜ VBscript ➜ autohunt toggle

autohunt toggle

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


Posted by Demptus   (5 posts)  Bio
Date Fri 28 Mar 2003 09:58 AM (UTC)
Message
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
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Fri 28 Mar 2003 09:41 PM (UTC)
Message
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


- Nick Gammon

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

Posted by Demptus   (5 posts)  Bio
Date Reply #2 on Sat 29 Mar 2003 12:30 AM (UTC)
Message
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
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #3 on Sat 29 Mar 2003 12:35 AM (UTC)
Message
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.

- Nick Gammon

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

Posted by Demptus   (5 posts)  Bio
Date Reply #4 on Sat 29 Mar 2003 12:27 PM (UTC)
Message
Nick,
It works like a charm, thanks so much for your help.
Cheers,
Demptus
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.


16,479 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.