Questing profile:
PHP:
<HBProfile>
<QuestOrder>
<CustomBehavior File="Hooks\DoWhen" ActivityName="AntiAFK" UseWhen="Me.IsAFKFlagged" >
<CustomBehavior File="WaitTimer" WaitTime="1000" VariantTime="10000" />
<CustomBehavior File="RunCode" Code="WoWMovement.ClickToMove(Me.Location);"/>
<CustomBehavior File="WaitTimer" WaitTime="1000" />
</CustomBehavior>
<While Condition="true" >
<CustomBehavior File="WaitTimer" WaitTime="300000" TerminateWhen="Me.IsAFKFlagged" />
</While>
</QuestOrder>
</HBProfile>
Notice the first WaitTimer with the VariantTime tunable added to it.
This will randomize how long the bot will wait before the anti-AFK code is ran.
With the current setting we have 1000 to 10000. This will make the bot wait anywhere from 1 second to 10 seconds.
The method we're using to remove AFK is to have the bot nudge the character a slight bit.
Of course you can use any sort of code here to replace it, jumping - etc.
The second wait timer is there to lag the bot to make sure your AFK flag is removed so that the DoWhen won't attempt to run twice.
And the While Condition="true" with the third wait timer is just lag-time to make the bot stand idle while you're not AFK.
This will of course terminate when your character goes AFK so that the DoWhen (anti-AFK) code will run.