egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

!ignore <nick> script
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
iNFERNiS
Voice


Joined: 21 Aug 2007
Posts: 13

PostPosted: Sun Oct 07, 2007 3:52 pm    Post subject: !ignore <nick> script Reply with quote

As the topic says.

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

Anyone? Smile
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Thu Oct 11, 2007 2:39 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
ultralord
Master


Joined: 06 Nov 2006
Posts: 255

PostPosted: Thu Oct 11, 2007 3:34 am    Post subject: Reply with quote

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

why he said that?


thnx
Back to top
View user's profile Send private message
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Thu Oct 11, 2007 3:50 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
ultralord
Master


Joined: 06 Nov 2006
Posts: 255

PostPosted: Thu Oct 11, 2007 5:51 am    Post subject: Reply with quote

it is ipossible to ignore only the nick!*@* ?
Back to top
View user's profile Send private message
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Thu Oct 11, 2007 5:59 am    Post subject: Reply with quote

Try now, should work
_________________
|AmDeAtH @ Undernet


Death is only the *Beginning*...
Back to top
View user's profile Send private message Visit poster's website
ultralord
Master


Joined: 06 Nov 2006
Posts: 255

PostPosted: Thu Oct 11, 2007 6:16 am    Post subject: Reply with quote

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
View user's profile Send private message
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Thu Oct 11, 2007 8:17 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
ultralord
Master


Joined: 06 Nov 2006
Posts: 255

PostPosted: Thu Oct 11, 2007 8:37 am    Post subject: Reply with quote

its ok ty
Back to top
View user's profile Send private message
iNFERNiS
Voice


Joined: 21 Aug 2007
Posts: 13

PostPosted: Thu Oct 11, 2007 11:12 am    Post subject: Reply with quote

sweet, thanks guys Very Happy

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
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Thu Oct 11, 2007 1:46 pm    Post subject: Reply with quote

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 Smile
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
iNFERNiS
Voice


Joined: 21 Aug 2007
Posts: 13

PostPosted: Fri Oct 12, 2007 1:05 pm    Post subject: Reply with quote

Works great, thanks again Smile
Back to top
View user's profile Send private message
John_Maclain
Voice


Joined: 07 Apr 2006
Posts: 23
Location: England

PostPosted: Mon Oct 15, 2007 11:29 am    Post subject: Reply with quote

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 Smile
_________________
http://www.morphies.net
Back to top
View user's profile Send private message Visit poster's website
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Tue Oct 16, 2007 3:37 am    Post subject: Reply with quote

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:
setudef flag quiet
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.
Smile hope it helps.
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
dani
Voice


Joined: 18 Jun 2010
Posts: 5

PostPosted: Fri Jun 18, 2010 11:48 am    Post subject: Reply with quote

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. Smile
_________________
Sorry, my english is poor.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber