| View previous topic :: View next topic |
| Author |
Message |
SIrJoKer Voice
Joined: 06 Aug 2009 Posts: 7
|
Posted: Sun Jun 20, 2010 10:26 am Post subject: |
|
|
| Nice work guys ! |
|
| Back to top |
|
 |
Luminous Op
Joined: 12 Feb 2010 Posts: 146
|
Posted: Tue Aug 03, 2010 10:09 pm Post subject: |
|
|
| 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: | 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: | if {![string match {[0-9]*} $time]} {set it "15m"} else {set it "$time"}
set time [lindex [split $text] 1] |
and change: | Code: | | newignore $im $handle "$ir" $it | to | Code: | | newignore $im $handle "$ir" 0 | and replace: | Code: | | set reason [join [lrange [split $text] 2 end]] | with: | Code: | | 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: | | 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: | | if {[onchan $target]} {set im "$target!*@*"} else {"set im $target"} | to | Code: | | if {[onchan $target]} {set im "*$inick*!*@*"} else {"set im $target"} | .
I think that's what you want... |
|
| Back to top |
|
 |
dani Voice
Joined: 18 Jun 2010 Posts: 5
|
Posted: Fri Aug 13, 2010 9:50 am Post subject: |
|
|
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!  _________________ Sorry, my english is poor. |
|
| Back to top |
|
 |
Luminous Op
Joined: 12 Feb 2010 Posts: 146
|
Posted: Fri Aug 13, 2010 10:55 am Post subject: |
|
|
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: | 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"
}
}
|
|
|
| Back to top |
|
 |
RowdyOne Voice
Joined: 24 Aug 2009 Posts: 3
|
Posted: Fri Jan 21, 2011 10:26 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Jahner Voice
Joined: 18 Feb 2011 Posts: 1
|
Posted: Fri Feb 18, 2011 1:45 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sat Feb 19, 2011 4:17 am Post subject: |
|
|
That's because only the ignore uses the regexp. Just replace:
| Code: |
if {[regexp -nocase -- {^[-_./\\]+?([a-z0-9]+)[-_./\\]+$} [lindex [split $text] 0] a b}
|
with:
| Code: |
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. |
|
| Back to top |
|
 |
|