Automatically disconnects from rogue wifi networks (usually education/corporate networks) that sends and receives data to and from your phone even when it is idle/asleep.
Works similarly to android's 'keep wifi on during sleep' feature, but only shuts it off when nothing's downloading in the background.
To verify a suspected battery draining network, download a network speed checker from the play store (I use MIUI's integrated 'show network speed')
After downloading, change the wifi network name in block 10 to the name of the rogue network, and the max values of blocks 2 and 7 to slightly above the idle network transfer speeds. Tweak the delays optionally for a more/less aggressive disconnect.