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.

!ignore <nick> script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
i
iNFERNiS
Voice
Posts: 13
Joined: Tue Aug 21, 2007 11:03 am

!ignore <nick> script

Post by iNFERNiS »

As the topic says.

!ignore <nick> makes the bot ignore that person.
!unignore <nick> removes it.

Anyone? :)
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Not tested this or anything, but pretty sure it will work.

Code: Select all

proc pub:cmdignore {nick host handle channel text} {
 if {$text == ""} {return 0}
  set target [lindex [split $text] 0]
   set time [lindex [split $text] 1]
    set reason [join [lrange [split $text] 2 end]]
     if {![string match {[0-9]*} $time]} {set it "15m"} else {set it "$time"}
      if {$reason == ""} {set ir "Requested By $nick on [join [ctime [unixtime]]]."} else {set ir "$reason Set By $nick on [join [ctime [unixtime]]]."}
       if {![string match *!*@* $target] && ![onchan $target]} {
        putserv "PRIVMSG $channel :invalid target; no such nickname/hostmask."
         return 0
        }
         if {[onchan $target]} {set im "*!*@[lindex [split [getchanhost $target] @] 1]"} else {"set im $target"}
          newignore $im $handle "$ir" $it
           putserv "PRIVMSG $channel :$nick, now ignoring $im for $it minutes."
            return 1
}

proc pub:cmdunignore {nick host handle channel text} {
 if {$text == ""} {return 0}
  set imask [lindex [split $text] 0]
   if {![isignore $imask]} {putserv "PRIVMSG $channel :invalid ignore $imask."; return 0}
    if {[killignore $imask]} {
     putserv "PRIVMSG $channel :$nick, no longer ingoring $imask."
      return 1
    } else {
     putserv "PRIVMSG $channel :failed, ignore $imask must be removed manually."
      return 0
    }
}
Syntax: ignore [nick | mask] <time> <reason>
Syntax: unignore [mask]
User avatar
ultralord
Master
Posts: 255
Joined: Mon Nov 06, 2006 6:52 pm

Post by ultralord »

[10:34:15] <Ultralord> !ignore roza 600 vlakas
[10:34:16] <Botnick> invalid ignore roza.

why he said that?


thnx
User avatar
iamdeath
Master
Posts: 323
Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:

Post by iamdeath »

Code: Select all

bind pub - !ignore pub:cmdignore
bind pub - !unignore pub:cmdunignore

proc pub:cmdignore {nick host handle channel text} { 
 if {$text == ""} {return 0} 
  set target [lindex [split $text] 0] 
   set time [lindex [split $text] 1] 
    set reason [join [lrange [split $text] 2 end]] 
     if {![string match {[0-9]*} $time]} {set it "15m"} else {set it "$time"} 
      if {$reason == ""} {set ir "Requested By $nick on [join [ctime [unixtime]]]."} else {set ir "$reason Set By $nick on [join [ctime [unixtime]]]."} 
       if {![string match *!*@* $target] && ![onchan $target]} { 
        putserv "PRIVMSG $channel :invalid target; no such nickname/hostmask." 
         return 0 
        } 
         if {[onchan $target]} {set im "$target!*@*"} else {"set im $target"} 
          newignore $im $handle "$ir" $it 
           putserv "PRIVMSG $channel :$nick, now ignoring $im for $it minutes." 
            return 1 
} 

proc pub:cmdunignore {nick host handle channel text} { 
 if {$text == ""} {return 0} 
  set imask [lindex [split $text] 0] 
   if {![isignore $imask]} {putserv "PRIVMSG $channel :invalid ignore $imask."; return 0} 
    if {[killignore $imask]} { 
     putserv "PRIVMSG $channel :$nick, no longer ingoring $imask." 
      return 1 
    } else { 
     putserv "PRIVMSG $channel :failed, ignore $imask must be removed manually." 
      return 0 
    } 
}
I think it should work, I guess bind was not added that is why it was'nt working properly so give it a try, credit still goes to the author.

Thanks.

Edit: Will ignore nick!*@* now.
Last edited by iamdeath on Thu Oct 11, 2007 5:59 am, edited 1 time in total.
|AmDeAtH @ Undernet
Death is only the *Beginning*...
User avatar
ultralord
Master
Posts: 255
Joined: Mon Nov 06, 2006 6:52 pm

Post by ultralord »

it is ipossible to ignore only the nick!*@* ?
User avatar
iamdeath
Master
Posts: 323
Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:

Post by iamdeath »

Try now, should work
|AmDeAtH @ Undernet
Death is only the *Beginning*...
User avatar
ultralord
Master
Posts: 255
Joined: Mon Nov 06, 2006 6:52 pm

