Author Topic: Could someone make me a chat script  (Read 1581 times)

I say lol too much in-game, boink agrees with me

so I need a script that changes lol to some other way of laughing whenever I say it in chat.

thanks

I lol'd at this.
Er, I actually did snicker.

I lol'd at this.
Er, I actually did snicker.

this would also be quite funny if it was server-sided

as in changing everyone's chats

I say lol too much in-game

Simplest fix ever: Stop saying lol so much.  You could say stuff like "hahaha" instead.
« Last Edit: December 10, 2012, 01:39:15 PM by Vaux »



$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

a problem with this may arise if you have long messages and the replacement is longer than three characters since there's a cap

i guess that's not a huge problem maybe

ROFL
ROFLZ
LMAO
LMFAO
lolololollolololololololololo lolololololololololololololol olollo
XD
:D

^use these^

You could make a script that makes someone sound like a moron by changing the word
THE to
 de
 da
 le
 teh

$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

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

ROFL
ROFLZ
LMAO
LMFAO
lolololollolololololololololo lolololololololololololololol olollo
XD
:D

^use these^
those are worse than LOL, the 5th one the most

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
« Last Edit: December 11, 2012, 01:12:21 AM by hodototman »

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

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