mIRC Home    About    Download    Register    News    Help

Print Thread
#107357 09/01/05 10:03 AM
Joined: Nov 2004
Posts: 332
R
Fjord artisan
OP Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
i attempted to make a event that would kick anyone who says a word to match a txt and omit and swearing by someone level 3 or higher in my ulist
but it didnt work

-------------------------------code----------------------------------
on *:text:*:#:{
if (($ulevel >= 2) && ($read(swear.txt,nw,$1+(*,$1-*)))) { kick # $nick language }
}
------------------------------code------------------------------------
ill be honest i broke personal policy and used a bit i dont fully understand that i got from optiks
which is : $1+(*,$1-*)))
anyways just some clarity on why it doesnt work would be appreciated and if you feel like it clarify that bit of code i pointed out


The Kodokan will move you, one way or another.
#107358 09/01/05 10:17 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
$1+(*,$1-*)

That 1 is wrong there, should be: $+(*,$1-*)


Gone.
#107359 09/01/05 11:20 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Is this it?

Code:
on *:Text:*:#: {
  if (($ulevel >= 3) && $read(swear.txt,w, $strip($1-))) { kick $chan $nick Language... ( $+ $ifmatch $+ ) }
}

#107360 09/01/05 09:59 PM
Joined: Nov 2004
Posts: 332
R
Fjord artisan
OP Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
to optics that bit of code came from you from another post when i was trying to match text from a file and do a action from another file
to slad while i can follow all you wrote im sharp enough to see that its >=3 which i want everyone 3 and above to be exempt


The Kodokan will move you, one way or another.
#107361 09/01/05 10:11 PM
Joined: Nov 2004
Posts: 332
R
Fjord artisan
OP Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
thanks works great with the change that you gave me


The Kodokan will move you, one way or another.
#107362 09/01/05 10:14 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
You got it from your random thread, where tidy posted that $+(*,$1-*).

I replied in that thread but I only talked about the timers and using n with $read switch.

I think you typod on it, because no one in that thread put $1+(*,$1-*)

Anyway, the important part is that you got it sorted,

Greets


Gone.
#107363 09/01/05 10:19 PM
Joined: Nov 2004
Posts: 332
R
Fjord artisan
OP Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
new problem:
someone typed
<Patience> |}
<Patience> ?
and got kicked for swearing
my swear .txt has these entries
ill censor them a bit but youll get the idea
fuc*
shi*
bitc*
dic*
coc*
cun*
whor*
bastar*
dam*
why would it kick on what that person entered?


The Kodokan will move you, one way or another.
#107364 09/01/05 10:40 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
It's your lucky day, there was just now posted something very similar right here

That should work out for you.

Btw the reason it matched was because of the question mark. It will look in your text file for this *?* but a question mark is a wildcard itself, meaning match 1 character, so it will match on any multitude of characters due to the * * around it, which it did.

The same problem would occur with an asterisk.

Anyway using $read for this is not an option, I think Sladekraven and you have misunderstood how the matchtext works. If you specify a wildstring in the $read identifier, it will look in your text file for the whole line inputted to match as a whole.

Example:

If someone says "hi ricky how are you doing?"

Your script will transform it into *hi ricky how are you doing?* and will look in you text file to see if that line is in it. Even though you might have *ricky* or *hi* or *you* etc in it, it won't match, as it's looking for the whole line to match.

That's why its much better to use a hash table and $hfind, which is displayed in the thread I linked you too. $hfind can tell mIRC that the hash table items have to match against the string, which is exactly what you want.

Greets


Gone.
#107365 09/01/05 10:54 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Idd, when I was testing it I realised it only gets the $1.

#107366 10/01/05 12:35 AM
Joined: Sep 2004
Posts: 200
I
Fjord artisan
Offline
Fjord artisan
I
Joined: Sep 2004
Posts: 200
i can think of one thats slightly better
on @*:text:*:#: {
set %n $gettok(%sweares,0,59)
while (%n > 0) {
if (* $+ $gettok(%sweares,%n,59) $+ * iswm $1-) { kick # $nick <kick reason here> | halt }
dec %n
}
}
alias addswear {
set %sweares %sweares $+ ; $+ $1-
echo -c info * Added $1- as a sweare.
}
alias delswear {
set %sweares $remove(%sweares,; $+ $1-)
echo -c info * Removed $1- as a sweare.
}
The only bug is that if you add blabla boo as a swear, and remove blabla youl have the sweare that was infront of blabla boo with a boo at the end of it as one.

#107367 10/01/05 04:12 AM
Joined: Nov 2004
Posts: 332
R
Fjord artisan
OP Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
hash is above my ability at the moment so i will just leave it alone until im ready
thanks anyways


The Kodokan will move you, one way or another.
#107368 10/01/05 11:22 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
Not sure if you're coding this for the experience or not, but I have one already made that can be located on mirc.net. The file can be found here if you're interested.


-KingTomato
#107369 10/01/05 06:03 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
shocked KingTomato dude. good to see you again. How are you doing?


Link Copied to Clipboard