This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

bigbadword tcl :P

Support & discussion of released scripts, and announcements of new releases.
Post Reply
C
Craig
Voice
Posts: 18
Joined: Wed Feb 22, 2006 2:18 pm

bigbadword tcl :P

Post by Craig »

hey. I need help. I've got something wrong in this script.. it says me "wrong args should be.. blablabla"

here is script:

Code: Select all

set triggerchar "!" 

### Thanks to ppslim for this filter ### 
proc swear:filter {str} { 
#   regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str 
   regsub -all -nocase {[^a-z,0-9@:/\s\|]} $str "" str 
   return $str 
} 
proc swear:filter2 {str} { 
#   regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str 
   regsub -all -nocase {[^a-z,0-9*?@:/\s\|]} $str "" str 
   return $str 
}

bind pubm - "* *" badword:pubm:check 

#####here starts the script###### 

####Procedure that puts a new line in the file of triggers for the channel where the trigger was written 
bind pub - !addwword badword:pub:add 

proc badword:pub:add { nick uhost handle chan arg } { 
	if { [isop $nick $chan] || [ishalfop $nick $chan] } { 
		set file "[string trimleft $chan #]_badwords.txt" 
		set write [open $file a] 
		set word [lindex $arg 0]
		set type [lindex $arg 1] 
		set reason [lindex $arg 2 end] 
		if { $type != "1" && $type != "2" && $type != "3" && $type != "4" && $type != "5" && $type != "6" } {
			puthelp "NOTICE $nick error: Invaild level type. Try with, 1, 2, 3, 11, 21 or 31."
			close $write
			return 0
		}
		if { $word == "" || $type == "" || $reason == "" } { 
			close $write 
			return 0 
		} 
		puts $write "$word#$reasonź$type" 
		close $write 
		putquick "NOTICE $nick :$word added to BadWord list for $chan with level $type." 
	} 
} 

bind pub - !addexcept badword:pub:except 
proc badword:pub:except { nick uhost handle chan arg } { 
   if { [isop $nick $chan] || [ishalfop $nick $chan] } { 
      set dsfile "excepts_[string trimleft $chan #]_badwords.txt" 
      set dswrite [open $dsfile a] 
      set dsword [swear:filter2 $arg] 
      puts $dswrite "$dsword#" 
      close $dswrite 
      putquick "NOTICE $nick : Slowo $dsword zostało dodane do listy złych słów kanału $chan." 
   } 
} 

####This procedure will be in charge of removing triggers for the chan where the command was written. 
bind pub - !remwword badword:pub:rem 

