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!
S
SIrJoKer
Voice
Posts: 7
Joined: Thu Aug 06, 2009 2:50 pm

Post by SIrJoKer »

Nice work guys !
L
Luminous
Op
Posts: 146
Joined: Fri Feb 12, 2010 1:00 pm

Post by Luminous »

dani wrote: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. :)
1.) the lines where it says:

Code: Select all

bind pub - !ignore pub:cmdignore
bind pub - !unignore pub:cmdunignore 
change that "-" to |o or o|o if you also want to allows those with global o flag to use the script.

2.) To make the ignore permanent, remove these lines:

Code: Select all

if {![string match {[0-9]*} $time]} {set it "15m"} else {set it "$time"}
set time [lindex [split $text] 1] 


and change:

Code: Select all

newignore $im $handle "$ir" $it
to

Code: Select all

newignore $im $handle "$ir" 0
and replace:

Code: Select all

set reason [join [lrange [split $text] 2 end]]
with:

Code: Select all

set reason [join [lrange [split $text] 1 end]] 
As for question 3... I need a bit more info. it sounds to me like you want to turn nicks like amiigo_ into *amigo*!*. To do this, you'll need a string trim or regsub to trim away chars others than what you want, like:

Code: Select all

set inick [regsub -all -- {[^a-z0-9]} $target ""]
This would remove all characters except for a-z and 0-9.

Then, you would need to change:

Code: Select all

if {[onchan $target]} {set im "$target!*@*"} else {"set im $target"}
to

Code: Select all

if {[onchan $target]} {set im "*$inick*!*@*"} else {"set im $target"}
.

I think that's what you want...
d
dani
Voice
Posts: 5
Joined: Fri Jun 18, 2010 11:45 am

Post by dani »

Luminous are u the best!! mate! 1 & 2 is perfect

As for question 3.. is like this: amigo_123 or amigo_can or amigo_was

_*** = anything the user wants

4. can i get a list of ignores nicks? how? public o priv..

Thank u very much! :D
Sorry, my english is poor.
L
Luminous
Op
Posts: 146
Joined: Fri Feb 12, 2010 1:00 pm

Post by Luminous »

Okay, I made a few tweaks regarding how nicks are set. This -should- catch nicks like amigo_blah and just turn it into *amigo*!*, but I made it so that it will first attempt to ignore via their hostmask if they are on channel. If they are not, it uses the modified version of this nick.

I also added the ignorelist too. Syntax is !ignorelist.

I went ahead and wrote the whole thing out as one script. Ignorelist is at the end. :) I fancied up the output of it for you some. Hope it works as planned, I wasn't able to test all of this in full, aside from the ignorelist.

Code: Select all

bind pub o|o !ignore pub:cmdignore
bind pub o|o !unignore pub:cmdunignore 
bind pub o|o !listignores listignores

proc pub:cmdignore {nick uhost handle channel text} {
 if {$text == ""} {return 0}
  if {[regexp -nocase -- {^[-_./\\]+?([a-z0-9]+)[-_./\\]+$} [lindex [split $text] 0] a b} {
 set target *$b*!*@*
  } else {
  set target [join [lindex [split $text] 0]]
   }
  set reason [join [lrange [split $text] 1 end]]
 set host [lindex [split [getchanhost $target $chan] @] 1]
        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 "*!*@*.[join [lrange [split $host .] end-2 end] .]"} else {"set im $target"}
          newignore $im $handle "$ir" 0
           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
    }
}

proc listignores {nick host hand chan text} {
 set ilist [ignorelist]
    if {![llength $ilist]} {
    putserv "NOTICE $nick :I am not currently ignoring anyone."
 return 0
    }
 set inum 0
    foreach i $ilist {
 set mask [join [lindex $i 0]]
 set reason [join [lindex $i 1]]
 set begin [join [clock format [lindex $i 3] -format %D-%T]]
 set end [join [clock format [lindex $i 2] -format %D-%T]]
        puthelp "NOTICE $nick :[incr inum]: \"$mask\" - Set at: $begin by [lindex $i end] for reason \"$reason\" - Ends at: $end"
    }
}
R
RowdyOne
Voice
Posts: 3
Joined: Mon Aug 24, 2009 2:38 am

Post by RowdyOne »

Using a botnet relay to connect this across 5 different networks. Using CrazyCat Chanrelay 3.0

Is this adaptable to work across the relay without a major rewrite?

Thank you in advance.

Rowdyone
J
Jahner
Voice
Posts: 1
Joined: Fri Feb 18, 2011 1:31 pm

Post by Jahner »

I created the ignore.tcl using the code Luminous created and am running eggdrop 1.6.20 and tcl 8.5.9

When I run !ignore user I receive this error:

Tcl error [pub:cmdignore: missing close-bracket
in expression "[regexp -nocase -- {^[-..."

Any thoughts or ideas? !unignore and !listignores work fine.

Any help is greatly appreciated
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

That's because only the ignore uses the regexp. Just replace:

Code: Select all

if {[regexp -nocase -- {^[-_./\\]+?([a-z0-9]+)[-_./\\]+$} [lindex [split $text] 0] a b}
with:

Code: Select all

if {[regexp -nocase -- {^[-_./\\]+?([a-z0-9]+)[-_./\\]+$} [lindex [split $text] 0] a b]}
notice the ']' after 'b'.
Once the game is over, the king and the pawn go back in the same box.
Post Reply