0% found this document useful (0 votes)
289 views1 page

Scrip Buat Bot Telegram

The document contains scripts that run on login and logout of a wireless hotspot user. On login, it collects user data like IP address, mac address, device, packet and bandwidth usage. This data is sent in a Telegram message. On logout, similar user data is collected and sent in a Telegram message indicating the user has logged out.

Uploaded by

asal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
289 views1 page

Scrip Buat Bot Telegram

The document contains scripts that run on login and logout of a wireless hotspot user. On login, it collects user data like IP address, mac address, device, packet and bandwidth usage. This data is sent in a Telegram message. On logout, similar user data is collected and sent in a Telegram message indicating the user has logged out.

Uploaded by

asal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

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}

You might also like