proc badword:pub:rem { nick uhost handle chan badword } { 
    if { $chan != "#emulsfgsfe-help" } { 
   if { [isop $nick $chan] || [ishalfop $nick $chan ] } { 
      set file [string trimleft $chan #]_badwords.txt 
      set tempfile emule-polish_badwords.bak 
      set readfirst [open $file r] 
      set linenumb 0 
      set count 0 
      putquick "NOTICE $nick :Start: Usuwanie złego słowa." 
      while { ![eof $readfirst] } { 
         gets $readfirst line 
         set helpwanted [string range $line 0 [expr [string first # $line]-1]] 
         if { $badword != $helpwanted } { 
            if { $linenumb==0 } { 
               set writetemp [open $tempfile w] 
               puts $writetemp $line 
               close $writetemp 
               incr linenumb 
            } else { 
               set writetemp [open $tempfile a] 
               puts $writetemp $line 
               close $writetemp 
               incr linenumb 
            } 
         } else { 
            incr count 
            putquick "NOTICE $nick :($count):!addbadword $helpwanted [string range $line [expr [string first # $line]+1] end]" 
         } 
      } 
      close $readfirst 
      set readfirst2 [open $tempfile r] 
      set linenumb2 0 
      while { ![eof $readfirst2] } { 
         gets $readfirst2 line 
         if { [string first # $line] != -1 } { 
            if { $linenumb2==0 } { 
               set writetemp [open $file w] 
               puts $writetemp $line 
               close $writetemp 
               incr linenumb2 
            } else { 
               set writetemp [open $file a] 
               puts $writetemp $line 
               close $writetemp 
            } 
         } 
      } 
      if { $linenumb2==0 } { 
         set writetemp [open $file w] 
         close $writetemp 
      }    
      close $readfirst2 
      putquick "NOTICE $nick :End: Usunięto złe słowo." 
   } 
    } 
}    
    

####Procedure that will get all the triggers from the file and present them to the user who asked for the list of possible commands for the chan. 
bind pub - !listwword badword:pub:list 

proc badword:pub:list { nick uhost handle chan badword } { 
    if { $chan != "#emule-fsgsdfhelp" } { 
   if { [isop $nick $chan] || [ishalfop $nick $chan ] } { 
      set read [open [string trimleft $chan #]_badwords.txt r] 
      set text "" 
      while { ![eof $read] } { 
         gets $read line 
         set text "$text [lindex [split $line #] 0]" 
      } 
      close $read 
      set finish [string range $text 1 [expr [string length $text]-2]] 
      set long [split $finish] 
      if { [llength $long] > 30 } { 
         for { set c 0} { $c<[llength $long] } { incr c 30 } { 
            if { $c==0 } { 
               putquick "NOTICE $nick : Złe słowa kanału $chan: 4[lrange $long $c [expr $c+29]]" 
            } else { 
               putquick "NOTICE $nick : 4[lrange $long $c [expr $c+29]]" 
            } 
         } 
      } else { 
         putquick "NOTICE $nick : Lista złych słów: 4$finish" 
      } 
   } 
    } 
}    
####Procedure that shows in the chan the text or the action associated with the trigger written in the channel 
proc badword:pubm:check {nick uhost handle chan arg} { 
	global triggerchar
	if { [isop $nick $chan] || [ishalfop $nick $chan] || [isvoice $nick $chan] } { 
		putlog "used isop/hop/vop"
		return 0 
	} 
	if {[string match "*@eMule-Polish.MindForge.org" $uhost]} { 
		 putlog "is hosted"
		 return 0 
	}
	if { ![file exists [string trimleft $chan #]_badwords.txt] } {
		return 0
	}
	set input "[swear:filter $arg]"
	set readbw [open [string trimleft $chan #]_badwords.txt r] 
	while { ![eof $readbw] } {  
	putlog "i do something"
	gets $readbw line 
	set helpwanted [string range $line 0 [expr [string first # $line]-1]] 
	set message [string range $line [expr [string first # $line]+1] [expr [string first ź $line]-1]] 
	set typeof  [string range $line [expr [string first ź $line]+1] end] 
	if { ([string match -nocase "* $helpwanted *" $input] == 1 && $helpwanted != "") || ([string match -nocase "$helpwanted" $input] == 1 && $helpwanted != "") } {
		if { $typeof == 4 || $typeof == 5 || $typeof == 6 } {
			BadWordKick $nick $uhost $chan $arg $helpwanted $message $typeof $input
			putlog "odeslalem"
			close $readbw
			return 0
		} else {
			if { [file exists excepts_[string trimleft $chan #]_badwords.txt] } {
				set read [open excepts_[string trimleft $chan #]_badwords.txt r]
				while { ![eof $read] } {  
					gets $read line 
					set searchword [string range $line 0 [expr [string first # $line]-1]]
					if { ([string match -nocase "* $searchword *" $input] == 1 && $searchword != "") || ([string match -nocase "$searchword" $input] == 1 && $searchword != "") } {
						return 0
					} else {
						BadWordKick $nick $uhost $chan $arg $helpwanted $message $typeof $input
						return 0
					}
				}
				close $read
			} else {
				BadWordKick $nick $uhost $chan $arg $helpwanted $message $typeof $input
				return 0
			}
		}
	}
	}
}

proc BadWordKick { nick uhost chan arg helpwanted message typeof input } {
	global BadwordWarn
        set whost *!*@[lindex [split $uhost "@"] end] 
            if {$typeof == 1} { 
               if {![info exists BadwordWarn($uhost)]} { 
                  putquick "PRIVMSG $chan : $nick No Warez : Na kanale obowiazuje zakaz podawania nazw gier, filmow, plikow objetych prawem autorskim." 
                  putquick "NOTICE $nick : $nick: Leż na #chat Jesli chcesz znalesc dany plik wejdz w emule/zakladka szukaj i wpisz jego nazwe. Nastepnie zaznacz ten ktory ma najwieksza dostepnosc zrodel (metoda szukania - serwer globalny badz kad)" 
                  set BadwordWarn($uhost) 1 
               } elseif {$BadwordWarn($uhost) == 1} { 
                  set BadwordWarn($uhost) 2 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
               } elseif {$BadwordWarn($uhost) == 2} { 
                  putquick "MODE $chan +b $whost" 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
                  unset BadwordWarn($uhost) 
               } 
            } elseif {$typeof == 2} { 
               if {![info exists BadwordWarn($uhost)]} { 
                  putquick "PRIVMSG $chan : $nick Wypierdalaj na #emule-polish-chat :PPP" 
                  putquick "NOTICE $nick : $nick: rozumiemy sie?!!" 
                  set BadwordWarn($uhost) 1 
               } elseif {$BadwordWarn($uhost) == 1} { 
                  set BadwordWarn($uhost) 2 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
               } elseif {$BadwordWarn($uhost) == 2} { 
                  putquick "MODE $chan +b $whost" 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
                  unset BadwordWarn($uhost) 
               } 
            } elseif {$typeof == 3} { 
               if {![info exists BadwordWarn($uhost)] || $BadwordWarn($uhost) == 1} {
                  putquick "KICK $chan $nick $message ($helpwanted) " 
		  set BadwordWarn($uhost) 2 
               } elseif {$BadwordWarn($uhost) == 2} { 
                  putquick "MODE $chan +b $whost" 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
                  unset BadwordWarn($uhost) 
                  } 
               } 
	      } elseif {$typeof == 4} {
	       if {![info exists BadwordWarn($uhost)]} { 
                  putquick "PRIVMSG $chan : $nick No Warez : Na kanale obowiazuje zakaz podawania nazw gier, filmow, plikow objetych prawem autorskim." 
                  putquick "NOTICE $nick : $nick: Leż na #chat Jesli chcesz znalesc dany plik wejdz w emule/zakladka szukaj i wpisz jego nazwe. Nastepnie zaznacz ten ktory ma najwieksza dostepnosc zrodel (metoda szukania - serwer globalny badz kad)" 
                  set BadwordWarn($uhost) 1 
               } elseif {$BadwordWarn($uhost) == 1} { 
                  set BadwordWarn($uhost) 2 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
               } elseif {$BadwordWarn($uhost) == 2} { 
                  putquick "MODE $chan +b $whost" 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
                  unset BadwordWarn($uhost) 
               } 
	      } elseif {$typeof == 5} {
	       if {![info exists BadwordWarn($uhost)]} { 
                  putquick "PRIVMSG $chan : $nick Wypierdalaj na #emule-polish-chat :PPP" 
                  putquick "NOTICE $nick : $nick: rozumiemy sie?!!" 
                  set BadwordWarn($uhost) 1 
               } elseif {$BadwordWarn($uhost) == 1} { 
                  set BadwordWarn($uhost) 2 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
               } elseif {$BadwordWarn($uhost) == 2} { 
                  putquick "MODE $chan +b $whost" 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
                  unset BadwordWarn($uhost) 
               }
	      } elseif {$typeof == 6} {
               if {![info exists BadwordWarn($uhost)] || $BadwordWarn($uhost) == 1} {
                  putquick "KICK $chan $nick $message ($helpwanted) " 
		  set BadwordWarn($uhost) 2 
               } elseif {$BadwordWarn($uhost) == 2} { 
                  putquick "MODE $chan +b $whost" 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
                  unset BadwordWarn($uhost) 
               }
}
can someone correct it for me ? THANKS ...
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Supply a proper errormessage first.
"wrong args should be.. blablabla"
Doesn't actually help anyone ;)
C
Craig
Voice
Posts: 18
Joined: Wed Feb 22, 2006 2:18 pm

Post by Craig »

[19:15] Tcl error in file 'eggdrop.conf':
[19:15] wrong # args: should be "proc name args body"
while executing
"proc BadWordKick { nick uhost chan arg helpwanted message typeof input } {
global BadwordWarn
set whost *!*@[lindex [split $uhost "@"] end]
..."
(file "scripts/boom.tcl" line 197)
invoked from within
"source scripts/boom.tcl"
(file "eggdrop.conf" line 187)
[19:15] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Basically, you close your proc-body too early with one } too many in your nested if-statements, while constructing the body of BadWordKick.

My guess is just above

Code: Select all

} elseif {$typeof == 4} {
Solution? Go through that proc, keep track of { and }, and make sure there's always atleast one more { than } until the end of the proc...
NML_375
C
Craig
Voice
Posts: 18
Joined: Wed Feb 22, 2006 2:18 pm

Post by Craig »

ok thanks and other

Code: Select all

set triggerchar "!" 

### Thanks to ppslim for this filter ### 
proc swear:filter {str} { 
#   regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str 
   regsub -all -nocase {[^a-z,0-9@:/\s\|]} $str "" str 
   return $str 
} 
proc swear:filter2 {str} { 
#   regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str 
   regsub -all -nocase {[^a-z,0-9*?@:/\s\|]} $str "" str 
   return $str 
}

bind pubm - "* *" badword:pubm:check 

#####here starts the script###### 

####Procedure that puts a new line in the file of triggers for the channel where the trigger was written 
bind pub - !badword pub:Badword

proc pub:Badword { nick uhost handle chan arg } { 
	set BadWordType [lindex $arg 0]
	putlog "$BadWordType"
	if { $BadWordType != "add" && $BadWordType != "del" && $BadWordType != "list" } {
		puthelp "NOTICE $nick : :error: Failed to edit trigger, use add, del or list. ex.: !badwords add *kurv* 6 ..."
		return 0
	}
	## if { $chan = "#eMule-Polish-Chat" && ![isop $nick $chan] } {
	##	puthelp "Notice $nick : Please, rehalfop/op yourself to edit BadWord list."
	##	return 0
	## }
	## if { $chan = "#eMule-Help" && ![ishalfop $nick $chan] && ![isop $nick $chan] } {
	##	puthelp "Notice $nick : Please, rehalfop/op yourself to edit BadWord list."
	##	return 0
	## }
	if { $BadWordType == "add" } {
		set file "[string trimleft $chan #]_badwords.txt" 
		set write [open $file a] 
		set word [lindex $arg 1]
		set type [lindex $arg 2]
		putlog "The word $word and the level $type. :D"
		set reason [lindex $arg 3 end] 
		if { $type != "1" && $type != "2" && $type != "3" && $type != "4" && $type != "5" && $type != "6" && $type != "7" && $type != "8" } {
			puthelp "NOTICE $nick error: Invaild level type. Try with, 1, 2, 3, 4, 5 or 6."
			close $write
			return 0
		}
		if { $word == "" || $type == "" || $reason == "" } {
			puthelp "NOTICE $nick Ooops? You lost something?!"
			close $write 
			return 0 
		} 
		puts $write "$word#$reasonź$type" 
		close $write 
		putserv "NOTICE $nick :$word should be added to BadWord list for $chan with level $type." 
		## The End of procedure			##
	} elseif { $BadWordType == "del" } {
	###################################################
	###################################################
		set file [string trimleft $chan #]_badwords.txt 
		set tempfile [string trimleft $chan #].badwords.bak 
		set readfirst [open $file r] 
		set linenumb 0 
		set count 0 
		set badword [lindex $arg 1]
		putquick "NOTICE $nick :Start: Removing badword from list." 
		while { ![eof $readfirst] } { 
			gets $readfirst line 
			set helpwanted [string range $line 0 [expr [string first # $line]-1]] 
			if { $badword != $helpwanted } { 
				if { $linenumb==0 } { 
					set writetemp [open $tempfile w] 
					puts $writetemp $line 
					close $writetemp 
					incr linenumb 
				} else { 
					set writetemp [open $tempfile a] 
					puts $writetemp $line 
					close $writetemp 
					incr linenumb 
				}
			} else {
				incr count 
				putquick "NOTICE $nick :($count):!addbadword $helpwanted [string range $line [expr [string first # $line]+1] end]" 
			} 
		}
		close $readfirst 
		set readfirst2 [open $tempfile r] 
		set linenumb2 0 
		while { ![eof $readfirst2] } { 
			gets $readfirst2 line 
			if { [string first # $line] != -1 } { 
				if { $linenumb2==0 } { 
					set writetemp [open $file w] 
					puts $writetemp $line 
					close $writetemp 
					incr linenumb2 
				} else { 
					set writetemp [open $file a] 
					puts $writetemp $line 
					close $writetemp 
				} 
			} 
		} 
		if { $linenumb2==0 } { 
			set writetemp [open $file w] 
			close $writetemp 
		}    
		close $readfirst2 
		putserv "NOTICE $nick :End: BadWord should be deleted." 




      #########################################################
      #########################################################
	} elseif { $BadWordType == "list" } {
		set read [open [string trimleft $chan #]_badwords.txt r]
		set text ""
		while { ![eof $read] } {
			gets $read line
			set text "$text [lindex [split $line #] 0]"
		}
		close $read
		set finish [string range $text 1 [expr [string length $text]-2]]
		set long [split $finish]
		if { [llength $long] > 30 } {
			for { set c 0} { $c<[llength $long] } { incr c 30 } {
				if { $c==0 } {
					putserv "Notice $nick : BadWord List: 4[lrange $long $c [expr $c+29]]"
				} else {
					putserv "NOTICE $nick : 4[lrange $long $c [expr $c+29]]"
				}
			}
		} else {
			putserv "NOTICE $nick :4$finish"
			puthelp "NOTICE $nick :End of BadWords. "
		}
	}
}



bind pub - !addexcept badword:pub:except 
proc badword:pub:except { nick uhost handle chan arg } { 
   if { [isop $nick $chan] || [ishalfop $nick $chan] } { 
      set dsfile "excepts_[string trimleft $chan #]_badwords.txt" 
      set dswrite [open $dsfile a] 
      set dsword [lindex $arg 0] 
      puts $dswrite "$dsword#" 
      close $dswrite 
      putquick "NOTICE $nick : Slowo $dsword zostało dodane do listy złych słów kanału $chan." 
   } 
} 

####Procedure that shows in the chan the text or the action associated with the trigger written in the channel 
proc badword:pubm:check {nick uhost handle chan arg} { 
	global triggerchar dontdoit
	## if { [isop $nick $chan] || [ishalfop $nick $chan] || [isvoice $nick $chan] } { 
	##	putlog "used isop/hop/vop"
	##	return 0 
	## } 
	if {[string match "*@eMule-Polish.MindForge.org" $uhost]} { 
		 putlog "is hosted"
		 return 0 
	}
	if { ![file exists [string trimleft $chan #]_badwords.txt] } {
		return 0
	}
	set input [swear:filter2 $arg]
	set readbw [open [string trimleft $chan #]_badwords.txt r] 
	while { ![eof $readbw] } {  
	putlog "i do something"
	gets $readbw line 
	set helpwanted [string range $line 0 [expr [string first # $line]-1]] 
	set message [string range $line [expr [string first # $line]+1] [expr [string first ź $line]-1]] 
	set typeof  [string range $line [expr [string first ź $line]+1] end] 
	if { ([string match -nocase "* $helpwanted *" $input] == 1 && $helpwanted != "") || ([string match -nocase "$helpwanted" $input] == 1 && $helpwanted != "") } {
		if { ![onchan eedupa #eMule-Help] && $typeof == 7 } { 
			BadWordKick $nick $uhost $chan $arg $helpwanted $message $typeof $input
			return 0
		}
		## if { ![onchan "[eMule]" #eMule-Polish] && $typeof == 6 } { 
		##	BadWordKick $nick $uhost $chan $arg $helpwanted $message $typeof $input
		##	return 0
		## }
		if { $typeof == 4 } {
			BadWordKick $nick $uhost $chan $arg $helpwanted $message $typeof $input
			return 0
		}
		if { $typeof == 3 || $typeof == 2 } {
			if { [file exists excepts_[string trimleft $chan #]_badwords.txt] } {
				set read [open excepts_[string trimleft $chan #]_badwords.txt r]
				while { ![eof $read] } {  
					gets $read line 
					set searchword [string range $line 0 [expr [string first # $line]-1]]
					if { ([string match -nocase "* $searchword *" $input] == 1 && $searchword != "") || ([string match -nocase "$searchword" $input] == 1 && $searchword != "") } {
						putlog "Szukam innego chaczy"
						
						return 0
					} else {
						BadWordKick $nick $uhost $chan $arg $helpwanted $message $typeof $input
						return 0
					}
				}
				close $read
			} else {
				BadWordKick $nick $uhost $chan $arg $helpwanted $message $typeof $input
				return 0
			}
		}


		if { $typeof == 8 } {
			BadWordKick $nick $uhost $chan $arg $helpwanted $message $typeof $input
			return 0
		}
		if { $typeof == 1 } {
			BadWordKick $nick $uhost $chan $arg $helpwanted $message $typeof $input
			return 0
		}
		if { $typeof == 5 } {
			BadWordKick $nick $uhost $chan $arg $helpwanted $message $typeof $input
			return 0
		}


	}
	}
}

proc next { nick uhost chan arg helpwanted message typeof input } {
		if { $typeof == 3 || $typeof == 2 } {
			if { [file exists excepts_[string trimleft $chan #]_badwords.txt] } {
				set read [open excepts_[string trimleft $chan #]_badwords.txt r]
				while { ![eof $read] } {  
					gets $read line 
					set searchword [string range $line 0 [expr [string first # $line]-1]]
					if { ([string match -nocase "* $searchword *" $input] == 1 && $searchword != "") || ([string match -nocase "$searchword" $input] == 1 && $searchword != "") } {
						putlog "Szukam innego chaczy"
						return 0
					} else {
						BadWordKick $nick $uhost $chan $arg $helpwanted $message $typeof $input
						return 0
					}
				}
				close $read
			} else {
				BadWordKick $nick $uhost $chan $arg $helpwanted $message $typeof $input
				return 0
			}
		}
		if { $typeof == 8 } {
			BadWordKick $nick $uhost $chan $arg $helpwanted $message $typeof $input
			return 0
		}
		if { $typeof == 1 } {
			BadWordKick $nick $uhost $chan $arg $helpwanted $message $typeof $input
			return 0
		}
		if { $typeof == 5 } {
			BadWordKick $nick $uhost $chan $arg $helpwanted $message $typeof $input
			return 0
		}
}


proc BadWordKick { nick uhost chan arg helpwanted message typeof input } {
	global BadwordWarn
        set whost *!*@[lindex [split $uhost "@"] end] 
            ##### ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #####
	    # 1. Warez bez wyjątków.//////
	    # 2. Offtopic z wyjątkiem.///////
	    # 3. Linki z wyjątkiem.-/+
	    # 4. Linki bez wyjątku.-......///////
	    # 5. Offtopic bez wyjątku.
	    # 6. W zastepwswie za [eMule]-.......////////
	    # 7. Za badx-.........//////
	    # 8. bejsbol-/////
	    #### ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #####
	    ###### Warez bez wyjaatkow
	    if {$typeof == 1} { 
               if {![info exists BadwordWarn($uhost)]} { 
                  putserv "PRIVMSG $chan : $nick NoWarez: Na kanale obowiazuje zakaz podawania nazw gier, filmow, plikow objetych prawem autorskim." 
                  putserv "NOTICE $nick : $nick: Jesli chcesz znalesc dany plik wejdz w emule\/zakladka szukaj i wpisz jego nazwe. Nastepnie zaznacz ten ktory ma najwieksza dostepnosc zrodel (metoda szukania - serwer globalny badz kad)"
		  putserv "NOTICE $nick : $nick: Możesz również wejśc na kanał ogólnotematyczny i tam poszukac odpowiedzi na twoje pytanie. Aby tam wejść wpisz: /join #eMule-Polish-chat Pamiętaj aby przez join nie stawiać spacji !"
                  set BadwordWarn($uhost) 1 
               } elseif {$BadwordWarn($uhost) == 1} { 
                  set BadwordWarn($uhost) 2 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
               } elseif {$BadwordWarn($uhost) == 2} { 
                  putquick "MODE $chan +b $whost" 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
                  unset BadwordWarn($uhost) 
               } 
            } elseif {$typeof == 2} { 
	    ###### Offtopic z wyjatkiem
               if {![info exists BadwordWarn($uhost)]} { 
                  putserv "PRIVMSG $chan : $nick kanał #eMule-Polish przeznaczony jest tylko do rozmów na temat eMule! Jeśli chcesz porozmawiać na inne tematy wejdź na -Chat." 
		  putserv "NOTICE $nick : $nick: Aby tam wejść wpisz: /join #eMule-Polish-Chat Pamiętaj aby między / nie stawiać żadnej spacji!"
                  set BadwordWarn($uhost) 1 
               } elseif {$BadwordWarn($uhost) == 1} { 
                  set BadwordWarn($uhost) 2 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
               } elseif {$BadwordWarn($uhost) == 2} { 
                  putquick "MODE $chan +b $whost" 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
                  unset BadwordWarn($uhost) 
               } 
            } elseif {$typeof == 3} { 
	    ###### Linki z wyjatkiem
               if {![info exists BadwordWarn($uhost)] || $BadwordWarn($uhost) == 1} {
                  putquick "KICK $chan $nick $message ($helpwanted) " 
		  set BadwordWarn($uhost) 2 
               } elseif {$BadwordWarn($uhost) == 2} { 
                  putquick "MODE $chan +b $whost" 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
                  unset BadwordWarn($uhost) 
             } 
	      } elseif {$typeof == 4} {
	      ##### Linki bez wyjatku (ftp)
               if {![info exists BadwordWarn($uhost)] || $BadwordWarn($uhost) == 1} {
                  putquick "KICK $chan $nick $message ($helpwanted) " 
		  set BadwordWarn($uhost) 2 
               } elseif {$BadwordWarn($uhost) == 2} { 
                  putquick "MODE $chan +b $whost" 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
                  unset BadwordWarn($uhost) 
             } 
	      } elseif {$typeof == 5} {
	      ##### Offtopic bez wyjatku
               if {![info exists BadwordWarn($uhost)]} { 
                  putserv "PRIVMSG $chan : $nick kanał #eMule-Polish przeznaczony jest tylko do rozmów na temat eMule! Jeśli chcesz porozmawiać na inne tematy wejdź na -Chat." 
		  putserv "NOTICE $nick : $nick: Aby tam wejść wpisz: /join #eMule-Polish-Chat Pamiętaj aby między / nie stawiać żadnej spacji!"
                  set BadwordWarn($uhost) 1 
               } elseif {$BadwordWarn($uhost) == 1} { 
                  set BadwordWarn($uhost) 2 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
               } elseif {$BadwordWarn($uhost) == 2} { 
                  putquick "MODE $chan +b $whost" 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
                  unset BadwordWarn($uhost) 
               } 
	      } elseif {$typeof == 6} {
	      #### w zastepstwie za [emule]
               if {![info exists BadwordWarn($uhost)] || $BadwordWarn($uhost) == 1} {
                  putquick "KICK $chan $nick $message ($helpwanted) " 
		  set BadwordWarn($uhost) 2 
               } elseif {$BadwordWarn($uhost) == 2} { 
                  putquick "MODE $chan +b $whost" 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
                  unset BadwordWarn($uhost) 
             } 
	       } elseif {$typeof == 7} {
	       #### w zastepstwie za badx
               if {![info exists BadwordWarn($uhost)] || $BadwordWarn($uhost) == 1} {
                  putquick "KICK $chan $nick $message ($helpwanted) " 
		  set BadwordWarn($uhost) 2 
               } elseif {$BadwordWarn($uhost) == 2} { 
                  putquick "MODE $chan +b $whost" 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
                  unset BadwordWarn($uhost) 
             }

	      } elseif {$typeof == 8} {
	      ####bejsbol
	        if {![info exists BadwordWarn($uhost)]} { 
                  putserv "PRIVMSG $chan : $nick Nie wolno tu walić bejsbolem!" 
		  putserv "NOTICE $nick : $nick: Aby tam wejść wpisz: /join #eMule-Polish-Chat Pamiętaj aby między / nie stawiać żadnej spacji!"
                  set BadwordWarn($uhost) 1 
               } elseif {$BadwordWarn($uhost) == 1} { 
                  set BadwordWarn($uhost) 2 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
               } elseif {$BadwordWarn($uhost) == 2} { 
                  putquick "MODE $chan +b $whost" 
                  putquick "KICK $chan $nick $message ($helpwanted) " 
                  unset BadwordWarn($uhost) 
               } 
	       }

}
in pubm:check betwen if $typeof == 2 | 3 .. }
how to do it compare found badword with except list?
Like in badword list is added *http://*
In except list *lol*
Someone says: blabla bla http://lol/ bla bla http://sss/

it compare http://lol/ with except list, if except word was in that then it search for another badwords,
it found http://sss/ and comparing, it was not excepted, then go to BadWordKick blabla
search for other badwords with typeof 2 3, no one found then search for typeof 8 1 5

if you dont understand just say i will try to explain it other method -.-
Post Reply