Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ON *:START: {
- var %f_s = servers.txt
- var %f_p = proxylist.txt
- if (!$file(%f_s)) { echo 4 -st $prefixsys ERROR: $qt(%f_s) Missing or is empty! | return }
- if (!$file(%f_p)) { echo 4 -st $prefixsys ERROR: $qt(%f_p) Missing or is empty! | return }
- if (!%proxynum) { set -e %proxynum 2 }
- else { inc -e %proxynum 1 }
- var %d = $read(%f_p,n,%proxynum)
- if (!%d) { echo 4 -st $prefixsys ERROR: Could not read the next proxy on startup, $qt(%d) is incorrect! | return }
- proxy -m5 on %d
- var %t = $lines(%f_s)
- var %i = 1
- while (%i <= %t) {
- var %r = $read(%f_s,n,%i)
- if (!%r) { goto next }
- server $iif(%i !== 1,-m) %r
- echo 2 -st $prefixsys Trying to connect on %r using %d proxy...
- .timer[PROXY_ $+ $activecid $+ ] -o 1 10 next_proxy $activecid
- :next
- inc %i
- }
- }
- ON *:CONNECT: { .timer[PROXY_ $+ $cid $+ ] off }
- ON *:DISCONNECT: { .timer[PROXY_ $+ $cid $+ ] -o 1 10 next_proxy $cid }
- ON *:ERROR: { .timer[PROXY_ $+ $cid $+ ] -o 1 10 next_proxy $cid }
- alias next_proxy {
- if (!$1) || (!$scid($1)) { return }
- var %f_p = proxylist.txt
- if (!$file(%f_p)) { echo 4 -st $prefixsys ERROR: $qt(%f_p) Missing or is empty! | .timer[PROXY_*] off | return }
- if (!%proxynum) { set -e %proxynum 2 }
- else { inc -e %proxynum 1 }
- var %r = $read(%f_p,n,%proxynum)
- if (!%r) { echo 4 -st $prefixsys ERROR: Could not read the next proxy, $qt(%r) is incorrect! | .timer[PROXY_*] off | return }
- var %s = $scid($1).server
- var %p = $scid($1).port
- scid $1 echo 2 -st $prefixsys Trying to connect on %s $+ : $+ %p using %r proxy...
- proxy -m5 on %r
- scid $1 server %s $+ : $+ %p
- .timer[PROXY_ $+ $1 $+ ] -o 1 30 next_proxy $1
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement