| Blockland Forums > Help |
| ChatBot help |
| << < (3/8) > >> |
| FFSO:
You needed to have a ; on the parent() line. --- Code: ---//Fixed parent::clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg); //Not Fixed parent::clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg) --- End code --- |
| FFSO:
--- Quote from: MasterChief55 on January 10, 2012, 09:55:29 PM ---never mind, it works now, thanks jes! but one more thing id like to know, how do you add multiple phrases? --- End quote --- Noedit: Use case: or use switch$ or use else if() |
| MasterChief55:
uhh FFSO im fairly new to scripting i have no idea what you mean |
| Headcrab Zombie:
--- Quote from: FFSO on January 10, 2012, 10:33:21 PM ---Noedit: Use case: or use switch$ or use else if() --- End quote --- switch and case are part of the same structure --- Quote from: MasterChief55 on January 10, 2012, 10:34:37 PM ---uhh FFSO im fairly new to scripting i have no idea what you mean --- End quote --- --- Code: ---package Gravbot { function clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg) { Parent::clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg); if(%name $= "xXGravity DogXx") { switch$(%msg) { case "Rofl": %reply = "Don't roll on the floor, it's not healthy."; case "Hi": %reply = "Hello."; case "Bye": %reply = "Good bye."; default: return; } commandtoserver('messagesent',%reply); } } }; activatePackage(Gravbot); --- End code --- |
| Slicksilver:
--- Quote from: Headcrab Zombie on January 10, 2012, 11:26:04 PM --- --- End quote --- I wish this forum had a sort of ranking system, I would nominate you for the most patient and helpful person on this forum, especially in Coding Help. Every time I ever browse that forum, I see your accurate and helpful responses. I think I speak for all the beginning scripters and all the more advanced scripters when I say thank you for making all of our lives easier. |
| Navigation |
| Message Index |
| Next page |
| Previous page |