Code: Select all
# twor.be
package require http
setudef flag twor
bind pub - !il twor
proc twor {nick uhost handle chan tag} {
if {[lsearch -exact [channel info $chan] +twor] == -1} { return }
set query "http://www.twor.be/g/irc/il_box.php?auser=[string map {" " "%20"} $tag]&buser=[string map {" " "_"} $tag]"
# if you own the site, using this agent string will let you know in
# your weblogs how much bandwidth the bot consumes and how
# often attempts to scrape are made. Otherwise change to "mozilla"
set ua "Eggdrop twor.be script"
set http [::http::config -useragent $ua -useragent "utf-8"]
catch {set http [::http::geturl "$query" -timeout [expr 1000 * 5]]} error
if {[string match -nocase "*couldn't open socket*" $error]} {
putserv "privmsg $chan :Socket Fout bij het openen van '$query'.. Het moet omlaag.. :("
return 0
}
if {[string equal -nocase [::http::status $http] "timeout"]} {
putserv "privmsg $chan :Connection is een time-out."
return 0
}
set html [::http::data $http]
::http::cleanup $http
if {[regexp {@@start(.+?)@@end} $html - user]} {
putserv "privmsg $chan :Het IL van \002[lindex [split $user "+"] 0]\002 is \002[lindex [split $user "+"] 1]\002."
return 1
} else {
putserv "privmsg $chan :Geen resultaat gevonden."
return 0
}
}
putlog "twor.be geladen."
Code: Select all
[17:15:26] <@Jeroen_005> !il jeroen 005
[17:15:26] <@TWOR_LOG> Het IL van
Code: Select all
# twor.be
package require http
setudef flag twor
bind pub - !il twor
proc twor {nick uhost handle chan tag} {
if {[lsearch -exact [channel info $chan] +twor] == -1} { return }
set query "http://www.twor.be/g/irc/il_box.php?auser=[string map {" " "%20"} $tag]&buser=[string map {" " "_"} $tag]"
# if you own the site, using this agent string will let you know in
# your weblogs how much bandwidth the bot consumes and how
# often attempts to scrape are made. Otherwise change to "mozilla"
set ua "Eggdrop twor.be script"
set http [::http::config -useragent $ua -useragent "utf-8"]
catch {set http [::http::geturl "$query" -timeout [expr 1000 * 5]]} error
if {[string match -nocase "*couldn't open socket*" $error]} {
putserv "privmsg $chan :Socket Fout bij het openen van '$query'.. Het moet omlaag.. :("
return 0
}
if {[string equal -nocase [::http::status $http] "timeout"]} {
putserv "privmsg $chan :Verbinding is een time-out."
return 0
}
set html [::http::data $http]
::http::cleanup $http
regsub {(?:\n|\t|\v|\r)} $html "" html
if {[regexp {@@start(.+?)@@end} $html - user]} {
putserv "privmsg $chan :Het IL van \002[string trim [lindex [split $user "+"] 0]]\002 is \002[string trim [lindex [split $user "+"] 1]]\002."
return 1
} else {
putserv "privmsg $chan :Geen resultaat gevonden."
return 0
}
}
putlog "twor.be geladen."
<speechles> !il jeron 005
<sp33chy> Het IL van jeron 005 is Onbekend (Geen account gevonden op onze website).
<speechles> !il jeroen 005
<sp33chy> Het IL van Jeroen_005 is Vrijgesteld.
Code: Select all
... rest of code goes above here ...
if {[lsearch -exact [channel info $chan] +twor] == -1} { return }
if {$tag == ""} {
putserv "privmsg $chan :Gelieve een nickname of user id op te geven."
return 0
}
set query "http://www.twor.be/g/irc/il_box.php?auser=[string map {" " "%20"} $tag]&buser=[string map {" " "_"} $tag]"
... rest of code continues ...
Code: Select all
# twor.be
package require http
setudef flag twor
bind pub - !il twor
proc twor {nick uhost handle chan tag} {
if {[lsearch -exact [channel info $chan] +twor] == -1} { return }
if {$tag == ""} {
putserv "privmsg $chan :\002FOUT:\002 Gelieve een nickname of userid op te geven."
return 0
}
set query "http://www.twor.be/g/irc/il_box.php?auser=[string map {" " "%20"} $tag]&buser=[string map {" " "_"} $tag]&cuser=[string map {"_" "%20"} $tag]"
# if you own the site, using this agent string will let you know in
# your weblogs how much bandwidth the bot consumes and how
# often attempts to scrape are made. Otherwise change to "mozilla"
set ua "Eggdrop twor.be script"
set http [::http::config -useragent $ua -useragent "utf-8"]
catch {set http [::http::geturl "$query" -timeout [expr 1000 * 5]]} error
if {[string match -nocase "*couldn't open socket*" $error]} {
putserv "privmsg $chan :\002FOUT:\002 :Socket Fout bij het openen van '$query'.. Probeer het zometeen nog een keer."
return 0
}
if {[string equal -nocase [::http::status $http] "timeout"]} {
putserv "privmsg $chan :\002FOUT:\002 De verbinding met de server is mislukt. Probeer het zometeen nog een keer."
return 0
}
set html [::http::data $http]
::http::cleanup $http
regsub {(?:\n|\t|\v|\r)} $html "" html
if {[regexp {@@start(.+?)@@end} $html - user]} {
putserv "privmsg $chan :Het IL van \002[string trim [lindex [split $user "+"] 0]]\002 is \002[string trim [lindex [split $user "+"] 1]]\002."
putserv "privmsg $chan :\002STATS: Gemiddelde:\002 [string trim [lindex [split $user "+"] 2]], \002Events:\002 [string trim [lindex [split $user "+"] 3]], \002Max:\002 [string trim [lindex [split $user "+"] 4]]. (afgelopen 31 dagen)"
return 1
} else {
putserv "privmsg $chan :\002FOUT:\002 De server kan uw vraag momenteel niet verwerken. Probeer het zometeen nog een keer."
return 0
}
}
putlog "Module loaded: SCRIPT: IL Box"
Code: Select all
set query "http://www.twor.be/g/irc/il_box.php?auser=[string map {" " "%20"} $tag]&buser=[string map {" " "_"} $tag]&cuser=[string map {"_" "%20"} [string map {" " "_"} $tag]]"
#defeat-word-wrap###############################################################################################################################################################