mIRC Home    About    Download    Register    News    Help

Print Thread
#13472 27/02/03 10:32 PM
Joined: Dec 2002
Posts: 271
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 271
hey, how would i open a socket to the entrance page of this messsage board, but under my name, so i can see how many new posts, etc..?

#13473 28/02/03 02:35 AM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Your post is a good example of describing a 40 lines script in a few words :tongue:

The script below reads some login information from your cookie and sends it among the HTTP request:
Code:

alias ubb {
  var %f = c:\windows\cookies\user@ubbthreads[1].txt, %i = 1
  if $isfile(%f) {
    sockopen ubb forums.mirc.com 80
    while $read(%f,%i) {
      set %ubb.cookie %ubb.cookie $+($ifmatch,=,$read(%f,$calc(%i + 1)),;)
      inc %i 9
    }
  }
  else {
    echo Sorry, couldn't find the user cookie.
  }
}
 
On *:sockopen:ubb:{
  sockwrite -tn ubb GET /ubbthreads.php HTTP/1.1
  sockwrite -tn ubb Host: forums.mirc.com
  sockwrite -tn ubb Cookie: %ubb.cookie
  sockwrite -tn ubb Connection: close
  sockwrite -tn ubb
}
 
On *:sockread:ubb:{
  var %s
  sockread %s
  while $sockbr {
    if $regex(%s,^\d\d/\d\d/\d\d\d\d \d\d:\d\d$) {
      inc %ubb.pos
      set %ubb.forum $replace(%ubb.pos,1,Latest News,2,General Discussion, $+ $&
        3,mIRC Help,4,Connection Issues,5,Scripts & Popups, $+ $&
        6,Feature Suggestions,7,Devoloper Forum,8,Bug Reports)
      if %ubb.info {
        echo 10 * %ubb.forum $+ : %ubb.info new posts. (last post at %s $+ ).
        unset %ubb.info
      }
    }
    elseif ?<font class="new">(?*)</font> iswm %s {
      set %ubb.info $iif(%ubb.info,%ubb.info new threads;) $mid(%s,21,-8) 
    }
    sockread %s
  }
}
 
On *:sockclose:ubb: unset %ubb.*


To run it, simply type /ubb... enjoy smile

#13474 28/02/03 04:46 AM
Joined: Dec 2002
Posts: 271
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 271
cool, all ya had to say way, set a var with the cookie in cookies, and to sockwrite it, Cookie: %van wink

thanks again, lol


Link Copied to Clipboard