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.

Clan Ladder rank help

Old posts that have not been replied to for several years.
Locked
s
stoo
Voice
Posts: 14
Joined: Fri Jan 30, 2004 1:10 pm

Clan Ladder rank help

Post by stoo »

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
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

double post, you allready requested that one a while ago, no need for a new thread
s
stoo
Voice
Posts: 14
Joined: Fri Jan 30, 2004 1:10 pm

Post by stoo »

from then i have tried myself and i am asking again
User avatar
]Kami[
Owner
Posts: 590
Joined: Thu Jul 24, 2003 2:59 pm
Location: Slovenia
Contact:

Post by ]Kami[ »

document.write(""); document.write("
"); document.write(""); document.write("
UK - Division 1
"); document.write("16
"); document.write("MgK |"); document.write("
");

Hm site isnt working?
s
stoo
Voice
Posts: 14
Joined: Fri Jan 30, 2004 1:10 pm

Post by stoo »

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
s
stoo
Voice
Posts: 14
Joined: Fri Jan 30, 2004 1:10 pm

Post by stoo »

anyone ?
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

regexp "<b>(.*)</b>" $text match rank

$text = text of web page
$rank = clan's rank
s
stoo
Voice
Posts: 14
Joined: Fri Jan 30, 2004 1:10 pm

Post by stoo »

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 ?
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

You forgot the part where you download the url. Take a look at some other web downloading scripts for hints.
s
stoo
Voice
Posts: 14
Joined: Fri Jan 30, 2004 1:10 pm

Post by stoo »

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 »

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????
s
stoo
Voice
Posts: 14
Joined: Fri Jan 30, 2004 1:10 pm

Post by stoo »

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
Locked