Post by ultralord »

thnx a lot.

but one problem when i press !unignore


[13:20:24] -> Ops #noobwars: !unignore WaReN
[13:20:26] <Botnick> invalid ignore WaReN.

13:20:24] -> Ops #noobwars: !unignore WaReN!*@*
[13:20:26] <Botnick> invalid ignore WaReN!*@*

[ 1] WaReN!*@* (expires at 05:24)
[13:20:43] <(Botnick> Ultralord: test Set By Ultralord on Thu Oct 11 05:20:10 2007.
User avatar
iamdeath
Master
Posts: 323
Joined: Fri Feb 11, 2005 2:32 pm
Location: *HeLL*
Contact:

Post by iamdeath »

Well from my point of view it should work fine, what the best you can do is, take a list of .ignores from DCC and then try to !unignore *!*@host here see if it removes or not.
|AmDeAtH @ Undernet
Death is only the *Beginning*...
User avatar
ultralord
Master
Posts: 255
Joined: Mon Nov 06, 2006 6:52 pm

Post by ultralord »

its ok ty
i
iNFERNiS
Voice
Posts: 13
Joined: Tue Aug 21, 2007 11:03 am

Post by iNFERNiS »

sweet, thanks guys :D

edit: works pretty good so far. Would it be possible to ignore ident + hostmask? ignoring nick alone is kind of useless since the person can just change their nick. I tried defining adresses to ignore but doesn't seem to take it.


[17:32:44] [@iNFERNiS] !ignore TheVirus!thevirus@thevir.us 5 test
[17:31] Tcl error [pub:cmdignore]: invalid command name "set im TheVirus!thevirus@thevir.us"

[17:32:57] [@iNFERNiS] !ignore thevirus@thevir.us 5 test
[17:32:58] [@ef'LSGIRL] invalid target; no such nickname/hostmask.
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Find where is says
if {[onchan $target]} {set im "$target!*@*"} else {"set im $target"}
and change it to

Code: Select all

if {[onchan $target]} {set im "$target!*@*"} else {set im "$target"}
. Should work now :)
i
iNFERNiS
Voice
Posts: 13
Joined: Tue Aug 21, 2007 11:03 am

Post by iNFERNiS »

Works great, thanks again :)
J
John_Maclain
Voice
Posts: 23
Joined: Fri Apr 07, 2006 2:06 pm
Location: England
Contact:

Post by John_Maclain »

Could tis be adapted to be like a "quiet" script..

Lets say different tcl's are being generaly abused or are not needed at the moment.

Have a !silence #chan to make the bot ignore all channel commands for all scripts in that room - automatically removed after say 30 mins, or if a room op types !unsilence #chan

I should really learn some tcl :-)
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Yep, its possible to i think. However, i think it might cause problems with the bot. not to mention theres alot of problems with binds not doing channel specific stuff, they do it on all the bots channel and use an enable channel setting or list. Maybe just skiping the unbind'ing of and stuff like that and using a channel option to do like +quiet and nothing can happen on the channel set +quiet. You could just add something like

Code: Select all

setudef flag quiet
to eggdrop config file. And then in every script check that channel isn't set +quiet with

Code: Select all

if {[channel get $channel quiet] > 0} {return 0}
or if you use MC More Tools (which am more sure of with the working thing) you can use

Code: Select all

if {[chanflag $channel quiet]} {return 0}
# chanflag <channel> <flag>
# version:
# v3.1
# information (mc.moretools command):
# Check to see if <flag> is enabled or disabled for <channel>. The 'get'
# option for the 'channel' command, provided by eggdrop in version 1.6.11,
# does the same as this command. Because of that, this command will try
# and query 'channel' command first (is faster); if it receives an error
# then it will proceed with my code. <flag> includes custom setudef flags
# as well as the standard ones provided by eggdrop.
# dependencies (other than eggdrop provided commands):
# The 'badargs' command from mc.moretools.
# The 'unlist' command from mc.moretools.
# examples:
# chanflag #abc123 protectops => 0
# chanflag #abc123 mc.spamcheck => 1
# credit:
# returns:
# - 0 if disabled or invalid <flag>.
# - 1 if enabled.
Something along that lines would be alot easyer i think, and it would probably prevent problems with unbind'ing of things done via a script.
:) hope it helps.
d
dani
Voice
Posts: 5
Joined: Fri Jun 18, 2010 11:45 am

Post by dani »

work fine!!! but i need a simple functions.. and i dont know how..

1. only ops use this command
2. ignore permanent, with out $time (third possibility)

3. can ignore a nick for a part? ex. amigo_***
where * is anything.

please help me and thanks mates. :)
Sorry, my english is poor.
Post Reply