| Blockland Forums > Modification Help |
| Chatbot Help? |
| (1/1) |
| kendawg:
Hey, Ive played Blockland since.. A while. :p I've never gotten into scripting, and I'd like to start. I've seen a few scripts and I came across a Chat Bot. Im sure you know what it is. So, can someone teach me or give an example of a chat bot? I tried to make one, and I made this --- Quote ---package chatbot { function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%fmsg) { parent: :clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%fmsg); if (%msg $= "testing testing 123") { if (%name $= "Kendawg") { commandToServer('messageSent',"I hear you, shut the FAK UP!"); } } }; activatePackage(chatbot); --- End quote --- |
| Eeposs:
--- Code: ---package chatbot { function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg) { parent::clientCmdChatMessage(%a,%b,%c,%msg,%cp,%name,%cs,%msg); if (%msg $= "testing testing 123 123") { commandToServer('messageSent',"I hear you, shut the FAK UP!"); } } }; activatePackage(chatbot); --- End code --- |
| Greek2me:
You want to make sure that you have a good coding style. It needs to be easily read by another person. --- Code: ---package chatbot { function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg) { parent::clientCmdChatMessage(%a,%b,%c,%msg,%cp,%name,%cs,%msg); if (%msg $= "testing testing 123 123") { commandToServer('messageSent',"I hear you, shut the FAK UP!"); } } }; activatePackage(chatbot); --- End code --- Note how I used tabs for indentation instead of spaces and that each bracket { } has it's own line. |
| jes00:
--- Quote from: kendawg on October 16, 2011, 08:50:14 PM ---So, can someone teach me or give an example of a chat bot? --- End quote --- What kind of chat bot? |
| Navigation |
| Message Index |