mIRC Home    About    Download    Register    News    Help

Print Thread
#43472 22/08/03 12:35 AM
Joined: Apr 2003
Posts: 300
A
andymps Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Apr 2003
Posts: 300
i am doing a script that looks up the definition of a word, i have got it to go to the webpage but i dont know how to get it to read from the web page and display the info on irc ? can anyone help?


Liek OMG Yuo Stoleded my MageHurtzzzz!!!11
#43473 22/08/03 01:19 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Save the website to a file and use $read to get information from it, you can use the w switch of $read for wildmatches and also use the n switch to make sure you don't read a line with a | in it and start executing commands.

$read(filename,nw,*hello*)

#43474 22/08/03 02:21 AM
Joined: Apr 2003
Posts: 300
A
andymps Offline OP
Fjord artisan
OP Offline
Fjord artisan
A
Joined: Apr 2003
Posts: 300
ok and how do i save it with irc, cos this script is goin on a bot


Liek OMG Yuo Stoleded my MageHurtzzzz!!!11
#43475 22/08/03 02:51 AM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Here is a basic script to download a webpage and save it to a file:
Code:
alias get {
  sockopen get $gettok($1-,1,47) 80
  .remove get.html
  sockmark get $gettok($1-,1,47) / $+ $replace($gettok($1-,2-,47),$chr(32),% $+ 20)
}
on *:SOCKOPEN:get:{
  if ( $sock($sockname).wserr ) || ( $sockerr ) {
    echo -a $sock($sockname).wsmsg
    halt
  }
  tokenize 32 $sock($sockname).mark
  sockwrite -n $sockname GET $2 HTTP/1.1
  sockwrite -n $sockname Connection: close
  sockwrite -n $sockname Host: $1
  sockwrite -n $sockname
}
on *:SOCKREAD:get:{
  sockread &b
  bwrite get.html -1 -1 &b
}
on *:SOCKCLOSE:get:{
  echo -a Done.
}

Type /get www.mirc.com and wait for it to echo "Done.", then goto your mIRC directory and open get.html, it should contain the mIRC homepage.


Link Copied to Clipboard