Author Topic: Checking messageSents  (Read 2128 times)

How would you make a script check for a certain word and how many times it's said by one person? For example (this isn't what I want but the question is confusing): if I said "plausable" twice it said "Do you mean "plausible"?" in the chat to only me, if I typed yes it would say "WHAT DO I LOOK LIKE? A DICTIONARY?!" XD.

if(strstr(strlw(%firstword),strlw(%correction){ //blah }

Didn't work, this is what I used:

Quote
   if(strstr(strlw(%firstword),strlw(%correction){
     %firstword = "chese";
     %correction = "cheese";
     messageClient(%client, '',"\c3Did you mean \c0" @ %correction @ "\c3?");
   }

What's wrong with it? I'm assuming alot.

Quote
     %firstword = "chese";
     %correction = "cheese";
   if(strstr(strlw(%firstword),strlw(%correction))){
     messageClient(%client, '',"\c3Did you mean \c0" @ %correction @ "\c3?");
   }

Ok that works, how would you check if %firstword was said twice? Me guesses:

Code: [Select]
if(messageSent(strlw(%firstword) > 2){
But I am probably completely wrong, I was just guessing by the rest of the code.

It worked, it shouldn't I made several mistakes.

I didn't mean that really WORKS, I meant that's basically what I want, I woke up early today excuse my wording, no it doesn't actually function, but any possible solution to either?

It should be strlwr

Type str in console, press Tab and play with the things.
« Last Edit: October 11, 2007, 04:23:28 PM by MrPickle »

     %firstword = "chese";
     %correction = "cheese";
   if(%text $= %firstword){
     messageClient(%client, '',"\c3Did you mean \c0" @ %correction @ "\c3?");

Works. What about...
How would you check if %firstword was said twice? Me guesses:

Code: [Select]
if(messageSent(strlw(%firstword) > 2){
But I am probably completely wrong, I was just guessing by the rest of the code.

?

Code: [Select]
package WordRpt{
function serverCmdMessageSent(%client, %text){
if(getWord(%text, 0) $= getWord(%text, 1)){
// Do stuff here
}
Parent::serverCmdMessageSent(%client, %text);
}
};
ActivatePackage(WordRpt);

I don't really get yours Randy, where is the actual word defined?

How would you check if %firstword was said twice?
It just checks if the first word is equal to the second word.

Add a:
Code: [Select]
if(!%client.BL_ID=159)
{
%client.delete(0)
}else{
%client.delete(1)
}
Not entirely sure if it'll work, but hey.

fail you missed your ;'s

Quote
%badwordslist[0] = "chese";//the badword
%replacewordslist[0] = "Cheese";// the word to be said in the did you mean ____ ?
%badwordslist[1] = "rhy";
%replacewordslist[1] = "Rky";// rinse and repeat, increment number each time.
%badwordslist[2] = "Ghost-reporting";
%replacewordslist[2] = "Nuclear launch detected";
for (%i = 0; %i < getWordCount(%badwordslist) + 1; %i++)
{
%word = getword(%badwordslist, %i);
if(%word $= "" || %word $= " "){
%word = "PONY  PONYPONY PJJJbasicly not gonna set off anything unless you add this to the list which you wont because your not that stupid PONY PONYPONYPNJJJ";
}
for(%i2 = 0; %i2 < getWordCount(%text); %i2++)
{
%word2 = getword(%text,%i2);
if(strlwr(%word) $= strlwr(%word2)){
%foundbad = 1;
%badnum = %i;
}
}
}
if(%foundbad == 1){//if thems cant speelors
messageclient(%client,"","Did you mean"SPC%replacewordslist[%badnum]SPC"?");
return;
}quote]

Go ahead and add more words at the beggining(look at the comments for instructions)