Auto Login WMS or Seamless wifi.id - Mikrotik Script RouterOS
How to auto login WMS from wifi.id Telkom Indonesia
WMS stands for "Wifi Managed Service", which is a special wifi internet service from Telkom that allows customers to have 2-3 SSIDs, one of which is SSID for the owner, and the other two are SSID @ wifi.id and seamless@wifi.id.
:local currentQueue 0;
:local nolock true;
:local gurl "https://welcome2.wifi.id";
:local guxx "http://www.msftconnecttest.com/redirect";
:local username "";
:local password "";
:local int "WMS2";
:local gwp "WAG-D1-PBR";
:local mdlan "GPON00-D1-TAK-3BSR%20pon%201/3/22/1:4090:TPNS01@WIFI.ID";
:local type "WMS";
:while (true) do={
:do {
:delay 15s;
:if ([/ping address=8.8.8.8 count=1] = 0) do={
:set currentQueue ($currentQueue +1);
:if ($currentQueue > 3) do={
:if (nolock) do={
:set nolock false;
:global gip [/ip address get [/ip address find interface=$int] address];
:global gip [put [:pick $gip 0 [:find $gip "/"]]];
:global gmc [/interface wireless get $int mac-address];
:global vrab "ipc=$gip&gw_id=$gwp&mac=$gmc&redirect=$guxx&wlan=$mdlan";
:global url "$gurl/authnew/login/check_login.php\?$vrab";
:global post "username=$username@spin2&password=$password";
:if ($type = "WMS") do={
:set username "userWMSmu"
:set password "passWMSmu"
:set url "$gurl/wms/auth/authnew/autologin/quarantine.php\?$vrab"
:set post "username_=$username&username=$username.TrL1@wmslite.123456789.000&password=$password"
};
log warning ("Internet Mati Memulai Koneksi Ulang | $gip | $gmc | $type | $currentQueue");
:set currentQueue 0;
:do {
/interface disable $int
:delay 15s;
/interface enable $int
:delay 15s
} on-error={
log warning ("Error set");
};
:do {
:local result [/tool fetch http-method=post http-data=$post url=$url http-header-field="User-Agent: Mozilla/5.0" as-value output=user];
:if ([:find ($result->"data") "Sukses"] >= 0) do={
log info ("WIFI Kembali Normal")
} else={
:if (($result->"data") = "") do={
log info ("Wifi sudah konek");
} else={
log warning ($result->"data")
};
};
} on-error={
log warning ("Error Cek Internet");
};
:set nolock true;
} else={
log warning ("Lock Proses");
};
};
} else {
# log info ("Wifi Normal");
:set currentQueue 0;
};
} on-error={
log warning ("Error big");
:set currentQueue ($currentQueue +1);
};
}