Advertisement
Iire

Very basic socket example

Jul 20th, 2011
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 0.64 KB | None | 0 0
  1. ; In the client running this script, type /stats to activate
  2.  
  3. alias stats {
  4.   sockclose stats
  5.   sockopen stats www.solanit.nl 80
  6.   if (!$window(@Stats)) window -e @Stats
  7. }
  8.  
  9. on *:SOCKOPEN:stats: {
  10.   sockwrite -n stats GET /statistieken.php HTTP/1.1
  11.   sockwrite -n stats Host: www.solanit.nl
  12.   sockwrite -n stats $crlf $crlf
  13. }
  14.  
  15. on *:SOCKREAD:stats: {
  16.   sockread %s.read
  17.   echo @Stats $+(,%s.read,)
  18. }
  19.  
  20. ; ---
  21.  
  22. ; NOTES:
  23. ; You can get specific text from the on *:SOCKREAD: event by using if statements:
  24. ; example:
  25.  
  26. /*
  27. on *:SOCKREAD:stats: {
  28.   sockread %s.read
  29.   if (Jouw totale * iswm %s.read) echo @stats $+(,%s.read,)
  30. }
  31. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement