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.
Old posts that have not been replied to for several years.
stoo
Voice
Posts: 14 Joined: Fri Jan 30, 2004 1:10 pm
Post
by stoo » Tue Mar 02, 2004 1:00 pm
http://www.enemydown.co.uk/ed_clanrank. ... &clan=7394
that link is the rank for my clan, i need a simple script that will get the number and allow for it to be said in the channel on a prompt e.g !rank
anyone who could write this would be of great help
i was trying to do this myself but my tcl skills are low and i cannot get my head round regexp.
Thanks to anyone who can help
--Stoo
GodOfSuicide
Master
Posts: 463 Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria
Post
by GodOfSuicide » Tue Mar 02, 2004 1:52 pm
double post, you allready requested that one a while ago, no need for a new thread
stoo
Voice
Posts: 14 Joined: Fri Jan 30, 2004 1:10 pm
Post
by stoo » Tue Mar 02, 2004 3:14 pm
from then i have tried myself and i am asking again
]Kami[
Owner
Posts: 590 Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:
Post
by ]Kami[ » Tue Mar 02, 2004 3:33 pm
document.write(""); document.write("
"); document.write(""); document.write("
UK - Division 1
"); document.write("16
"); document.write("MgK |"); document.write("
");
Hm site isnt working?
stoo
Voice
Posts: 14 Joined: Fri Jan 30, 2004 1:10 pm
Post
by stoo » Wed Mar 03, 2004 1:20 pm
the ED site goes down all the time due to the large number of hits
but basically i need a script to read the position, anything else i can do on my own, its just the whole regexp thing
stoo
Voice
Posts: 14 Joined: Fri Jan 30, 2004 1:10 pm
Post
by stoo » Thu Mar 04, 2004 6:21 pm
anyone ?
stdragon
Owner
Posts: 959 Joined: Sun Sep 23, 2001 8:00 pm
Contact:
Post
by stdragon » Thu Mar 04, 2004 10:27 pm
regexp "<b>(.*)</b>" $text match rank
$text = text of web page
$rank = clan's rank
stoo
Voice
Posts: 14 Joined: Fri Jan 30, 2004 1:10 pm
Post
by stoo » Thu Mar 04, 2004 11:09 pm
Code: Select all
package require http
bind pub - !rank rank:rank
proc rank:rank {nick host handle chan text} {
set url "http://www.enemydown.co.uk/ed_clanrank.php?ladder=3&clan=7394"
{ if {[regexp "<b>(.*)</b>" $text match rank] } {
puthelp "PRIVMSG $chan :$rank"
}
}
}
that isnt working, any ideas ?
stdragon
Owner
Posts: 959 Joined: Sun Sep 23, 2001 8:00 pm
Contact:
Post
by stdragon » Thu Mar 04, 2004 11:19 pm
You forgot the part where you download the url. Take a look at some other web downloading scripts for hints.
stoo
Voice
Posts: 14 Joined: Fri Jan 30, 2004 1:10 pm
Post
by stoo » Fri Mar 05, 2004 5:08 pm
Code: Select all
package require http
proc rank:rank {nick host handle chan content} {
set content [http::data [http::geturl "http://www.enemydown.co.uk/ed_clanrank.php?ladder=3&clan=7394"]]
}
if [regexp "<b>(.*)</b>" $content match rank] } {
puthelp "PRIVMSG $chan :$match"
}
this gives me the error
[22:01] can't read "content": no such variable
while executing
"regexp "<b>(.*)</b>" $content match rank"
invoked from within
"if [regexp "<b>(.*)</b>" $content match rank] } {
puthelp "PRIVMSG $chan :$match"
}
S
SmO
Post
by SmO » Sat Mar 06, 2004 8:59 am
this is what i have in mirc script.... i hope you know how to translate it to tcl ^^
Code: Select all
//ON CONNECT UPDATE
on *:connect:{
.timertdm.be 1 2 tdm.be
)
//TDM.BENELUX
on *:sockopen:tdm.be:{
sockwrite -n $sockname GET /cbrank.php?cid=290541&lid=1250&type=js HTTP/1.1
sockwrite -n $sockname Host: www.clanbase.com
sockwrite -n $sockname $crlf $+ $crlf
}
on 1:sockread:tdm.be:{
if ($sockerr > 0) return
:nextread
sockread %temp
if ($sockbr == 0) return
if (document.write isin %temp) {
set %r.tdm.be = $remove(%temp,document.write)
}
goto nextread
}
Dit in alias:
//TDM.BENELUX
tdm.be {
if ($sock(tdm.be)) { sockclose tdm.be }
sockopen tdm.be www.clanbase.com 80
}
i'm learning tcl now someone got a tip????
stoo
Voice
Posts: 14 Joined: Fri Jan 30, 2004 1:10 pm
Post
by stoo » Sat Mar 06, 2004 3:24 pm
Code: Select all
bind pub -|- !rank rank:rank
package require http
proc rank:rank {nick host handle chan content} {
set division "Division 1"
set game "CS"
set channel "#MaGiK^"
set ladderid "3"
set clanid "7394"
set content [http::data [http::geturl "http://www.enemydown.co.uk/ed_clanrank.php?ladder=$ladderid&clan=$clanid"]]
if {[regexp "<b>(.*)</b>" $content match rank] } {
regsub -all {<.+?>} $match {} match
puthelp "PRIVMSG $channel : \002\0034,1 Retreving Rank from http://www.enemydown.co.uk on request of $nick\003\002"
puthelp "PRIVMSG $channel : \002\0034,1 Enemy Down \0030,1:: \0034,1$game $division Ladder \0030,1::\0034,1 Rank $match \003\002"
}
}
Finally it works, theres the code for anyone who needs it