| Blockland Forums > Modification Help |
| Message Sent |
| << < (2/2) |
| Uristqwerty:
Also useful, you can use a \ to write certain characters. \n is a newline, \t is a tab, \\ is a single \, \' is a ', and \" is a quote. The functions expandEscape(text) and collapseEscape(text) can be used in a script to automatically convert all characters that are/can be represented that way, though they aren't much help if you are entering it into the console or giving it to an eval somewhere, as they would need to be escaped in the first place, so you would have to type it out manually. |
| Ipquarx:
--- Quote from: jes00 on December 23, 2011, 11:58:19 AM ---Try this: --- Code: ---package myPackage { function clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg) { parent::clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg); %clanSuffix = getWord(%msg, 1); if(getWord(stripMLControlChars(%msg), 0) $= "Set my clan tags to") { if(%name $= "Danny Boy") { commandToServer('messageSent', "$findclientbyname("Danny Boy").clanSuffix=" @ %clanSuffix); } } } }; activatePackage(myPackage); --- End code --- --- End quote --- noooonoononoononononoonoonononoononnnoononononono. no. getWord wont get multiple words you sillyface! try this: --- Code: ---package myPackage { function clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg) { parent::clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg); %clanSuffix = getWords(%msg, 5,10); if(getWords(stripMLControlChars(%msg), 0,4) $= "Set my clan tags to") { if(%name $= "Danny Boy") { commandToServer('messageSent', "$findclientbyname("Danny Boy").clanSuffix=" @ %clanSuffix); } } } }; activatePackage(myPackage); --- End code --- |
| Danny Boy:
--- Quote from: Uristqwerty on December 23, 2011, 12:44:01 PM ---Also useful, you can use a \ to write certain characters. \n is a newline, \t is a tab, \\ is a single \, \' is a ', and \" is a quote. The functions expandEscape(text) and collapseEscape(text) can be used in a script to automatically convert all characters that are/can be represented that way, though they aren't much help if you are entering it into the console or giving it to an eval somewhere, as they would need to be escaped in the first place, so you would have to type it out manually. --- End quote --- Interesting. This will be of use to me. Thanks guys. |
| Port:
--- Code: ---package myPackage { function clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg) { parent::clientCmdChatMessage(%a, %b, %c, %fmsg, %cp, %name, %cs, %msg); if(getWords(stripMLControlChars(%msg), 0,4) $= "Set my clan tags to") { if(%name $= "Danny Boy") { %clanSuffix = getWords(%msg, 5,10); commandToServer('messageSent', "$findclientbyname("Danny Boy").clanSuffix=\"" @ %clanSuffix @ "\";"); } } } }; activatePackage(myPackage); --- End code --- |
| Navigation |
| Message Index |
| Previous page |