mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#107539 11/01/05 07:43 AM
Joined: Jan 2005
Posts: 59
C
Babel fish
OP Offline
Babel fish
C
Joined: Jan 2005
Posts: 59
Hi im in desperate need of help im looking to make a swear word ban system for irc what i would like it to do is warn the user twice and then ban them for 24 hours i just need someone to point me in the right direction thanks

#107540 11/01/05 08:12 AM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
You can see a simple swear word kicker here. You can then incorporate the Reaction Levels tutorial from the same page.

You may also wish to see /help on text and /help if then else.

Regards,


Mentality/Chris
#107541 11/01/05 09:26 AM
Joined: Jan 2005
Posts: 59
C
Babel fish
OP Offline
Babel fish
C
Joined: Jan 2005
Posts: 59
very neat but how do i make it a program and run it in irc and what type of program do i make it?

#107542 11/01/05 09:40 AM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
That is mIRC script. It's a language unique to mIRC (For now anyway *cough*). I'm assuming you're using mIRC.

You can use mIRC's Script Editor to paste code. Press ALT+R to access it.

You could also search some of these mIRC-script-related sites to find ready-made addons if you prefer:

www.mirc.net
www.mircscripts.com
www.hawkee.com
www.mircscripts.org

Regards,


Mentality/Chris
#107543 11/01/05 07:15 PM
Joined: Jan 2005
Posts: 59
C
Babel fish
OP Offline
Babel fish
C
Joined: Jan 2005
Posts: 59
well i found one but how do i use it i mean how can i set it up for what i want it to do here is the link to the one i got http://www.irc-lounge.com/index.php?page=scripts&script=swear

#107544 11/01/05 08:05 PM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
You would paste that in the ALT+R editor as I said above.

However, it apparently needs some other addon/script to work, so you'll have to use that. If you stuck to the websites I advised you to search on, it is unlikely you'd have to go through such hassle.

Regards,


Mentality/Chris
#107545 11/01/05 08:22 PM
Joined: Jan 2005
Posts: 59
C
Babel fish
OP Offline
Babel fish
C
Joined: Jan 2005
Posts: 59
ya i know but a guy i know is the maker of this file and it does exactly what i want with the warnings and then 24 hour ban i already have the file loaded but i need to know how to add words and make adjustments like add words and set priority ect. ect.

#107546 11/01/05 08:35 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
From what I can make out of that script you can't add them unless using hadd -m swear.words <swear word>.

I don't think you know what that does, basically that creates a hash table (database) if you like to store your data. The hash table swear.words is the table name. <swear word> would obviously be the item.

Alternatively, if you are on the channel #supermods-op and the value for $swear.add is "1", then you may add them. But it'd have to be a bot or something as there's no other command you can actually type to add words, it'd be someone else typing it. You say you know the author, so get him to write an On Input section of that code.

Hope this helps.

#107547 11/01/05 08:39 PM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
If you know the author, you should ask *them* for help with *their* script.

Regards,


Mentality/Chris
#107548 12/01/05 06:59 AM
Joined: Jan 2005
Posts: 59
C
Babel fish
OP Offline
Babel fish
C
Joined: Jan 2005
Posts: 59
ight well the author dont understand why it wont work on my channel so i tried typing one up from that link you provided earlyer wanted to know if this will work all help is apreciated



on @*:TEXT:*:#:{
if ($nick !isop #) {
if ([censored] isin $1-) || (dick isin $1-) || ([censored] isin $1-) {
;The above if statement is what actually checks for the swear words
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!
}
}
}

Last edited by confuzzed; 12/01/05 07:32 AM.
#107549 12/01/05 07:29 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Are you sure you wrote that?

#107550 12/01/05 07:31 AM
Joined: Jan 2005
Posts: 59
C
Babel fish
OP Offline
Babel fish
C
Joined: Jan 2005
Posts: 59
sorry i typed it up from this i will go back and edit my other post http://helpdesk.vakuum.nu/documents/protection.htm#1 will that work tho?

#107551 12/01/05 07:39 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Well I prefer the $numtok one...

Code:
on @*:TEXT:*:#:{
 if ($nick !isop #) {
  if ([censored] isin $1-) || (dick isin $1-) || ([censored] isin $1-) {
   ;The above if statement is what actually checks for the swear words
   ban -u60 # $nick 11
   kick # $nick Do not swear!
  }
 }
}


This one would be a poor example because you are going to have one long line of profanity when you can just store them in a variable, or hash table.

#107552 12/01/05 07:46 AM
Joined: Jan 2005
Posts: 59
C
Babel fish
OP Offline
Babel fish
C
Joined: Jan 2005
Posts: 59
so this is what it should be and will it wok to warn and then ban?

Code:
on @*:TEXT:*:#: {
 if ($nick !isop #) {
  var %i = 0
   while (%i &lt; $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) ] ] &gt;= 3) ban -u60 # $nick 11 {
kick # $nick You were warned. You are not allowed to swear in this irc channel!
  }
 }
}
  

