Because after you type the line mIRC resets the idle counter. You can use $idle in a script without it resetting.