Advertisement
Iire

socketnotclosing

Nov 5th, 2011
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.11 KB | None | 0 0
  1. on *:START: {
  2.   hmake nvotes 100
  3.   if ($file(nvotes.hsh).longfn) hload nvotes $v1
  4. }
  5.  
  6. on *:EXIT:hsave nvotes nvotes.hsh
  7.  
  8. alias nvote {
  9.   if (!$sock(nvote)) {
  10.     sockopen nvote www.nmaps.net 80
  11.     var -g %nv.vote $replace($$2,+,hinc,-,hdec), %nv.num $$3, %nv.addr $+(addr:,$$1)
  12.   }
  13. }
  14.  
  15. on *:TEXT:/([+-])([1-9]\d*)/Si:#n-highscores:nvote $wildsite $regml(1) $regml(2)
  16.  
  17. on *:INPUT:#n-highscores:if ($regex($1,/([+-])([1-9]\d*)/Si)) && (!$ctrlenter) nvote $address($me,2) $regml(1) $regml(2)
  18.  
  19. on *:SOCKOPEN:nvote: {
  20.   sockwrite -n nvote GET / $+ %nv.num HTTP/1.1
  21.   sockwrite -n nvote Host: www.nmaps.net
  22.   sockwrite -n nvote $crlf
  23. }
  24.  
  25. on *:SOCKREAD:nvote: {
  26.   var %read, %i 1
  27.   sockread %read
  28.   if (<h2>Map Not Found</h2> isin %read) .timer $+ %nv.num 1 1 msg #n-highscores That map does not exist
  29.   elseif (<img class="thumbnail" isin %read) && (!$istok($hget(nvotes,%nv.addr),%nv.num,32)) {
  30.     hadd nvotes %nv.addr $hget(nvotes,%nv.addr) %nv.num
  31.     %nv.vote nvotes %nv.num
  32.     timer $+ %nv.num 1 1 msg #n-highscores %nv.num $+(,$iif(-* iswm $hget(nvotes,%nv.num),04,03),$v2,) $(|) unset %nv.*
  33.   }
  34. }
  35.  
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement