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.

raw notice

Old posts that have not been replied to for several years.
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

raw notice

Post by ReaLz »

is it possible to <<filter>> the notices from X?
I want it not to show in the partyline these notices:
-X (cservice@undernet.org)- Specified ban is already in my banlist!
and don't tell me anything like console flags to avoid seeing notices at all :P
«A fantastic spaghetti is a spaghetti that does not exist»
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

.+user X X!cservice@undernet.org
.chattr X +X

then a bit of code:

Code: Select all

bind raw X NOTICE xnotc
proc xnotc {f k a} {
    expr {[string first "Specified ban is already in my banlist!" $a]>-1}
}
...Or could of course skip the adding and make the bind for - instead of X and do if {[string eq $f "X!cservice@undernet.org"]} {return 0} before the expr.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

user wrote: ...Or could of course skip the adding and make the bind for - instead of X and do if {[string eq $f "X!cservice@undernet.org"]} {return 0} before the expr.
he would have to do that cause bind raw ignores flags
Elen sila lúmenn' omentielvo
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Bah..you're rigth Papillon :)
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

so what is the complete code? :)
«A fantastic spaghetti is a spaghetti that does not exist»
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Do you want us to hold your hand while you copy and paste it too?

Code: Select all

proc xnotc {f k a} {
    expr {[string eq $f "X!cservice@undernet.org"]&&\
          [string first "Specified ban is already in my banlist!" $a]>-1}
}
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

and where does the return 0 go?
«A fantastic spaghetti is a spaghetti that does not exist»
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

that last expr should do it all...btw: remember the bind
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

an error occured:

Code: Select all

[10:55] Tcl error [xnotc]: syntax error in expression "[string eq $f "X!cservice@undernet.org"]&&\ 
[string first ""
«A fantastic spaghetti is a spaghetti that does not exist»
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Try with equal, instead of eq.
Once the game is over, the king and the pawn go back in the same box.
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

caesar wrote:Try with equal, instead of eq.
Why? Actually a single "e" is enough.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I was talking about the "string eq" thing, as far as I know there is no eq in the string, just the equal. Correct me if I'm wrong..
Once the game is over, the king and the pawn go back in the same box.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

You are quite correct. However, so is User.

Tcl uses an abbreviation system, so as long as there are not two commands clashing with your abbreaviation, Tcl will work.

Look at the lines of lindex. You can use end, en or e as the index, to mean the last idx.

Another example, using "chann set #channel +test" works fine for eggdrop commands in Tcl, due to the abbreviation system.
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Options can be abbreviated. That means you only need the minimum number of chars that uniquely identifies an option..eg:
'string e ...' works fine because 'equal' is the only option starting with an 'e', but if you'd do 'string i ...' you get an error message like 'ambiguous option "i": must be <list of options>'.

Commands that accept abbreviated options has this stated on their manual page. So check the manual before doing it and keep in mind that options added in a future version of Tcl may render your option ambiguous.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Yes, I agree with you user on the abbreviated part, but seems that is not working propertly on Realz script. This might be an old TCL or something like this, not shure of it anyway.
Once the game is over, the king and the pawn go back in the same box.
Locked