ONLOGIN
:put (",,0,,,,Disable,");{:local mac $"mac-address";
:local Mwp [/ip hotspot user get [find name="$user"] uptime];
:local dvc [/ip dhcp-server lease get [find mac-address="$mac"] host-name];
:local Mpkt [/ip hotspot user get [find name="$user"] profile];
:local Md [/ip hotspot user get [find name="$user"] bytes-in];
:local Mu [/ip hotspot user get [find name="$user"] bytes-out];
:local limit [/ip hotspot user get [find name="$user"] limit-bytes-total];
:local totq [(($limit)/1048576)];
:local Mt [((($Md)+($Mu))/1048576)];
:local sisa [($totq-($Md+$Mu)/1048576)];
:local exp [/ip hotspot user get [find name="$user"] comment];
:local Ma [/ip hotspot active print count-only];
/tool fetch url="https://api.telegram.org/bot(TOKEN API)/sendMessage?chat_id=(CHAT
ID)&text====>> MASUK $user %0A- IP Address : $address%0A- Mac Address
: $mac%0A- Device : $dvc%0A- Paket : $Mpkt%0A- Waktu
Terpakai : $Mwp%0A- Jumlah Kuota : $totq Mb%0A- Kuota Terpakai : $Mt Mb
%0A- Sisa Kuota : $sisa Mb%0A- Expired : $exp%0A- Users
Yang Online : $Ma Users" mode=http keep-result=no}
ONLOGOUT
{:local mac $"mac-address";
:local Mwp [/ip hotspot user get [find name="$user"] uptime];
:local dvc [/ip dhcp-server lease get [find mac-address="$mac"] host-name];
:local Mpkt [/ip hotspot user get [find name="$user"] profile];
:local Md [/ip hotspot user get [find name="$user"] bytes-in];
:local Mu [/ip hotspot user get [find name="$user"] bytes-out];
:local limit [/ip hotspot user get [find name="$user"] limit-bytes-total];
:local totq [(($limit)/1048576)];
:local Mt [((($Md)+($Mu))/1048576)];
:local sisa [($totq-($Md+$Mu)/1048576)];
:local exp [/ip hotspot user get [find name="$user"] comment];
:local Ma [/ip hotspot active print count-only];
/tool fetch url="https://api.telegram.org/bot(TOKEN API)/sendMessage?chat_id=(CHAT
ID)&text=<<=== KELUAR $user %0A- IP Address : $address%0A- Mac Address
: $mac%0A- Device : $dvc%0A- Paket : $Mpkt%0A- Waktu
Terpakai : $Mwp%0A- Jumlah Kuota : $totq Mb%0A- Kuota Terpakai : $Mt Mb
%0A- Sisa Kuota : $sisa Mb%0A- Expired : $exp%0A- Users
Yang Online : $Ma Users" mode=http keep-result=no}