mIRC Home    About    Download    Register    News    Help

Print Thread
Simple sockets script #209116 04/02/09 02:31 PM
Joined: Feb 2007
Posts: 91
S
spermis Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2007
Posts: 91
Hello.
Could someone please help me with a little sockets script?
I need a script, that will just go to http://link/file.php , and then close it.
Simple as that Smile
Thanks.

Re: Simple sockets script [Re: spermis] #209117 04/02/09 03:31 PM
Joined: Feb 2007
Posts: 234
M
MTec007 Offline
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2007
Posts: 234
you can uncomment the lines below to make mirc look like a browser to the website.

Code:
alias test.open {
  if ($sock(testSocket)) { sockclose testSocket }
  sockopen testSocket mirc.com 80
}
on 1:SOCKOPEN:testSocket: {
  if ($sockerr > 0) { echo -s $sock($sockname).wsmsg | return }

  sockwrite -n $sockname GET /index.html HTTP/1.0
  sockwrite -n $sockname Host: www.mirc.net
  ;sockwrite -n $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5
  ;sockwrite -n $sockname Accept: text/html,text/plain
  ;sockwrite -n $sockname Accept-Language: en-us,en;q=0.5
  ;sockwrite -n $sockname Accept-Encoding: 
  ;sockwrite -n $sockname Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
  ;sockwrite -n $sockname Referer: http://www.mirc.net/paste/
  ;sockwrite -n $sockname Keep-Alive: 300
  ;sockwrite -n $sockname Connection: keep-alive
  sockwrite $sockname $crlf
  sockclose $sockname
}

Last edited by MTec007; 04/02/09 03:32 PM.