|
confuzzed
|
confuzzed
|
ok update on @*:TEXT:*:#: {
if ($nick !isop #) {
var %i = 0
while (%i < $numtok(%swear.words,32)) {
; this while loops keeps going until its checked every word in %swear.words
inc %i
var %current.word = $gettok(%swear.words,%i,32) {
if ($istok($strip($1-),%current.word,32) == $true) {
;$istok returns $true if %current.word is in the text
set -u3600 %rl. [ $+ [ $address($nick,2) ] ] $calc( %rl. [ $+ [ $address($nick,2) ] ] + 1)
;the -u3600 makes the variable unset after 1hr without being used
if (%rl. [ $+ [ $address($nick,2) ] ] == 1) .notice $nick Please don't! - this is your first warning!
if (%rl. [ $+ [ $address($nick,2) ] ] == 2) .notice $nick Please don't! - this is your second warning next time you will be banned!
if (%rl. [ $+ [ $address($nick,2) ] ] >= 3) ban -u60 # $nick 11 {
kick # $nick You were warned. You are not allowed to swear in this irc channel!
}
}
}
}
} wich is what fits in my mirc setup but it still only kicks it dosent warn am i missing a warn command? or somthing along thoes lines
|
|
|
|
Joined: Dec 2002
Posts: 3,534
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,534 |
on [color:red]@[/color]*:TEXT:*:#: {
if ($nick !isop #) {
var %i = 0
while (%i < $numtok(%swear.words,32)) {
inc %i
var %current.word = $gettok(%swear.words,%i,32) {
if ($istok($strip($1-),%current.word,32) == $true) {
set -u3600 %rl. [ $+ [ $address($nick,2) ] ] $calc( %rl. [ $+ [ $address($nick,2) ] ] + 1)
if (%rl. [ $+ [ $address($nick,2) ] ] == 1) {
notice $nick Please don't! - this is your first warning!
}
if (%rl. [ $+ [ $address($nick,2) ] ] == 2) {
notice $nick Please don't! - this is your second warning next time you will be banned!
}
if (%rl. [ $+ [ $address($nick,2) ] ] >= 3) {
ban -k $chan $nick 2
}
}
}
}
}
}
You could not see the warns because of the " . " prefix before the command. From the help file under Command PrefixesIf you want to force a command to perform quietly ie. without printing out any information, then you can prefix it with a "." fullstop. Edit: Added @ prefix.
|
|
|
|
confuzzed
|
confuzzed
|
Thank you for your help i realt apreciate this considering i only just started using mirc 3 days ago but still the code only kicks it dosnt warn twice and then kick it just kick/bans is there any thing i need to set in variables?
|
|
|
|
Joined: Dec 2002
Posts: 3,534
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,534 |
<Test> swear -Andy- Please don't! - this is your first warning! <Test> swear -Andy- Please don't! - this is your second warning next time you will be banned! <Test> swear
* Andy sets mode: +b *!*@=fCodce75-893-963-302.range81-155.btcentralplus.com * Andy kicks Test from #Andy
That code works for me. Look in the variables section of mIRC and show me the line for %swear.words.
|
|
|
|
confuzzed
|
confuzzed
|
great news i got it fixed it was a command in variables that made it kick just took of the command and works like a charm thanks for the help  BTW im using my last code i posted the last one you posted bans the person to the point of me having to unban them i want to set it up for a 24 hour how would i do that?
Last edited by confuzzed; 12/01/05 12:04 PM.
|
|
|
|
Joined: Dec 2002
Posts: 3,534
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,534 |
You're welcome. Maybe now I should actually go to sleep, I like FiberOPtics have been awake 24 hours. 
|
|
|
|
confuzzed
|
confuzzed
|
lol thanks agin i havnt bin to sleep my self bin at this for 16 hoursa now but one more befor you go what code would i use for a 24 hour ban ?
|
|
|
|
confuzzed
|
confuzzed
|
can any one help me with this question of what code would i use for a 24hour ban?
|
|
|
|
Iori
|
Iori
|
The numbers are seconds. 
|
|
|
|
Joined: Dec 2002
Posts: 3,534
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,534 |
//echo -a $duration(24 hrs) //echo -a $duration(5 hrs)
Keeping in mind if you set a 24 hour ban, you'd have to be in the channel that 24 hours to remove the ban automatically. As soon as you leave the channel the 24 hour ban will turn into a normal ban so it wont automatically unban, you'd have to manually type: /mode #channel -b address
|
|
|
|
confuzzed
|
confuzzed
|
slade i understand that my bot will be a 24-7-365 bot also when i try adding my cuss word list my list is to big can i just make a %swear.words.ini/mrc file with all the words them self in it or do i have to belimited to what they give?and where do i insert the code? is it on @*:TEXT:*:#: {
if ($nick !isop #) {
var %i = 0
while (%i < $numtok(%swear.words,32)) {
inc %i
var %current.word = $gettok(%swear.words,%i,32) {
if ($istok($strip($1-),%current.word,32) == $true) {
set -u3600 %rl. [ $+ [ $address($nick,2) ] ] $calc( %rl. [ $+ [ $address($nick,2) ] ] + 1)
if (%rl. [ $+ [ $address($nick,2) ] ] == 1) {
notice $nick Please don't! - this is your first warning!
}
if (%rl. [ $+ [ $address($nick,2) ] ] == 2) {
notice $nick Please don't! - this is your second warning next time you will be banned!
}
if (%rl. [ $+ [ $address($nick,2) ] ] >= 3) {
ban -k $chan $nick 2 //echo -a $duration(24 hrs)
}
}
}
}
}
} lol btw befor i went to sleep i put your code back up it works better  thanks for all the help
|
|
|
|
Joined: Dec 2002
Posts: 3,534
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,534 |
It is possible, but try this way calling from an alias. * When they get kicked it should look something like.. Banned for 1 day --> crap <--
alias swear {
return please put your swear words here seperated by a space like so
}
on @*:TEXT:*:#: {
if ($nick !isop #) {
var %i = 0
while (%i < $numtok($swear,32)) {
inc %i
var %current.word = $gettok($swear,%i,32) {
if ($istok($strip($1-),%current.word,32) == $true) {
set -u3600 %rl. [ $+ [ $address($nick,2) ] ] $calc( %rl. [ $+ [ $address($nick,2) ] ] + 1)
if (%rl. [ $+ [ $address($nick,2) ] ] == 1) {
notice $nick Please don't! - this is your first warning!
}
if (%rl. [ $+ [ $address($nick,2) ] ] == 2) {
notice $nick Please don't! - this is your second warning next time you will be banned!
}
if (%rl. [ $+ [ $address($nick,2) ] ] >= 3) {
ban -k $chan $nick 2 Banned for $duration($duration(24 hrs)) --> $ifmatch <--
}
}
}
}
}
}
|
|
|
|
confuzzed
|
confuzzed
|
ok that code works but the alias thing dont this is what i wrote did i do it wrong alias swear {
return please put your swear words here seperated by a space like so [censored]
}
|
|
|
|
Joined: Dec 2002
Posts: 3,534
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,534 |
That looks perfect, as soon as someone types into a channel one of those words it should pick up on it, it worked for me.
|
|
|
|
confuzzed
|
confuzzed
|
ok when i tried it just gave anumber like 3 5 ect ect also is there a way i can do my swear words in a .ini/.mrc file with the title being %swear.words?
|
|
|
|
Joined: Feb 2004
Posts: 2,013
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,013 |
Got a little tip that you might like: You can set a var to another var, and then inc that var or check its value by using $eval accordingly, as you can see here, it shortens the code a whole lot. var %a = $+(%,rl.,$wildsite) inc -u3600 $(%a) if $(%a,2) == 1 { } elseif $(%a,2) == 2 { } else { }
Greets
|
|
|
|
|