Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on *:START: {
- hmake nvotes 100
- if ($file(nvotes.hsh).longfn) hload nvotes $v1
- }
- on *:EXIT:hsave nvotes nvotes.hsh
- alias nvote {
- if (!$sock(nvote)) {
- sockopen nvote www.nmaps.net 80
- var -g %nv.vote $replace($$2,+,hinc,-,hdec), %nv.num $$3, %nv.addr $+(addr:,$$1)
- }
- }
- on *:TEXT:/([+-])([1-9]\d*)/Si:#n-highscores:nvote $wildsite $regml(1) $regml(2)
- on *:INPUT:#n-highscores:if ($regex($1,/([+-])([1-9]\d*)/Si)) && (!$ctrlenter) nvote $address($me,2) $regml(1) $regml(2)
- on *:SOCKOPEN:nvote: {
- sockwrite -n nvote GET / $+ %nv.num HTTP/1.1
- sockwrite -n nvote Host: www.nmaps.net
- sockwrite -n nvote $crlf
- }
- on *:SOCKREAD:nvote: {
- var %read, %i 1
- sockread %read
- if (<h2>Map Not Found</h2> isin %read) .timer $+ %nv.num 1 1 msg #n-highscores That map does not exist
- elseif (<img class="thumbnail" isin %read) && (!$istok($hget(nvotes,%nv.addr),%nv.num,32)) {
- hadd nvotes %nv.addr $hget(nvotes,%nv.addr) %nv.num
- %nv.vote nvotes %nv.num
- timer $+ %nv.num 1 1 msg #n-highscores %nv.num $+(,$iif(-* iswm $hget(nvotes,%nv.num),04,03),$v2,) $(|) unset %nv.*
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement