This macro will allow you to stay in the mode. Even if you go somewhere, you will not be kicked for AFK.
Download the program (Download) and go to the macro editor
press the button «Open file»
and select the downloaded file
assign a macro to a key and run the program