The issue lies in this line:
commandToServer('commandSent',"Rulebot: Hello, "@%name);
If your aim is to send a chat message to the server you're on, you should be passing the first parameter in commandToServer, 'messageSent', or, 'teamMessageSent' if you want to send the message to your team.