So, I'll take this code from Phil in a recent post.
<<All>> Macro /assist %$Leader% Chan 1 Set Toon,%SaveToon% if %Toon% > 5 <<All>> Hit - Chan 1 else Chan %Toon% Hit - endif
What exactly does "Chan 1" do/ How does it work?
I understand it 'resets the active channel'. However, why I'm lost is, it seems very backwards. When we set a macro, when ALL Hit a key, we rest back to Chan 1 (is that because <<ALL>> defaults to a Chan all?) but yet when we specifically say Chan %Toon% (which could be 1, 2, ..., 5), we don't bother resetting back to Chan 1.
I don't quite get it.


There are are number of things to explain.
Firstly GCP sends to channels, not toons.
Internally "<<Toon1>>" is converted to "chan 1", "<<Toon2>> to "chan 2" and <<All>> to chan 1,2,3,4,5 etc.
This conversion is dynamic so <<DPS>> will expand to different things, depending on who is in the DPS group at the moment.
Now Chan 1,2,3,4,5 means repeat the next "block of commands" for channels 1 thru 5 (i.e. loop 5 times). In this context "block of commands" means anything between the current chan instructions and the next chan instructions (or the end of the command).
This makes sense because we can write:
<<All>>
command1
<<Toon3>>
Command2
<<DPS>>
Command3
Command1 will be done for all toons, command2 will be done just once, and command3 will be done for any toons in the DPS group.
The fiddle is to do with if, else, endif. Basically else flips a status (i.e. makes a true false or vice versa). If the else was executed multiple times, then things would get unpredictable.
Bottom line is, any command that I only want to run once, I precede with a "chan 1"
Hope this helps
Phil
Designer Of GameCommanderPro - www.GameCommanderPro.com
Designer Of KeyBlaster - www.keyblaster.com