Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:网页插件¥js_url¥global_计时器掌控者@base64://Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICAgICDorqHml7blmajmjozmjqfogIV86KeG6aKR5bm/5ZGK6Lez6L+HfOinhumikeW5v+WRiuWKoOmAn+WZqAovLyBAbmFtZTplbiAgICAgICAgIFRpbWVySG9va2VyCi8vIEBuYW1lc3BhY2UgICAgICAgaHR0cHM6Ly9naXRlZS5jb20vSEdKaW5nL2V2ZXJ0aGluZy1ob29rLwovLyBAaG9tZXBhZ2VVUkwgICAgIGh0dHBzOi8vdGltZXIucGFsZXJvY2suY24KLy8gQGRvd25sb2FkVVJMICAgICBodHRwczovL3BhbGVyb2NrLmNuL25vZGUtc2VydmljZS9zY3JpcHRzL2luc3RhbGwvQGhvb2stanNfdGltZXIvaG9vay50aW1lci51c2VyLmpzCi8vIEB1cGRhdGVVUkwgICAgICAgaHR0cHM6Ly9wYWxlcm9jay5jbi9ub2RlLXNlcnZpY2Uvc2NyaXB0cy91cGRhdGUvQGhvb2stanNfdGltZXIvaG9vay50aW1lci51c2VyLmpzCi8vIEB2ZXJzaW9uICAgICAgICAgMi4wLjExCi8vIEBkZXNjcmlwdGlvbiAgICAg5o6n5Yi2572R6aG16K6h5pe25Zmo6YCf5bqmfOWKoOmAn+i3s+i/h+mhtemdouiuoeaXtuW5v+WRinzop4bpopHlv6vov5vvvIjmhaLmlL7vvIl86Lez6L+H5bm/5ZGKfOaUr+aMgeWHoOS5juaJgOaciee9kemhtS4KLy8gQGRlc2NyaXB0aW9uOmVuICBpdCBjYW4gaG9vayB0aGUgdGltZXIgc3BlZWQgdG8gY2hhbmdlLgovLyBAaW5jbHVkZSAgICAgICAgICoKLy8gQGF1dGhvciAgICAgICAgICBDYW5nc2hpCi8vIEBydW4tYXQgICAgICAgICAgZG9jdW1lbnQtc3RhcnQKLy8gQGdyYW50ICAgICAgICAgICB1bnNhZmVXaW5kb3cKCi8vIEBncmFudCAgICAgICAgICAgR01fc2V0VmFsdWUKLy8gQGdyYW50ICAgICAgICAgICBHTV9nZXRWYWx1ZQovLyBAZ3JhbnQgICAgICAgICAgIEdNX2xpc3RWYWx1ZXMKLy8gQGdyYW50ICAgICAgICAgICBHTV9kZWxldGVWYWx1ZQovLyBAZ3JhbnQgICAgICAgICAgIEdNX2FkZFZhbHVlQ2hhbmdlTGlzdGVuZXIKLy8gQGdyYW50ICAgICAgICAgICBHTV9yZW1vdmVWYWx1ZUNoYW5nZUxpc3RlbmVyCi8vIEBncmFudCAgICAgICAgICAgR01fbG9nCi8vIEBncmFudCAgICAgICAgICAgR01fcmVnaXN0ZXJNZW51Q29tbWFuZAovLyBAZ3JhbnQgICAgICAgICAgIEdNX3VucmVnaXN0ZXJNZW51Q29tbWFuZAovLyBAZ3JhbnQgICAgICAgICAgIEdNX29wZW5JblRhYgovLyBAZ3JhbnQgICAgICAgICAgIEdNX3htbGh0dHBSZXF1ZXN0Ci8vIEBncmFudCAgICAgICAgICAgR01fZ2V0VGFiCi8vIEBncmFudCAgICAgICAgICAgR01fc2F2ZVRhYgovLyBAZ3JhbnQgICAgICAgICAgIEdNX25vdGlmaWNhdGlvbgovLyBAZ3JhbnQgICAgICAgICAgIEdNX3NldENsaXBib2FyZAoKLy8gQGdyYW50ICAgICAgICAgICBHTS5kZWxldGVWYWx1ZQovLyBAZ3JhbnQgICAgICAgICAgIEdNLmdldFZhbHVlCi8vIEBncmFudCAgICAgICAgICAgR00ubGlzdFZhbHVlcwovLyBAZ3JhbnQgICAgICAgICAgIEdNLnNldFZhbHVlCgovLyBAZ3JhbnQgICAgICAgICAgIEdNLmdldFJlc291cmNlVXJsCi8vIEBncmFudCAgICAgICAgICAgR00ubm90aWZpY2F0aW9uCi8vIEBncmFudCAgICAgICAgICAgR00ucmVnaXN0ZXJNZW51Q29tbWFuZAovLyBAZ3JhbnQgICAgICAgICAgIEdNLnhtbEh0dHBSZX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90aF90aW1lcyB7XG4gICAgICAgICAgICAtd2Via2l0LWJveC1zaGFkb3c6ICIpLmNvbmNhdCh0aGlzLmRlZXBseUNvbG9yPyI0cHggNXB4IDEwcHggNnB4ICNiMmIyYjIiOiItM3B4IDRweCAxMnB4IC01cHggYmxhY2siLCI7XG4gICAgICAgICAgICBib3gtc2hhZG93OiAiKS5jb25jYXQodGhpcy5kZWVwbHlDb2xvcj8iNHB4IDVweCAxMHB4IDZweCAjYjJiMmIyIjoiLTNweCA0cHggMTJweCAtNXB4IGJsYWNrIiwiO1xuICAgICAgICB9XG5cbiAgICAgICAgLl90aC1jb250YWluZXI6aG92ZXIgLl90aC1pdGVtLl9pdGVtLXgyIHtcbiAgICAgICAgICAgIG1hcmdpbi0iKS5jb25jYXQodCwiOiAxOHB4O1xuICAgICAgICAgICAgd2lkdGg6IDQwcHg7XG4gICAgICAgICAgICBoZWlnaHQ6IDQwcHg7XG4gICAgICAgICAgICBsaW5lLWhlaWdodDogNDBweFxuICAgICAgICB9XG5cbiAgICAgICAgLl90aC1jb250YWluZXI6aG92ZXIgLl90aC1pdGVtLl9pdGVtLXgtMiB7XG4gICAgICAgICAgICBtYXJnaW4tIikuY29uY2F0KHQsIjogMTdweDtcbiAgICAgICAgICAgIHdpZHRoOiAzOHB4O1xuICAgICAgICAgICAgaGVpZ2h0OiAzOHB4O1xuICAgICAgICAgICAgbGluZS1oZWlnaHQ6IDM4cHhcbiAgICAgICAgfVxuXG4gICAgICAgIC5fdGgtY29udGFpbmVyOmhvdmVyIC5fdGgtaXRlbS5faXRlbS14eDIge1xuICAgICAgICAgICAgd2lkdGg6IDM2cHg7XG4gICAgICAgICAgICBoZWlnaHQ6IDM2cHg7XG4gICAgICAgICAgICBtYXJnaW4tIikuY29uY2F0KHQsIjogMTZweDtcbiAgICAgICAgICAgIGxpbmUtaGVpZ2h0OiAzNnB4XG4gICAgICAgIH1cblxuICAgICAgICAuX3RoLWNvbnRhaW5lcjpob3ZlciAuX3RoLWl0ZW0uX2l0ZW0teHgtMiB7XG4gICAgICAgICAgICB3aWR0aDogMzJweDtcbiAgICAgICAgICAgIGhlaWdodDogMzJweDtcbiAgICAgICAgICAgIGxpbmUtaGVpZ2h0OiAzMnB4O1xuICAgICAgICAgICAgbWFyZ2luLSIpLmNvbmNhdCh0LCI6IDE0cHhcbiAgICAgICAgfVxuXG4gICAgICAgIC5fdGgtY29udGFpbmVyOmhvdmVyIC5fdGgtaXRlbS5faXRlbS1yZXNldCB7XG4gICAgICAgICAgICB3aWR0aDogMzBweDtcbiAgICAgICAgICAgIGxpbmUtaGVpZ2h0OiAzMHB4O1xuICAgICAgICAgICAgaGVpZ2h0OiAzMHB4O1xuICAgICAgICAgICAgbWFyZ2luLSIpLmNvbmNhdCh0LCI6IDEwcHhcbiAgICAgICAgfVxuXG4gICAgICAgIC5fdGgtY2xpY2staG92ZXIge1xuICAgICAgICAgICAgcG9zaXRpb246IHJlbGF0aXZlO1xuICAgICAgICAgICAgLXdlYmtpdC10cmFuc2l0aW9uOiBhbGwgLjVzO1xuICAgICAgICAgICAgLW8tdHJhbnNpdGlvbjogYWxsIC41cztcbiAgICAgICAgICAgIHRyYW5zaXRpb246IGFsbCAuNXM7XG4gICAgICAgICAgICBoZWlnaHQ6IDQ1cHg7XG4gICAgICAgICAgICB3aWR0aDogNDVweDtcbiAgICAgICAgICAgIGN1cnNvcjogcG9pbnRlcjtcbiAgICAgICAgICAgIG9wYWNpdHk6IC42O1xuICAgICAgICAgICAgYm9yZGVyLXJhZGl1czogMTAwJTtcbiAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6IGFxdWFtYXJpbmU7XG4gICAgICAgICAgICB0ZXh0LWFsaWduOiBjZW50ZXI7XG4gICAgICAgICAgICBsaW5lLWhlaWdodDogNDVweDtcbiAgICAgICAgICAgICIpLmNvbmNhdChuLCI6IDBcbiAgICAgICAgfVxuXG4gICAgICAgIC5fdGgtY29udGFpbmVyOmhvdmVyIHtcbiAgICAgICAgICAgICIpLmNvbmNhdCh0LCI6IC01cHhcbiAgICAgICAgfVxuXG4gICAgICAgIC5fdGgtY29udGFpbmVyIHtcbiAgICAgICAgICAgIGZvbnQtc2l6ZTogMTJweDtcbiAgICAgICAgICAgIC13ZWJraXQtdHJhbnNpdGlvbjogYWxsIC41cztcbiAgICAgICAgICAgIC1vLXRyYW5zaXRpb246IGFsbCAuNXM7XG4gICAgICAgICAgICB0cmFuc2l0aW9uOiBhbGwgLjVzO1xuICAgICAgICAgICAgIikuY29uY2F0KHQsIjogLTMwcHg7XG4gICAgICAgICAgICB0b3A6ICIpLmNvbmNhdChlLCI7XG4gICAgICAgICAgICBwb3NpdGlvbjogZml4ZWQ7XG4gICAgICAgICAgICAtd2Via2l0LWJveC1zaXppbmc6IGJvcmRlci1ib3g7XG4gICAgICAgICAgICBib3gtc2l6aW5nOiBib3JkZXItYm94O1xuICAgICAgICAgICAgei1pbmRleDogMTAwMDAwO1xuICAgICAgICAgICAgLXdlYmtpdC11c2VyLXNlbGVjdDogbm9uZTtcbiAgICAgICAgICAgIC1tb3otdXNlci1zZWxlY3Q6IG5vbmU7XG4gICAgICAgICAgICAtbXMtdXNlci1zZWxlY3Q6IG5vbmU7XG4gICAgICAgICAgICB1c2VyLXNlbGVjdDogbm9uZTtcbiAgICAgICAgICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgICAgICAgICB3aWR0aDogNThweDtcbiAgICAgICAgICAgIC1tcy1mbGV4LXdyYXA6IHdyYXA7XG4gICAgICAgICAgICAgICAgZmxleC13cmFwOiB3cmFwO1xuICAgICAgICAgICAgLXdlYmtpdC1ib3gtb3JpZW50OiBob3Jpem9udGFsO1xuICAgICAgICAgICAgLXdlYmtpdC1ib3gtZGlyZWN0aW9uOiAiKS5jb25jYXQocj8ibm9ybWFsIjoicmV2ZXJzZSIsIjtcbiAgICAgICAgICAgIC1tcy1mbGV4LWRpcmVjdGlvbjogIikuY29uY2F0KHI/InJvdyI6InJvdy1yZXZlcnNlIiwiO1xuICAgICAgICAgICAgICAgICAgICBmbGV4LWRpcmVjdGlvbjogIikuY29uY2F0KHI/InJvdyI6InJvdy1yZXZlcnNlIiwiO1xuICAgICAgICB9XG5cbiAgICAgICAgLl90aC1jb250YWluZXIgLl90aC1pdGVtOmhvdmVyIHtcbiAgICAgICAgICAgIG9wYWNpdHk6IC44O1xuICAgICAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogIzVmYjQ5MjtcbiAgICAgICAgICAgIGNvbG9yOiBhbGljZWJsdWVcbiAgICAgICAgfVxuXG4gICAgICAgIC5fdGgtY29udGFpbmVyIC5fdGgtaXRlbTphY3RpdmUge1xuICAgICAgICAgICAgb3BhY2l0eTogLjk7XG4gICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiAjMWIzYTI2O1xuICAgICAgICAgICAgY29sb3I6IGFsaWNlYmx1ZVxuICAgICAgICB9XG5cbiAgICAgICAgLl90aC1jb250YWluZXI6aG92ZXIgLl90aC1jbGljay1ob3ZlciB7XG4gICAgICAgICAgICBvcGFjaXR5OiAuOFxuICAgICAgICB9XG5cbiAgICAgICAgLl90aC1jb250YWluZXI6aG92ZXIgLl90aC1pdGVtIHtcbiAgICAgICAgICAgIG9wYWNpdHk6IC42O1xuICAgICAgICAgICAgIikuY29uY2F0KG4sIjogMFxuICAgICAgICB9XG5cbiAgICAgICAgLl90aC1jb250YWluZXIgLl90aC1jbGljay1ob3Zlcjpob3ZlciB7XG4gICAgICAgICAgICBvcGFjaXR5OiAuODtcbiAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICM1ZmI0OTI7XG4gICAgICAgICAgICBjb2xvcjogYWxpY2VibHVlXG4gICAgICAgIH1cblxuICAgICAgICAuX3RoX2NvdmVyLWFsbC1zaG93LXRpbWVzIHtcbiAgICAgICAgICAgIHBvc2l0aW9uOiBmaXhlZDtcbiAgICAgICAgICAgIHRvcDogMDtcbiAgICAgICAgICAgICIpLmNvbmNhdChuLCI6IDA7XG4gICAgICAgICAgICB3aWR0aDogMTAwJTtcbiAgICAgICAgICAgIGhlaWdodDogMTAwJTtcbiAgICAgICAgICAgIHotaW5kZXg6IDk5OTk5O1xuICAgICAgICAgICAgb3BhY2l0eTogMTtcbiAgICAgICAgICAgIGZvbnQtd2VpZ2h0OiA5MDA7XG4gICAgICAgICAgICBmb250LXNpemU6IDMwcHg7XG4gICAgICAgICAgICBjb2xvcjogIzRmNGY0ZjtcbiAgICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6IHJnYmEoMCwgMCwgMCwgMC4xKVxuICAgICAgICB9XG5cbiAgICAgICAgLl90aF9jb3Zlci1hbGwtc2hvdy10aW1lcy5fdGhfaGlkZGVuIHtcbiAgICAgICAgICAgIHotaW5kZXg6IC05OTk5OTtcbiAgICAgICAgICAgIG9wYWNpdHk6IDA7XG4gICAgICAgICAgICAtd2Via2l0LXRyYW5zaXRpb246IDFzIGFsbDtcbiAgICAgICAgICAgIC1vLXRyYW5zaXRpb246IDFzIGFsbDtcbiAgICAgICAgICAgIHRyYW5zaXRpb246IDFzIGFsbFxuICAgICAgICB9XG5cbiAgICAgICAgLl90aF9jb3Zlci1hbGwtc2hvdy10aW1lcyAuX3RoX3RpbWVzIHtcbiAgICAgICAgICAgIHdpZHRoOiAzMDBweDtcbiAgICAgICAgICAgIGhlaWdodDogMzAwcHg7XG4gICAgICAgICAgICBib3JkZXItcmFkaXVzOiA1MCU7XG4gICAgICAgICAgICBiYWNrZ3JvdW5kLWNvbG9yOiByZ2JhKDEyNywgMjU1LCAyMTIsIDAuNTEpO1xuICAgICAgICAgICAgdGV4dC1hbGlnbjogY2VudGVyO1xuICAgICAgICAgICAgbGluZS1oZWlnaHQ6IDMwMHB4O1xuICAgICAgICAgICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgICAgICAgICAgdG9wOiA1MCU7XG4gICAgICAgICAgICAiKS5jb25jYXQobiwiOiA1MCU7XG4gICAgICAgICAgICBtYXJnaW4tdG9wOiAtMTUwcHg7XG4gICAgICAgICAgIC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