| View previous topic :: View next topic |
| Author |
Message |
zerodtk Voice
Joined: 25 Mar 2009 Posts: 20
|
Posted: Thu Mar 26, 2009 10:46 am Post subject: |
|
|
heya, hope you don't mind one more question...
how can i make it ignore its own url?
something like
*szabadka.org*
thanks in advance |
|
| Back to top |
|
 |
zerodtk Voice
Joined: 25 Mar 2009 Posts: 20
|
Posted: Thu Mar 26, 2009 1:31 pm Post subject: |
|
|
what about this one
came from Ofloo
| Code: | proc isdupe {url} {
if {![catch {open $catch:path r} rf]} {
set r 0
while {![eof $rf]} {
if {[string match -nocase *${url}* [gets $rf]]} {
set r 1
break
}
}
close $rf } } |
and adding it where it catches the urls
| Code: | proc catch_url_pubm {nick host hand chan arg} {
if {[regexp -nocase {(http://[^\s]+)} $arg -> url]} {
if {[isdupe $url]} {return} |
and the error i get is
| Code: | [18:14:41] [(Angela]: [18:12] Tcl error [catch_url_pubm]: expected boolean value but got ""
[18:14:44] [(Angela]: Currently: expected boolean value but got ""
[18:14:44] [(Angela]: Currently: while executing
[18:14:44] [(Angela]: Currently: "if {[isdupe $url]} {return}"
[18:14:44] [(Angela]: Currently: (procedure "catch_url_pubm" line 3) |
|
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Thu Mar 26, 2009 2:16 pm Post subject: |
|
|
the isdupe proc is missing a line stating "return $r" at the end. Also, the catch:path variable is not linked to globalspace, and is not defined, so this will cause an error (caught though).
I'd suggest something like this:
| Code: | proc isdupe {url} {
set r 0
if {![catch {open "scripts/urllogger.txt" r} rf]} {
while {![eof $rf]} {
if {[string match -nocase *${url}* [gets $rf]]} {
set r 1
break
}
}
close $rf
}
return $r
} |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
zerodtk Voice
Joined: 25 Mar 2009 Posts: 20
|
Posted: Thu Mar 26, 2009 6:00 pm Post subject: |
|
|
thanks, the error is now gone...
so i just need to change ${url} to what i want to be ignored?
something like
| Code: | proc isdupe {url} {
set r 0
if {![catch {open "/home/zerodtk/public_html/log/index.php" r} rf]} {
while {![eof $rf]} {
if {[string match -nocase *szabadka* [gets $rf]]} {
set r 1
break
}
}
close $rf
}
return $r
} |
|
|
| Back to top |
|
 |
zerodtk Voice
Joined: 25 Mar 2009 Posts: 20
|
Posted: Thu Mar 26, 2009 7:11 pm Post subject: |
|
|
hahahaha the solution was in front of my eyes!
:DDD thanks for your help )
| Code: | proc isdupe {url} {
set r 0
if {![catch {open "scripts/ignored.txt" r} rf]} {
while {![eof $rf]} {
if {[string match -nocase *${url}* [gets $rf]]} {
set r 1
break
}
}
close $rf
}
return $r
} |
and the ignored urls goes to the ignored.txt lol
thanks much for helping me out:) |
|
| Back to top |
|
 |
|