Trigger 0.05 for D2HackIt!

--------------------------------------------------------------------------------

This module automatically executes D2Hackit commands upon receiving or sending 
specific packets.  It supports multiple commands per trigger, as long as they 
are separated by a ; character.  Also, it supports a special command called 
"block" which will prevent the triggering packet from being sent/received.

Commands:
  .trigger set <r|s> <packet> [command1 [;command2] [;command3] ... ]
     Sets a trigger to execute [command] when <packet> is (r)eceived or (s)ent.  
	 Use keyword 'block' to prevent packet from being sent/received.

  .trigger clear
     Clears all active triggers.

  .trigger list
     Shows all active triggers.

  .trigger load [section]
     Loads a section of trigger definitions from [section] in trigger.ini.  If [section] is not specified, it defaults to "default".

  .trigger save [section]
     Saves a section of trigger definitions to [section] in trigger.ini.  If [section] is not specified, it defaults to "default".


Installation:
  Copy trigger.d2h and trigger.ini to your D2HackIt folder and use
  ".load trigger" to load the module.

Tips:

  Wildcards

  Trigger can use wildcard characters when specifying trigger packets. 

  For instance, if you'd like it to send packet 1906000000 whenever a 9d
  packet is received, use the following command:

    .trigger set r 9d** send 1906000000

  This would trigger the command upon receiving any packet that started 
  with 9d.

  If you'd like to specify only a certain section of the packet for a wildcard
  match then place wildcard characters in each space.  Using the example 
  above, let's say that we only wanted to match on 9d packets that had FF 
  in their fourth byte:

    .trigger set r 9d****FF** send 1906000000

  -----------------------------------------------------------------------------

  Buffers

  Trigger can store values from packets in 3 predefined buffers
  (XX, YY, and ZZ) and reference them later.  For example, let's say that 
  we wanted to automate clicking on Charsi and imbueing an item.  Here's 
  what could be done:

    .trigger set s 1301000000XXXXXXXX
    .trigger set r 9d******YYYYYYYY** send 3800000000XXXXXXXXYYYYYYYY

  This would store the last 4 bytes of the "click on Charsi" packet (13) in
  the XX buffer when we click on her.  It would then store bytes 5-8 of 
  the "item pickup verification" packet (9d) in the YY buffer when we 
  picked up an item and use those stored values to send the imbue packet 
  (38).  

  Let's run this through a real life scenario:

     - Click on Charsi -> packet 130100000006000000 is sent to the server

        The 1301000000XXXXXXXX trigger is tripped and 06000000 is 
        stored in the XX buffer.

     - Pick up an item from inventory -> packet 1951000000 is sent to the 
       server & packet 9d 05 2f 10 51 00 00 00 00 01 00 00 00 10 00 80 00 
       01 00 02 29 7e 60 6e 40 53 d4 84 0d 36 49 41 13 09 81 22 aa 91 22 
       bb 99 25 9a 19 5f ff is received from the server

       The 9d******YYYYYYYY** trigger is tripped and 51000000 is stored
       in the	YY buffer.  As the last act of the trigger, it also executes the
       following command:

          send 38000000000600000051000000

       which will imbue the item.

  The buffers will keep their values until they are overwritten (by tripping
  a trigger that writes to them) or until the trigger module is unloaded.

  -----------------------------------------------------------------------------

  Multiple Commands

  Trigger supports multiple commands per trigger.  It uses the ";" character
  to separate the commands. For example:

	 .trigger set s 19 say I picked it up!;say Yahoo!

  will print out "I picked it up!" and "Yahoo!" every time you pick up an item
  from inventory.

  -----------------------------------------------------------------------------

  Blocking Packets

  Trigger can also block packets using the "block" keyword.  For example:

     .trigger set s 19 block

  will prevent all 19 packets that are sent to the server.  Wildcards may be used
  with this method, as with all trigger commands.

  -----------------------------------------------------------------------------

  PLEASE NOTE  

  Due to the way in which trigger operates please bear in mind that
  [command] is actually executed BEFORE the triggering packet is 
  sent/received.  

  For example, if you're making a trigger that automatically drops an 
  items every time you pick one up from your inventory like this ...

     .trigger set s 19XXXXXXXX send 17XXXXXXXX

  ... it won't work because the drop packet (17) is sent before the pickup 
  packet (19). 

  The proper way to do this would be to trigger on receiving the "item 
  pickup validation" packet (9d) like this (which I like to
  call "butterfingers" :-) :

     .trigger set r 9d******XXXXXXXX** send 17XXXXXXXX 

  -----------------------------------------------------------------------------

Security:

  Trigger 0.05 version MD5SUM is 5f944d7703195a14abed4594bd820afd

  If the MD5SUM of the trigger.d2h file you have is different, please do not use it 
  as it may have been modified without my knowledge.  MD5SUM checksum may be obtained
  at the following location: http://etree.org/md5com.html

Official websites: 
  http://www.geocities.com/bootyjuicetrigger/

Requirements:
  D2HackIt! 0.45 or later.

Thanks to thohell for writing an incredibly clear and easy to understand interface.

--------------------------------------------------------------------------------
