Author Topic: Chat responce  (Read 1260 times)

I was working on a chat responce thing (Thanks Poiuyt) and I want to make it so when someone say plz, it say "Act like a mature being." It works, but I need it to work when someone says "Plz help"

It only matches the exact word since it uses

if(%msg $= "plz")

How could I make it work if the sentence contains the word plz.

if(striPos(" "@%msg@" "," plz ")!=-1)

Checks if the word "plz" is in the sentence, with a space on either side.

if(striPos(%msg,"plz")!=-1)

Checks if the string "plz" is in the sentence, regardless of surrounding characters.
« Last Edit: July 28, 2009, 10:36:00 AM by Truce »

I'll post my code for radios and checking whether ", over" is in the sentence or not.
Code: [Select]
if(strstr(%text, ", over") > -1)//This checks to see if it's actually in the sentence
    {
if(getSubStr(%text,0,strPos(%text,"plz")+strLen("plz")) $= "plz")
                //Im not sure if that'll work, but it should go through the string and search for 'plz'
{
                   //Stuff goes here
                }
             }

But then again, Truce's would work better =/

Add it to the E-Tard filter. No script required.

Add it to the E-Tard filter. No script required.
I'm pretty sure he wants something client-sided.

Ok, now what about if the player says Plz 3 times, it results in a ban from the server for 5 minutes: Reason: you were banned for acting immature.

Code: [Select]
if(%msg = plz and whatnot)
{
   $count::[clientname]++;
   if($count::[clientname] > 2)
   {
      commandToServer('Ban',%client, %client.bl_id, (ENTER TIME HERE), "(ENTER REASON HERE)");
   }
}
This is still client sided.

%client.bl_id isn't client-sided. Try looking at Trader's client-side chat filter to get BL_IDs if that's what you want.

%client.bl_id isn't client-sided. Try looking at Trader's client-side chat filter to get BL_IDs if that's what you want.
WOuld his work though?

Ok, I have some packages. They are named Heed1, Heed2, etc. I want them to enable when I type /heedboton and disable when I type /heedbotoff

Could someone do this?

activatePackage(blah);
deactivatePackage(blah);

But he wants it to be so he can disable and enable
Just look at some other scripts

function serverCmdHeedboton(%client)
{
activatePackage(heed20);
};

function serverCmdHeedbotoff(%client)
{
DeactivatePackage(heed20);
};

Would that work?