of course it has it. Your script is doing it 3 times per second. You can insert the -n between JOIN %chan

If your network has multiple servers, you might want to change ($server == serveraddress) and replace it with ($network == networkstring)