| View previous topic :: View next topic |
| Author |
Message |
iNFERNiS Voice
Joined: 21 Aug 2007 Posts: 13
|
Posted: Sun Oct 07, 2007 3:52 pm Post subject: !ignore <nick> script |
|
|
As the topic says.
!ignore <nick> makes the bot ignore that person.
!unignore <nick> removes it.
Anyone?  |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Thu Oct 11, 2007 2:39 am Post subject: |
|
|
Not tested this or anything, but pretty sure it will work. | Code: | 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] _________________ TCL the misunderstood |
|
| Back to top |
|
 |
ultralord Master

Joined: 06 Nov 2006 Posts: 255
|
Posted: Thu Oct 11, 2007 3:34 am Post subject: |
|
|
[10:34:15] <Ultralord> !ignore roza 600 vlakas
[10:34:16] <Botnick> invalid ignore roza.
why he said that?
thnx |
|
| Back to top |
|
 |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Thu Oct 11, 2007 3:50 am Post subject: |
|
|
| Code: | 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. _________________ |AmDeAtH @ Undernet
Death is only the *Beginning*...
Last edited by iamdeath on Thu Oct 11, 2007 5:59 am; edited 1 time in total |
|
| Back to top |
|
 |
ultralord Master

Joined: 06 Nov 2006 Posts: 255
|
Posted: Thu Oct 11, 2007 5:51 am Post subject: |
|
|
| it is ipossible to ignore only the nick!*@* ? |
|
| Back to top |
|
 |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Thu Oct 11, 2007 5:59 am Post subject: |
|
|
Try now, should work _________________ |AmDeAtH @ Undernet
Death is only the *Beginning*... |
|
| Back to top |
|
 |
ultralord Master

Joined: 06 Nov 2006 Posts: 255
|
Posted: Thu Oct 11, 2007 6:16 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Thu Oct 11, 2007 8:17 am Post subject: |
|
|
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*... |
|
| Back to top |
|
 |
ultralord Master

Joined: 06 Nov 2006 Posts: 255
|
Posted: Thu Oct 11, 2007 8:37 am Post subject: |
|
|
| its ok ty |
|
| Back to top |
|
 |
iNFERNiS Voice
Joined: 21 Aug 2007 Posts: 13
|
Posted: Thu Oct 11, 2007 11:12 am Post subject: |
|
|
sweet, thanks guys
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. |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Thu Oct 11, 2007 1:46 pm Post subject: |
|
|
Find where is says | Quote: | | if {[onchan $target]} {set im "$target!*@*"} else {"set im $target"} | and change it to | Code: | | if {[onchan $target]} {set im "$target!*@*"} else {set im "$target"} | . Should work now  _________________ TCL the misunderstood |
|
| Back to top |
|
 |
iNFERNiS Voice
Joined: 21 Aug 2007 Posts: 13
|
Posted: Fri Oct 12, 2007 1:05 pm Post subject: |
|
|
Works great, thanks again  |
|
| Back to top |
|
 |
John_Maclain Voice
Joined: 07 Apr 2006 Posts: 23 Location: England
|
Posted: Mon Oct 15, 2007 11:29 am Post subject: |
|
|
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  _________________ http://www.morphies.net |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Tue Oct 16, 2007 3:37 am Post subject: |
|
|
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 to eggdrop config file. And then in every script check that channel isn't set +quiet with | Code: | | 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: | | if {[chanflag $channel quiet]} {return 0} | | Quote: | # 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. _________________ TCL the misunderstood |
|
| Back to top |
|
 |
dani Voice
Joined: 18 Jun 2010 Posts: 5
|
Posted: Fri Jun 18, 2010 11:48 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
|