on Noutrious code you should also add a ! to the on join so it dont reset the var back to 1 when the bot joins.
on !*:JOIN:#: