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.

Why doesn't it work?

Old posts that have not been replied to for several years.
Locked
N
Nexus6
Op
Posts: 114
Joined: Mon Sep 02, 2002 4:41 am
Location: Tuchola, Poland

Why doesn't it work?

Post by Nexus6 »

it works

bind msg - "!spammers" spammersm

proc spammersm {nick uhost handle text} {
if {([string match "*staff*" [string tolower $uhost]]) || ([string tolower $nick] == "oper") || ([matchattr $nick o])} {
set stats [open "spammers.dat" r]
gets $stats spammerz
close $stats
putserv "NOTICE $nick :\002$spammerz\002 spammers have been caught since 30.09.2002"
}
}

And when I change proc a bit it doesn't work, it should tho. I want it notice user with stats if uhost contains *staff* or nick is Oper or user has +o flag or above. It doesn't work even if user has *staff* string in uhost. I just wonder why doesn't the 2nd version work and it's digging me, I'd be grateful for help :)

proc spammersm {nick uhost handle text} {
if {(![string match "*staff*" [string tolower $uhost]]) || ([string tolower $nick] != "oper") || (![matchattr $nick o])} { return 0 }
set stats [open "spammers.dat" r]
gets $stats spammerz
close $stats
putserv "NOTICE $nick :\002$spammerz\002 spammers have been caught since 30.09.2002"
}
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

lol
the second version does exactly the same as the first one :)
remove the "return 0" from the 2nd version :)
Elen sila lúmenn' omentielvo
N
Nexus6
Op
Posts: 114
Joined: Mon Sep 02, 2002 4:41 am
Location: Tuchola, Poland

Post by Nexus6 »

/me gets more confused!

if {[string match "*staff*" [string tolower $uhost]]} { ... means that proc will be done if user host matches *staff* if not nothing will happen

if {![string match "*staff*" [string tolower $uhost]]} { return 0}
;rest here;
means that if user host doesn't match *staff* nothing will be done if it does proc should be done. Ain't I right?
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

read carefully what you just wrote yourself :)
Elen sila lúmenn' omentielvo
N
Nexus6
Op
Posts: 114
Joined: Mon Sep 02, 2002 4:41 am
Location: Tuchola, Poland

Post by Nexus6 »

i know that those 2 procs do the same in the other way and i wanted to make 2nd one work and i made it :)
I changed || to && it didn't work 'cause my host had *staff* string but nickname was different than Oper, when its && (and) it works even if only nick = ogre or only host has *staff* string
if {(![string match "*staff*" [string tolower $uhost]]) && ([string tolower $nick] != "oper")} {return 0}
;rest of proc;
Locked