| View previous topic :: View next topic |
| Author |
Message |
whiteshark Halfop
Joined: 12 Jun 2005 Posts: 62 Location: netherlands
|
Posted: Tue Jun 14, 2005 3:46 pm Post subject: help with cs.nl |
|
|
who can help me with this script
when i put the triger !cs i few this error ^TriviaBot^ [CS.NL] Er ging iets fout tijdens het ophalen van de gegevens. every time
# Cs.NL script voor eggdrop
#
# Dit script is gebaseerd op het Fok! script van Peter Postma,
# het haalt de news headlines van www.counter-strike.nl op.
# info over het originele script hieronder :
#
# version 2.0, 24/08/2003, door Peter Postma <peter@webdeveloping.nl>
#
# Meer van zijn scripts kun je hier vinden :
# http://www.pointless.nl/?page=eggdrop
#
# Pas aub. de configuratie hieronder aan:
#
### Configuratie instellingen ###
# maak gebruik van een http proxy om de gegevens op te halen?
# stel op deze manier in: "host.isp.com:port" of laat 't leeg voor geen proxy
set csnl(proxy) ""
# de triggers: [scheiden met een spatie]
set csnl(triggers) "!csnl !cs !cs.nl !news !cs.news !csnlnews"
# benodigde flags om de triggers te kunnen gebruiken. [default=iedereen]
set csnl(flags) "-|-"
# kanalen waar de bot niet op de triggers zal reageren [scheiden met spatie]
set csnl(nopub) ""
# stuur berichten public of private wanneer er een trigger wordt gebruikt?
# 0 = Private message
# 1 = Public message
# 2 = Private notice
# 3 = Public notice
set csnl(method) 1
# aantal headlines weergeven wanneer een trigger wordt gebruikt. [>1]
set csnl(headlines) 3
# flood protectie: aantal seconden tussen gebruik van de triggers
# zet 't op 0 om de flood protectie uit te zetten.
set csnl(antiflood) 60
# hieronder kun je de layout aanpassen voor de output:
# %tyd = tijd
# %tit = titel
# %id = id (wordt gebruikt in de nieuws url)
# %rea = aantal reacties
# %b = bold (dikgedrukte) tekst
# %u = underlined (onderstreepte) tekst
set csnl(layout) "\[%bCS.NL%b\] %tit - http://www.counter-strike.nl/ShowNews.php?id=%id"
# om de hoeveel minuten checken of er nieuws is? [minimaal 5]
# deze waarde wordt gebruikt door zowel de triggers als het autonews.
set csnl(updates) 10
# het nieuws automatisch weergeven in de kanalen? [0=nee / 1=ja]
set csnl(autonews) 1
# autonews: stuur naar welke kanalen? [kanalen scheiden met een spatie]
# gebruik "*" om het nieuws naar alle kanalen te sturen (/amsg).
set csnl(autonewschan) "*"
# maximaal aantal berichten die worden getoond tijdens de automatische updates.
# hiermee kan je voorkomen dat de channel wordt ondergeflood als je de
# updates hoog hebt staan (bv. langer dan een uur).
set csnl(automax) 3
# trigger om het autonews aan te zetten. [string]
set csnl(autontrigger) "!cson"
# trigger om het autonews uit te zetten. [string]
set csnl(autofftrigger) "!csoff"
# benodigde flags om de autonews[on/off] triggers te gebruiken [default=master]
set csnl(autotriggerflag) "m|m"
# log extra informatie (debug) naar de partyline? [0=nee / 1=ja]
set csnl(log) 1
### Eind configuratie instellingen ###
### Begin Tcl code ###
set csnl(version) "2.0"
if {[catch { package require http } err]} {
putlog "\[CS.NL\] Kan [file tail [info script]] niet laden: Probleem met het laden van de http package: $err"
return 1
}
if {[info tclversion] < 8.0} {
putlog "\[CS.NL\] Kan [file tail [info script]] niet laden: U heeft minimaal Tcl versie 8.0 nodig en u heeft Tcl versie [info tclversion]."
return 1
}
if {![info exists alltools_loaded]} {
putlog "\[CS.NL\] Kan [file tail [info script]] niet laden: Zorg ervoor dat alltools.tcl in uw eggdrop configuratie wordt geladen!"
return 1
}
set whichtimer [timerexists "csnl:update"]
if {$whichtimer != ""} { killtimer $whichtimer }
catch { unset whichtimer }
foreach trigger [split $csnl(triggers)] {
bind pub $csnl(flags) $trigger csnl:pub
if {$csnl(log)} { putlog "\[CS.NL\] Trigger $trigger added." }
}
catch { unset trigger }
if {$csnl(autofftrigger) != ""} { bind pub $csnl(autotriggerflag) $csnl(autofftrigger) csnl:autoff }
if {$csnl(autontrigger) != ""} { bind pub $csnl(autotriggerflag) $csnl(autontrigger) csnl:auton }
proc csnl:getdata {} {
global csnl csnldata
if {$csnl(log)} { putlog "\[CS.Nl\] Updating data..." }
set url "http://www.counter-strike.nl/xml.php"
set page [::http::config -useragent "Mozilla"]
if {$csnl(proxy) != ""} {
if {![regexp {(.+) [0-9]+)} $csnl(proxy) trash proxyhost proxyport]} {
putlog "\[CS.NL\] Wrong proxy configuration ($csnl(proxy))"
return -1
}
set page [::http::config -proxyhost $proxyhost -proxyport $proxyport]
catch { unset proxyhost proxyport }
}
if {[catch { set page [::http::geturl $url -timeout 15000] } msg]} {
putlog "\[CS.NL\] Problem: $msg"
return -1
}
if {[::http::status $page] != "ok"} {
putlog "\[CS.NL\] Problem: [::http::status $page]"
catch { ::http::cleanup $page }
return -1
}
if {![regexp -nocase {ok} [::http::code $page]]} {
putlog "\[CS.NL\] Problem: [::http::code $page]"
catch { ::http::cleanup $page }
return -1
}
if {[catch { set data [::http::data $page] } msg]} {
putlog "\[CS.NL\] Problem: $msg"
catch { ::http::cleanup $page }
return -1
}
if {[info exists csnldata]} { unset csnldata }
set count 0
foreach line [split $data \n] {
regsub -all "\\&" $line "\\\\&" line
regexp "<id>(.*)</id>" $line trash csnldata(id,$count)
regexp "<title>(.*)</title>" $line trash csnldata(titel,$count)
regexp "<timestamp>(.*)</timestamp>" $line trash csnldata(ts,$count)
regexp "<tijd>(.*)</tijd>" $line trash csnldata(tijd,$count)
if {[regexp "<reacties>(.*)</reacties>" $line trash csnldata(reac,$count)]} { incr count }
}
set csnl(lastupdate) [clock seconds]
catch { ::http::cleanup $page }
catch { unset url page msg data count line trash }
return 0
}
proc csnl:pub {nick uhost hand chan text} {
global lastbind csnl csnldata
if {[lsearch -exact $csnl(nopub) [string tolower $chan]] >= 0} { return 0 }
if {$csnl(antiflood) > 0} {
if {[info exists csnl(floodprot,$chan)]} {
set diff [expr [clock seconds] - $csnl(floodprot,$chan)]
if {$diff < $csnl(antiflood)} {
putquick "NOTICE $nick :Trigger is net al gebruikt! Wacht aub. [expr $csnl(antiflood) - $diff] seconden..."
return 0
}
}
set csnl(floodprot,$chan) [clock seconds]
}
if {$csnl(log)} { putlog "\[CS.NL\] Trigger: $lastbind in $chan by $nick" }
set ret 0
if {[info exists csnl(lastupdate)]} {
if {[expr [clock seconds] - $csnl(lastupdate)] >= [expr $csnl(updates) * 60]} {
set ret [csnl:getdata]
}
} elseif {![info exists csnldata(id,0)]} {
set ret [csnl:getdata]
}
if {$ret != -1} {
for {set i 0} {$i < $csnl(headlines)} {incr i} {
if {![info exists csnldata(id,$i)]} { break }
if {[catch { csnl:put $chan $nick $i $csnl(method) } err]} {
putlog "\[CS.NL\] Problem in data array: $err"
}
}
} else {
putserv "NOTICE $nick :\[CS.NL\] Er ging iets fout tijdens het ophalen van de gegevens."
}
catch { unset ret diff i err }
}
proc csnl:put {chan nick which method} {
global csnl csnldata
set outchan $csnl(layout)
regsub -all "%tyd" $outchan $csnldata(tijd,$which) outchan
regsub -all "%id" $outchan $csnldata(id,$which) outchan
regsub -all "%rea" $outchan $csnldata(reac,$which) outchan
regsub -all "%tit" $outchan $csnldata(titel,$which) outchan
regsub -all "&" $outchan "\\&" outchan
regsub -all """ $outchan "\"" outchan
regsub -all "%b" $outchan "\002" outchan
regsub -all "%u" $outchan "\037" outchan
switch $method {
0 { putserv "PRIVMSG $nick :$outchan" }
1 { putserv "PRIVMSG $chan :$outchan" }
2 { putserv "NOTICE $nick :$outchan" }
3 { putserv "NOTICE $chan :$outchan" }
default { putserv "PRIVMSG $chan :$outchan" }
}
catch { unset outchan }
}
proc csnl:update {} {
global csnl csnldata
if {[csnl:getdata] != -1} {
if {![info exists csnldata(ts,0)]} {
putlog "\[CS.NL\] Something went wrong while updating..."
return -1
}
if {![info exists csnl(lastitem)]} {
set csnl(lastitem) $csnldata(ts,0)
if {$csnl(log)} { putlog "\[CS.NL\] Last news item timestamp set to '$csnldata(ts,0)'." }
} else {
if {$csnl(log)} { putlog "\[CS.NL\] Last news item timestamp is '$csnldata(ts,0)'." }
}
if {$csnldata(ts,0) > $csnl(lastitem)} {
if {$csnl(log)} { putlog "\[CS.NL\] There's news!" }
if {[regexp {^\*$} $csnl(autonewschan)]} {
set dest [channels]
} else {
set dest $csnl(autonewschan)
}
for {set i 0} {$i < $csnl(automax)} {incr i} {
if {![info exists csnldata(ts,$i)]} { break }
if {$csnldata(ts,$i) == $csnl(lastitem)} { break }
foreach chan [split $dest] {
if {[catch { csnl:put $chan $chan $i 1 } err]} {
putlog "\[CS.NL\] Problem in data array: $err"
}
}
}
catch { unset dest i chan err }
} else {
if {$csnl(log)} { putlog "\[CS.NL\] No news." }
}
set csnl(lastitem) $csnldata(ts,0)
}
if {$csnl(updates) < 5} {
putlog "\[CS.NL\] Warning: the \$csnl(updates) setting is too low! Defaulting to 5 minutes..."
timer 5 csnl:update
} else {
timer $csnl(updates) csnl:update
}
return 0
}
proc csnl:autoff {nick uhost hand chan text} {
global lastbind csnl
if {[lsearch -exact $csnl(nopub) [string tolower $chan]] >= 0} { return 0 }
if {$csnl(log)} { putlog "\[CS.NL\] Trigger: $lastbind in $chan by $nick" }
if {$csnl(autonews) == 1} {
set csnl(autonews) 0; catch { unset csnl(lastitem) }
set whichtimer [timerexists "csnl:update"]
if {$whichtimer != ""} { killtimer $whichtimer }
catch { unset whichtimer }
putlog "\[CS.NL\] Autonews turned off."
putserv "PRIVMSG $chan :\001ACTION has disabled newsrelay\001"
} else {
putserv "NOTICE $nick :newsrelay allready disabled."
}
}
proc csnl:auton {nick uhost hand chan text} {
global lastbind csnl
if {[lsearch -exact $csnl(nopub) [string tolower $chan]] >= 0} { return 0 }
if {$csnl(log)} { putlog "\[CS.NL\] Trigger: $lastbind in $chan by $nick" }
if {$csnl(autonews) == 0} {
set csnl(autonews) 1; csnl:update
putlog "\[CS.NL\] Autonews turned on."
putserv "PRIVMSG $chan :\001ACTION has enabled news relay.\001"
} else {
putserv "NOTICE $nick :newsrelay allready enabled"
}
}
if {$csnl(autonews) == 1} { csnl:update }
putlog "\[CS.NL\]script $csnl(version): Loaded!"
[/code] |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Tue Jun 14, 2005 4:36 pm Post subject: |
|
|
has it ever occurred to you not everyone on this forum is dutch?
I for one don't have a clue what that error message means |
|
| Back to top |
|
 |
Devilion Voice

Joined: 04 May 2005 Posts: 7
|
Posted: Sat Jun 25, 2005 6:18 am Post subject: |
|
|
the error: Er ging iets fout tijdens het ophalen van de gegevens
is in English: Something went wrong while retrieving the data |
|
| Back to top |
|
 |
Dizzle Op
Joined: 28 Apr 2005 Posts: 109
|
Posted: Tue Jul 05, 2005 4:00 am Post subject: |
|
|
goto #counter-strike.nl, ik bet those guys can help you  |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Tue Jul 05, 2005 9:40 am Post subject: |
|
|
What good would that do him though?
This script merely retrieves info from www.counter-strike.nl
It was not made by them or atleast not from what i can tell. |
|
| Back to top |
|
 |
|
|
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
|
|