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.

Can`t understand why don`t works..

Help for those learning Tcl or writing their own scripts.
Post Reply
F
FcLan
Halfop
Posts: 64
Joined: Fri Sep 30, 2005 10:46 am
Location: Poland

Can`t understand why don`t works..

Post by FcLan »

It`s a script which downloads some informations from user profile and if someone type !any_id for example !582 it will change address and read info for this profile, but this don`t works...

Code: Select all

bind pub - "% !*" checkid;
proc checkid {n u h c t} {
   set id [string range $t 1 end];
   if {[string is digit -stict $id]} {get_projects2 $c $id} {putcmdlog "$id isnt a valid id"}
}
set url "www.sensiblesoccer.de"

proc get_projects2 {channel id} {
   global url
   set sock [socket $url 80]
   fconfigure $sock -buffering line -buffersize 1000
   puts $sock "GET /index.php?site=online_segastatpers&uid=$id HTTP/1.0"
   puts $sock "Host: www.sensiblesoccer.de"
   puts $sock ""
   puts $sock "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
   flush $sock

   while {![eof $sock]} {
      gets $sock body
      regexp -all {<td width="65%" class="medium">(.*?)</td><td} $body _ served
   }

   if {[eof $sock]} { close $sock }

   regsub -all {(<.+?>)} $served "" served

   puthelp "PRIVMSG $channel :[lindex $served]"

}
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

For starters, -stict should be -strict.
F
FcLan
Halfop
Posts: 64
Joined: Fri Sep 30, 2005 10:46 am
Location: Poland

Post by FcLan »

When i rehashs bot he goes from irc
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

FcLan wrote:When i rehashs bot he goes from irc
The I would suggest you READ the logs and figure out what caused it to "crash".
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Post Reply