#107553 12/01/05 07:51 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
That script basically warns the user twice then on the third time it will kickban the user. It seems fine, I'm not one for loading others scripts so you will have to test it.

Add the swear words by:
/set %swear.words word1 word2 word3 word4 word5
etc.

#107554 12/01/05 08:04 AM
Joined: Jan 2005
Posts: 59
C
Babel fish
OP Offline
Babel fish
C
Joined: Jan 2005
Posts: 59
ok tested but it kicked me other thin warn me what have i done wrong?

#107555 12/01/05 08:56 AM
Joined: Jan 2005
Posts: 59
C
Babel fish
OP Offline
Babel fish
C
Joined: Jan 2005
Posts: 59
also what does this mean and how do i do this i think this might be what is causing it to maess up? You would also need to clear your %rl.* variable list every time you connect to a server or start up mIRC:

on *:START: unset %rl.*
on *:CONNECT: unset %rl.*

#107556 12/01/05 08:59 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
That simply unsets all users who have been warned. When mIRC starts and connects.

#107557 12/01/05 09:08 AM
Joined: Jan 2005
Posts: 59
C
Babel fish
OP Offline
Babel fish
C
Joined: Jan 2005
Posts: 59
can you tell me what is wrong with the code and why it wont warn an then ban?

Code:
on @*:TEXT:*:#: {
  if ($nick !isop #) {
    var %i = 0
    while (%i &lt; $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) ] ] &gt;= 3) ban -u60 # $nick 11 {
          kick # $nick You were warned. You are not allowed to swear in this irc channel!
        }
      }
    }

#107558 12/01/05 09:16 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
var %current.word = $gettok(%swear.words,%i,32){

needs to be..

var %current.word = $gettok(%swear.words,%i,32) {

Edit:

In the code you sent us you're also missing 3 } braces...

[code]
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!
}
}
}
}
}
}

#107559 12/01/05 09:47 AM
Joined: Jan 2005
Posts: 59
C
Babel fish
OP Offline
Babel fish
C
Joined: Jan 2005
Posts: 59
ok update

Code:
on @*:TEXT:*:#: {
  if ($nick !isop #) {
    var %i = 0
    while (%i &lt; $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) ] ] &gt;= 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

#107560 12/01/05 10:34 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Code:
on [color:red]@[/color]*:TEXT:*:#: {  
  if ($nick !isop #) {    
    var %i = 0    
    while (%i &lt; $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) ] ] &gt;= 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 Prefixes

If 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.

#107561 12/01/05 11:17 AM
Joined: Jan 2005
Posts: 59
C
Babel fish
OP Offline
Babel fish
C
Joined: Jan 2005
Posts: 59
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?

#107562 12/01/05 11:33 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
<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.

#107563 12/01/05 12:02 PM
Joined: Jan 2005
Posts: 59
C
Babel fish
OP Offline
Babel fish
C
Joined: Jan 2005
Posts: 59
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 smile
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.
#107564 12/01/05 12:04 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
You're welcome. Maybe now I should actually go to sleep, I like FiberOPtics have been awake 24 hours. wink

#107565 12/01/05 12:13 PM
Joined: Jan 2005
Posts: 59
C
Babel fish
OP Offline
Babel fish
C
Joined: Jan 2005
Posts: 59
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 ?

#107566 12/01/05 09:54 PM
Joined: Jan 2005
Posts: 59
C
Babel fish
OP Offline
Babel fish
C
Joined: Jan 2005
Posts: 59
can any one help me with this question of what code would i use for a 24hour ban?

#107567 12/01/05 10:29 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
  • ban -u86400 # $nick 11


The numbers are seconds. smile

#107568 12/01/05 10:37 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
//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

#107569 12/01/05 10:49 PM
Joined: Jan 2005
Posts: 59
C
Babel fish
OP Offline
Babel fish
C
Joined: Jan 2005
Posts: 59
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

Code:
on @*:TEXT:*:#: {  

  if ($nick !isop #) {    

    var %i = 0    

    while (%i &lt; $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) ] ] &gt;= 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 smile thanks for all the help

#107570 12/01/05 11:21 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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 <--

Code:
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 &lt; $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) ] ] &gt;= 3)  {           
            ban -k $chan $nick 2 Banned for $duration($duration(24 hrs)) --&gt; $ifmatch &lt;--  
          }       
        }       
      }    
    }   
  }
}

#107571 12/01/05 11:45 PM
Joined: Jan 2005
Posts: 59
C
Babel fish
OP Offline
Babel fish
C
Joined: Jan 2005
Posts: 59
ok that code works but the alias thing dont this is what i wrote did i do it wrong
Code:
alias swear {
  return please put your swear words here seperated by a space like so [censored]
}

#107572 12/01/05 11:47 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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.

#107573 12/01/05 11:50 PM
Joined: Jan 2005
Posts: 59
C
Babel fish
OP Offline
Babel fish
C
Joined: Jan 2005
Posts: 59
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?

#107574 13/01/05 02:05 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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


Gone.
Page 1 of 2 1 2

Link Copied to Clipboard