mIRC Home    About    Download    Register    News    Help

Print Thread
#158942 11/09/06 03:35 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Can the bad name list be save on file like hash so that I can add more bad names and it wont ban if there more then one word on that line.
exemp: your [censored]
exemp: [censored]

raw 311:*: {
if (%name != off) && ($nick !isop #) {
var %bad.name = gay [censored] [censored] bastard biatch bitch blowjob cock cunt dick [censored] fucker horny orgasm
var %a = 1, %b = $numtok(%bad.name,32)
while %a <= %b {
if $istok($6-,$gettok(%bad.name,%a,32),32) { ban -ku60 #chat-room $2 2 14Unacceptable IrcName Detected }
%a = %b
inc %a
}
return $regsubex($1-,/\b( $+ %name $+ )\b/gi,$str(*,$len(\t)))
}
halt
}

#158943 11/09/06 10:47 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
This is as close as I was able to get to your request. You will have to use one of the two options for setting the bad names for the names that you already have, as I didn't include code to automatically use the %bad.name variable as you currently have it.

Any questions about the code, please be specific about what part, and I'll do my best to explain.
Code:
 raw 311:*: {
  if (%name != off) &amp;&amp; ($nick !isop #) {
  ; the next line is from your post, and has been remarked simply because it's not necessary in the new code.
    ;    var %bad.name = gay [censored] [censored] bastard biatch bitch blowjob cock cunt dick [censored] fucker horny orgasm
    var %a = 1, %b = $hget(bad.name,0).item
    while %a &lt;= %b {
      var %bad.name = $hget(bad.name,%a)
      if $istok($6-,%bad.name,32) { ban -ku60 #chat-room $2 2 14Unacceptable IrcName Detected }
      %a = %b
      inc %a
    }
    return $regsubex($1-,/\b( $+ %name $+ )\b/gi,$str(*,$len(\t)))
  }
  halt
} 
on *:start:{
;checks if hash table exists, and if it doesn't creates it
  if !$hget(bad.name) { .hmake bad.name 10 }
; checks if file containing hash items when not connected exists, and if it does, loads it into the hash table
  if $exists(bad.name.hsh) { .hload bad.name bad.name.hsh }
}
on *:exit:{
;saves the hash table overwriting the previous file if it exists
  .hsave -o bad.name bad.name.hsh
}
on *:disconnect:{
;saves the hash table overwriting the previous file if it exists
  .hsave -o bad.name bad.name.hsh
}
on *:op:#:{
; set userlevel of op to ops for command access restriction
  .auser -a op $opnick
}
on *:serverop:#:{
; set userlevel of op to ops for command access restriction
  .auser -a op $opnick
}
on op:nick:{
;switch nicks if an op changes their nick
  .ruser op $nick
  .auser -a op $newnick
}
;if an op leaves, remove op user level
on op:part:#:{
  .ruser op $nick
}
on *:kick:#:{
  .ruser op $knick
}
on op:quit:{
  .ruser op $nick
}
;remote access available to ops that are in the channel, although the command can be sent via pm
on op:text:!bad*:*:{
  bad.name $2
}

;direct access
menu * {
  Bad Name : bad.name $$?="Enter name to add or remove"
}
alias bad.name {
  if !$1 { .notice $nick No name specified }
  elseif $hfind(bad.name,$1,0) {
    .hdel bad.name $1
  }
  else .hadd -m bad.name $1 $1
}
 


I tried to remark changes and what they do, but I don't know if I got everything that you may not understand.

#158944 12/09/06 12:57 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
wow cool!!
Also its not kicking :P

raw 311:*: {
if (%name != off) && ($nick !isop #) {
var %a = 1, %b = $hget(bad.name,0).item
while %a <= %b {
var %bad.name = $hget(bad.name,%a)
if $istok($6-,%bad.name,32) { ban -ku60 #chat $2 2 14Unacceptable IrcName Detected }
%a = %b
inc %a
}
return $regsubex($1-,/\b( $+ %name $+ )\b/gi,$str(*,$len(\t)))
}
halt
}
on *:start:{
if !$hget(bad.name) { .hmake bad.name 10 }
if $exists(bad.name.hsh) { .hload bad.name bad.name.hsh }
}
on *:exit:{
.hsave -o bad.name bad.name.hsh
}
on *:disconnect:{
.hsave -o bad.name bad.name.hsh
}

menu * {
-
Add Bad Name : bad.name $$?="Enter name to add or remove"
}
alias bad.name {
if !$1 { .notice $nick No name specified }
elseif $hfind(bad.name,$1,0) {
.hdel bad.name $1
}
else .hadd -m bad.name $1 $1
}

this is wat I have now???

Last edited by Garou; 12/09/06 02:26 AM.
#158945 12/09/06 02:40 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
OK...once change necessary.
Change: var %bad.name = $hget(bad.name,%a)
To: var %bad.name = $hget(bad.name,%a).item

With that change, it should work properly.

If not, then ensure that the names are going into the hash table correctly. You can do this easily, by exiting mIRC or disconnecting from the network, then viewing the file bad.name.hsh which will be in the mIRC directory. This file is in standard text format, so any word processor (eg: notepad, wordpad, Microsoft Word, Word Perfect, etc.) will read it.

#158946 12/09/06 02:45 AM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Yes the hash file is fine but it still dont kick ??

#158947 12/09/06 10:43 PM
Joined: Aug 2006
Posts: 469
G
Garou Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Aug 2006
Posts: 469
Can anyone please fix this when you have time?


Link Copied to Clipboard