Advertisement
westor

SOCKS5 Multi-Server Connect for Kendy v1.5

Jul 16th, 2020
1,919
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.46 KB | None | 0 0
  1. ON *:START: {
  2.   var %f_s = servers.txt
  3.   var %f_p = proxylist.txt
  4.  
  5.   if (!$file(%f_s)) { echo 4 -st $prefixsys ERROR: $qt(%f_s) Missing or is empty! | return }
  6.   if (!$file(%f_p)) { echo 4 -st $prefixsys ERROR: $qt(%f_p) Missing or is empty! | return }
  7.  
  8.   if (!%proxynum) { set -e %proxynum 2 }
  9.   else { inc -e %proxynum 1 }
  10.  
  11.   var %d = $read(%f_p,n,%proxynum)
  12.  
  13.   if (!%d) { echo 4 -st $prefixsys ERROR: Could not read the next proxy on startup, $qt(%d) is incorrect! | return }
  14.  
  15.   proxy -m5 on %d
  16.  
  17.   var %t = $lines(%f_s)
  18.   var %i = 1
  19.   while (%i <= %t) {
  20.     var %r = $read(%f_s,n,%i)
  21.  
  22.     if (!%r) { goto next }
  23.  
  24.     server $iif(%i !== 1,-m) %r
  25.  
  26.     echo 2 -st $prefixsys Trying to connect on %r using %d proxy...
  27.  
  28.     .timer[PROXY_ $+ $activecid $+ ] -o 1 10 next_proxy $activecid
  29.  
  30.     :next
  31.     inc %i
  32.   }
  33. }
  34.  
  35. ON *:CONNECT: { .timer[PROXY_ $+ $cid $+ ] off }
  36. ON *:DISCONNECT: { .timer[PROXY_ $+ $cid $+ ] -o 1 10 next_proxy $cid }
  37. ON *:ERROR: { .timer[PROXY_ $+ $cid $+ ] -o 1 10 next_proxy $cid }
  38.  
  39. alias next_proxy {
  40.   if (!$1) || (!$scid($1)) { return }
  41.  
  42.   var %f_p = proxylist.txt
  43.  
  44.   if (!$file(%f_p)) { echo 4 -st $prefixsys ERROR: $qt(%f_p) Missing or is empty! | .timer[PROXY_*] off | return }
  45.  
  46.   if (!%proxynum) { set -e %proxynum 2 }
  47.   else { inc -e %proxynum 1 }
  48.  
  49.   var %r = $read(%f_p,n,%proxynum)
  50.  
  51.   if (!%r) { echo 4 -st $prefixsys ERROR: Could not read the next proxy, $qt(%r) is incorrect! | .timer[PROXY_*] off | return }
  52.  
  53.   var %s = $scid($1).server
  54.   var %p = $scid($1).port
  55.  
  56.   scid $1 echo 2 -st $prefixsys Trying to connect on %s $+ : $+ %p using %r proxy...
  57.  
  58.   proxy -m5 on %r
  59.  
  60.   scid $1 server %s $+ : $+ %p
  61.  
  62.   .timer[PROXY_ $+ $1 $+ ] -o 1 30 next_proxy $1
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement