Blockland Forums > Modification Help
Help with Chatbot
(1/6) > >>
Blocki:
So far, I created a bot that reacts to chat messages, but when updating it I get a very strange error message.

That's my script:

--- Code: ---package KalBot
{
        function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
        {
                parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
                switch$(%msg)
                {
                        case "Update KalBot":
                                if (%name $= "Kaladune")
                                {
                                      commandToServer('messageSent',"KalBot: updating...");
                                      exec("Add-Ons/Client_KalBot/Client.cs");
                                      commandToServer('messageSent',"KalBot: Updated!");
                                }
                                return;

                        case "win":
                                if (%name !$= "Kaladune")
                                {
                                      commandToServer('messageSent',"KalBot: Omg that noob won");
                                }
                                return;
                               
                        case "Hi":
                                      commandToServer('messageSent',"KalBot: Hey!");
                                return;

                        case "Deactivate KalBot":
                                      commandToServer('messageSent',"KalBot: D=");
                                      commandToServer('messageSent',"KalBot: Deactivated...");
                                      deactivatePackage(KalBot);
                                return;
                                
                        case "Shut up":
                                      commandToServer('messageSent',"KalBot: Shut up yourself...");
                                return;
                }

        }
        
};
activatePackage(KalBot);

--- End code ---

And this is what the console says when updating KalBot:


--- Quote ---Executing Add-Ons/Client_KalBot/client.cs.
Add-Ons/Client_KalBot/client.cs Line: 44 - Syntax error.
>>> Some error context, with ## on sides of error halt:
                        case "Shut up":

                                      commandToServer('messageSent',"KalBot: Shut up yourself...");

^^^^^^^^return;

                }



        }

        

};

deactivatePackage(KalBot);

activatePackage(KalBot);

*Õ##\##Ú¤*VS%+L®
d¨U·ÝÎŽ~B·xi4§¬|Fºt¥u|HÇì¾¼º²ö^{ÌcLq¤&+­ ø°OQßdÖ¶ÚÅ1z…>‹"H—i¦!½‡âCÌâ „Z/¶Õ[
>>> Error report complete.

De-activating package: KalBot
Activating package: KalBot

--- End quote ---
Any ideas?
YourBuddyBill:
Does this Kalbot talk with your name in chat? Just curious...
Blocki:
it'll look like:

Kaladune: KalBot: Hey!
otto-san:
could you possibly post the actual script file
Treynolds416:
I hate to ask such an obvious question, but do you have all that junk stuff special character crap at the bottom of your script?
Navigation
Message Index
Next page

Go to full version