Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Script Auto Login Wifi.id dengan Mikrotik
: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 "WIFI";
:local gwp "WAG-DX-PTR";
:local mdlan "MSTMA000xx-N/TLK-CI-xx33x:xxx";
:local type "WzMS";
:while (true) do={
:do {
:delay 10;
: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 "xxx"
:set password "xxx"
:set url "$gurl/wms/auth/authnew/autologin/quarantine.php\?$vrab"
:set post "username_=$username&username=$username.uZLs%40freeMS&password=$password"
};
log warning ("Internet Mati Memulai Koneksi Ulang | $gip | $gmc | $type | $currentQueue");
:set currentQueue 0;
:do {
/interface disable $int
:delay 5;
/interface enable $int
:delay 10
} on-error={
log warning ("Error set");
};
:do {
:local result [/tool fetch http-method=post http-data=$post url=$url http-header-field="User-Agent: Indihomo" 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);
};
}
@Choirrulloh

This comment has been minimized.

Copy link

@Choirrulloh Choirrulloh commented Jun 25, 2020

Terima kasih mas, scriptnya work.

Ini jika saya perhatikan kurang lebih 1 menit pengecekan scriptnya. Bisakah saya ubah menjadi 10 detik?

@DzikrRully

This comment has been minimized.

Copy link

@DzikrRully DzikrRully commented Oct 14, 2020

Om, bagaimana untuk login pakai komunitas smartbisnis?

@tatangsy

This comment has been minimized.

Copy link

@tatangsy tatangsy commented Oct 26, 2020

mas kira yang dirubahnya apa saja ya..
maaf saya orang yg masih awam..
terima kasih

@tony-el

This comment has been minimized.

Copy link

@tony-el tony-el commented Oct 31, 2020

masih work kah??

@Tjandra-91

This comment has been minimized.

Copy link

@Tjandra-91 Tjandra-91 commented Apr 19, 2021

maksih bang scr-nya mantap tapi setelah beberapa minggu
log warningnya LOCK PROSES dan jadi g conenct gmna itu bang ya??
barang kali ada ada pencerahannnya bang akbar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment