Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Truewifi Auto Login/Logout
- // @version 4.0.5
- // @author Modified by Gusto_R (mrgill created in http://imrgill.com/)
- // @namespace http://www.facebook.com/pages/True-WiFi-Auto-Login/213510638776036
- // @description True Wifi automatic login/re-login script when time is exceed.
- // @include http*://portal.trueinternet.co.th/*
- // ==/UserScript==
- //================ Credential =================
- var username = "7epturdj"; // username
- var password = "3cqq8nrr"; //รหัสผ่าน
- var minute = 180; // เวลาในการใช้งานของคุณ เช่น 90 หรือ 180
- //================ Credential =================
- //var logout_count = 2;
- //================ Variables =================
- var url_success = "wifi-login-success.php"; // login success url
- var url_success_7 = "7-login-success.php"; // login success 7-11 url
- var url_fail = "wifi-logout-fail.php"; // logout fail url
- var url_fail_7 = "7-logout-fail.php"; // logout fail 7-11 url
- var url_login = "wifi-login.php"; // login url
- var url_login_7 = "7-login.php"; // login 7-11 url
- var url_logout_success = "wifi-logout-success.php"; // logout success url
- var url_logout_success_7 = "7-logout-success.php"; // logout success 7-11 url
- var url_to_redirect = "https://portal.trueinternet.co.th/wifiauthen/web/wifi-login-success.php?param=ODA6ODY6ZjI6MjI6MzI6ZjZ8MjAxNTAxMzExMjU1Cg=="; // redirect to this url
- var url_logout = "https://portal.trueinternet.co.th/wifiauthen/logout_result.php"; // logout url
- var url_forRedirect = "http://jokergameth.com"; // logout url
- var url_true = "https://portal.trueinternet.co.th/wifiauthen/web/"; // url of truewifi
- //================ Timer =================
- var tosec = (((minute) * 60 )+15)* 1000; // convert minute to millisecond
- var cooldown = ((minute) * 60)+15; // convert millisecond to second
- //================ Variables =================
- //================ Show Time =================
- if (document.location.href.substring(49,71) == url_success || document.location.href.substring(49,68) == url_success_7) // Check url success
- {
- setInterval(
- function()
- {
- var h = parseInt(cooldown / (60 * 60));
- var m = parseInt((cooldown / 60) % 60);
- var s = parseInt(cooldown % 60);
- document.getElementById('wifi_bottom_bg').innerHTML = "<br><br><div style='text-align:center;'><span style='text-align:center;font-weight:bold;color:orange;font-size:x-large;'>Time left " + h + ":" + m + ":" + s + "</span></div>";
- document.title = "TrueWiFi " + h + ":" + m + ":" + s;
- cooldown--;
- }
- ,1000
- );
- }
- else if (document.location.href.substring(49,72) == url_logout_success || document.location.href.substring(49,69) == url_logout_success_7) // Check url Logout success
- {
- document.location = url_forRedirect;
- }
- else if (document.location.href.substring(49,69) == url_fail || document.location.href.substring(49,66) == url_fail_7) // Check url Logout fail
- {
- window.setTimeout(
- function()
- {
- document.location = url_logout;
- },
- 5000
- );
- window.setTimeout(
- function()
- {
- document.location = url_logout;
- },
- 5000
- );
- // document.location = url_logout;
- //document.location = url_logout;
- document.location = url_forRedirect;
- }
- else if (document.location.href.substring(49,63) == url_login || document.location.href.substring(49,60) == url_login_7 || document.location.href.substring(49,63) =="wifi-login.php") // Check url Login
- {
- document.getElementById('username').value = username;
- document.getElementsByName("password")[0].value = password;
- document.forms[0].submit();
- }
- else if(document.location.href == "2th.me")
- {
- document.location = url_logout;
- }
- //================ Show Time =================
- //================ Timer to redirect =========
- window.setTimeout(
- function()
- {
- if (document.location.href.substring(49,71) == url_success) { // Check url Login success
- document.location = url_forRedirect;
- } else if (document.location.href.substring(49,68) == url_success_7) { // Check url Login 7-11 success
- document.location = url_forRedirect;
- }
- },
- tosec
- );
- //================ Timer to redirect =========
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement