Blockland Forums > Suggestions & Requests
Could someone make me a chat script
<< < (3/3)
Nexus:

--- Quote from: MARBLE MAN on December 10, 2012, 08:02:46 PM ---$LOLPlace::Enabled = 1;
package LOLPlace
{
   function serverCmdMessageSent(%client,%text)
   {
      if($LOLPlace::Enabled)
      {
         switch(getRandom(0,23))
         {
            case 0 : %word = "Ha!";
            case 1 : %word = "That's funny!";
            case 2 : %word = "Heh";
            case 3 : %word = "I cut my self in my sleep.";
            case 4 : %word = "lmao";
            case 5 : %word = "rotflol";
            case 6 : %word = "haha";
            case 7 : %word = "lawl";
            case 8 : %word = "hah";
            case 9 : %word = "funny";
            case 10 : %word = "I find that funny";
            case 11 : %word = "I attempted to say \"lo<color:ffffff>l\", but my script stopped me!";
            case 12 : %word = "*snort* haha";
            case 13 : %word = "loooool";
            case 14 : %word = "i laughed way to hard at that";
            case 15 : %word = "i didn't even think that was funny";
            case 16 : %word = "***";
            case 17 : %word = "****";
            case 18 : %word = "noob";
            case 19 : %word = "i pity you";
            case 20 : %word = "you think that was funny";
            case 21 : %word = "I stopped laughing after the accident";
            case 22 : %word = "you make me sad";
            case 23 : %word = "ASDFASDFASDFASDFASDGSDEJAFSEB AGSEFJLASEFGAUOSCGASEFJBASEUG FAW";
         }
         %text = StrReplace(%text,"lol",%word);
         %text = StrReplace(%text,"LOL",%word);
         %text = StrReplace(%text,"Lol",%word);
         %text = StrReplace(%text,"LOl",%word);
         %text = StrReplace(%text,"lOl",%word);
         %text = StrReplace(%text,"lOL",%word);
         %text = StrReplace(%text,"loL",%word);
         parent::serverCmdMessageSent(%client, %text);
      }
      else
      {
         parent::serverCmdMessageSent(%client, %text);
      }
   }
};
activatepackage(LOLPlace);

effective but horrible code

--- End quote ---

I'm pretty sure that strreplace is not case sensitive
there are only a couple things in torquescript that are
Buu:

--- Quote from: Tic-toc26 on December 10, 2012, 08:42:29 PM ---ROFL
ROFLZ
LMAO
LMFAO
lolololollolololololololololo lolololololololololololololol olollo
XD
:D

^use these^

--- End quote ---
those are worse than LOL, the 5th one the most
hodototman:
I packaged the code, it just doesn't let me say lol. It doesn't even display a message.

EDIT: You have to say lol a couple of times for it to work.

fixed the code, i accidentally removed case : 0
Greek2me:

--- Quote from: Nexus on December 10, 2012, 10:04:34 PM ---I'm pretty sure that strreplace is not case sensitive
there are only a couple things in torquescript that are

--- End quote ---

Yep, it's one of the few. You should use striReplace, from Clockturn's strlib. http://forum.blockland.us/index.php?topic=177446.0
Navigation
Message Index
Previous page

Go to full version