|
PHMinistries
|
PHMinistries
|
im fixing to write a new script for a swear kicker,
if ($1- isin swear.txt) { commands }
that problely wont work
but i wanted to have something writen so that if someone said something that was in a text file it would trigger it.
any ideas?
|
|
|
|
saragani
|
saragani
|
if ($read(swear.txt,w,* $+ $1- $+ *)) { command }
Last edited by saragani; 15/07/03 07:19 PM.
|
|
|
|
Joined: Mar 2003
Posts: 272
Fjord artisan
|
Fjord artisan
Joined: Mar 2003
Posts: 272 |
if ($read(swear.txt, w, $+(*,$1,*) ) { .. }
|
|
|
|
saragani
|
saragani
|
LOL  I have beat you in 1 second...... The * $+ $-1 $+ * or the $+(*,$1-,*) is that it will look for the text in a line. If you just use $1 , it will do the command only when there is a line which is exactly like $1 (has only $1) You can also reffer to the line by $readn , This will give you the number of the line.
Last edited by saragani; 15/07/03 07:20 PM.
|
|
|
|
codemastr
|
codemastr
|
Well I have an idea of what you want to do, however I doubt your example is what you want to do so let me verify. You will have a swear.txt that lists all the swear words? The reason I ask is (even if isin worked for files) that still wouldn't work: $1- hey how are you swear.txt = damn if ($1- isin swear.txt) That would mean if (hey how are you isin damn) So I assume you meant it the other way around? Check if words in the file are in the user's text? In which case you'd need to use $read, and check if $1, $2, $N are in swear.txt using a loop:
var %i = 1
while (%i <= $0) {
if ($read(swear.txt, ns, $eval($chr(36) $+ %i,2))) {
; kick the user
break
}
inc %i
}
Something like that should work, note however I didn't actually test that.
|
|
|
|
PHMinistries
|
PHMinistries
|
on *:text:*:*:{ if ($read(swear1.txt,w,* $+ $1- $+ *)) { msg # Dances for you } }
thats what im testing out, if you say the f word by itself it will dances for you,
but if you use it in the sentense it wont,
ive tried $1- but it doesnt make a difference
i dont understand what the person with the variable is, or how to make that one work or trigger,
any more ideas?
|
|
|
|
codemastr
|
codemastr
|
Try reading my post, it will work regardless of where it appears in the text.
|
|
|
|
PHMinistries
|
PHMinistries
|
ill ry but how do you trigger it, im sorry im just lost of where to put it.
btw you work with UNreal IRCd?
|
|
|
|
codemastr
|
codemastr
|
ON @*:text:*:*:{
var %i = 1
while (%i <= $0) {
if ($read(swear.txt, ns, $eval($chr(36) $+ %i,2))) {
.kick $chan $nick Swearing is not allowed
break
}
inc %i
}
}
And yes I do work on UnrealIRCd.
|
|
|
|
PHMinistries
|
PHMinistries
|
ON *:text:*:*:{ var %i = 1 while (%i <= $0) { if ($read(swear1.txt, ns, $eval($chr(36) $+ %i,2))) { msg # dances around the room break } inc %i } }
thats not working for me that well,
btw, i use Unreal, best ircd ever!
|
|
|
|
codemastr
|
codemastr
|
Is the file swear.txt or swear1.txt? Your first post said swear.txt, now you're saying swear1.txt
|
|
|
|
PHMinistries
|
PHMinistries
|
its swear1.txt
its not even geting triggered with any errors or anything
|
|
|
|
demitrix
|
demitrix
|
on 1:TEXT:*:#yourchannelhere:{
if ($istok($read(C:\swear.txt),$1-,46) == $true) {
kick $chan $nick Swearing is not allowed
}
}
change C:\swear.txt to ur file and write swear.txt as word.word.word etc works on my end
|
|
|
|
Joined: Mar 2003
Posts: 272
Fjord artisan
|
Fjord artisan
Joined: Mar 2003
Posts: 272 |
alias badword {
var %ctr = 1,%tmp = swear.txt
while ($read(%tmp,%ctr)) {
if ($istok($strip($1-),$ifmatch,32)) { return $true | halt }
inc %ctr
}
return $false
}
On @*:TEXT:*:#:{
if ($badword($1-)) { echo -a Bad word detected from $nick $+ . Do whatever you want here. }
} That should do the trick. [edit]Oh and your text file structure should be one bad word per line.[/edit]
Last edited by c0ldfusi0n; 15/07/03 11:50 PM.
|
|
|
|
demitrix
|
demitrix
|
on 1:TEXT:*:#yourchannelhere:{
if ($istok($read(C:\swear.txt),$1-,32) == $true) {
kick $chan $nick Swearing is not allowed
}
}
change C:\swear.txt to ur file and write swear.txt as a worrd on each line. u might want to copy that code and change text to ACTION also cause ppl could /me says cusswordhere
|
|
|
|
Joined: Jan 2003
Posts: 2,973
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 2,973 |
Here is a hash table method, it is also dialog based. Meaning you open the dialog, then add a word. From there, you can choose how harsh youd like the occurance of that word to be. i.e. if someone says f__k, you can choose from "warn, kick, ban, kickban" >:D http://www.kingtomato.com/snipplets/swearing.zip
|
|
|
|
Joined: Mar 2003
Posts: 272
Fjord artisan
|
Fjord artisan
Joined: Mar 2003
Posts: 272 |
|
|
|
|
Joined: Jan 2003
Posts: 2,973
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 2,973 |
Actually, i made it a while ago. I make scripts for ppl who request them (when i can) and keep them incase others need them. Thats all >:D
|
|
|
|
demitrix
|
demitrix
|
king is an mIRC god dont assume hes attitude or he will smote upon you
|
|
|
|
|