@name 39Bot_scanner
@inputs TurretM
@outputs ScanClk
@persist ScanClk

interval(10)

if ( TurretM & ~TurretM ) { timer("Scan",200) }
if ( clk("Scan") ) { 
    timer("Scan",200)
    ScanClk = 1 
} elseif (!clk("Scan")) { ScanClk = 0 }

if (TurretM & ~TurretM ) { timer("Sound",2000) }
if ( clk("Sound") ) { 
    timer("Sound",2000) 
    soundPlay("Ping",1,"npc/turret_floor/ping.wav")
}

if ( !TurretM ) { 
    stoptimer("Scan")
    stoptimer("Sound") 
}
