Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
446
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.57 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Redirect Landing > DetectPortal
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author You
  7. // @match *://landing6.wifi.id/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. window.location.href = 'http://detectportal.firefox.com/';
  12.  
  13.  
  14. // ==UserScript==
  15. // @name Cek Koneksi WMS
  16. // @namespace http://tampermonkey.net/
  17. // @version 0.1
  18. // @description Cek Koneksi untuk Auto Login WMS
  19. // @author Laksamadi Guko
  20. // @match *
  21. // @grant none
  22. // ==/UserScript==
  23.  
  24. // script ini khusus untuk reaspberry pi yang digunakan untuk monitor autologin WMS, bukan untuk pc yang digunakan sehari hari.
  25.  
  26. window.onload=function(){
  27.  
  28. setInterval(function() {
  29. ping('https://google.com/').then(function(delta) {
  30. window.location.href = 'http://detectportal.firefox.com/';
  31. }).catch(function(err) {
  32. window.location.href = 'http://detectportal.firefox.com/';
  33. //contoh url : https://welcome2.wifi.id/wms/?gw_id=WAG-D5-RKT&client_mac=18:a6:f7:1c:8a:17&wlan=SBKPS00359/TKL-W132151960-0001:KEMANGI%2041@WIFI.ID
  34. // sesuaikan URL-LOGIN-WMS dengan kondisi masing-masing
  35. });
  36. }, 15000);
  37.  
  38. }
  39.  
  40. // pingjs https://github.com/jdfreder/pingjs
  41.  
  42. (function (root, factory) { if (typeof define === 'function' && define.amd) { define([], factory); } else if (typeof module === 'object' && module.exports) { module.exports = factory(); } else { root.ping = factory(); }
  43. }(this, function () {
  44.  
  45. /**
  46. * Creates and loads an image element by url.
  47. * @param {String} url
  48. * @return {Promise} promise that resolves to an image element or
  49. * fails to an Error.
  50. */
  51. function request_image(url) {
  52. return new Promise(function(resolve, reject) {
  53. var img = new Image();
  54. img.onload = function() { resolve(img); };
  55. img.onerror = function() { reject(url); };
  56. img.src = url + '?random-no-cache=' + Math.floor((1 + Math.random()) * 0x10000).toString(16);
  57. });
  58. }
  59.  
  60. /**
  61. * Pings a url.
  62. * @param {String} url
  63. * @param {Number} multiplier - optional, factor to adjust the ping by. 0.3 works well for HTTP servers.
  64. * @return {Promise} promise that resolves to a ping (ms, float).
  65. */
  66. function ping(url, multiplier) {
  67. return new Promise(function(resolve, reject) {
  68. var start = (new Date()).getTime();
  69. var response = function() {
  70. var delta = ((new Date()).getTime() - start);
  71. delta *= (multiplier || 1);
  72. resolve(delta);
  73. };
  74. request_image(url).then(response).catch(response);
  75.  
  76. // Set a timeout for max-pings, 5s.
  77. setTimeout(function() { reject(Error('Timeout')); }, 5000);
  78. });
  79. }
  80.  
  81. return ping;
  82. }));
  83.  
  84.  
  85.  
  86. // ==UserScript==
  87. // @name Auto Login WMS
  88. // @namespace http://tampermonkey.net/
  89. // @version 0.1
  90. // @description Auto Login WMS
  91. // @author Laksamadi Guko
  92. // @match *://welcome2.wifi.id/wms/*
  93. // @grant none
  94. // ==/UserScript==
  95.  
  96. window.onload=function(){
  97. setInterval(autoLogin,5000);
  98. }
  99.  
  100. function autoLogin(){
  101. var username = "ijal";
  102. var password = "1234567890pp";
  103. document.getElementById("username").value = username;
  104. document.getElementById("password").value = password;
  105. if(document.getElementsByClassName("button-lg").length>0){
  106. document.getElementsByClassName("button-lg")[0].click();
  107. }
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement