Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :local send [:parse [/system script get tg_sendMessage source]]
- :local param1 [:pick $params 0 [:find $params " "]]
- :local param2 [:pick $params ([:find $params " "]+1) [:len $params]]
- :local param3 [:pick [:pick $params ([:find $params " "]+1) [:len $params]] ([:find [:pick $params ([:find $params " "]+1) [:len $params]] " "]+1) [:len [:pick $params ([:find $params " "]+1) [:len $params]]]]
- :if ([:len [:find $param2 " "]]>0) do={
- :set param2 [:pick [:pick $params ([:find $params " "]+1) [:len $params]] 0 [:find [:pick $params ([:find $params " "]+1) [:len $params]] " "]]
- } else={
- :set param3 ""
- }
- :put $params
- :put $param1
- :put $param2
- :put $param3
- :put $chatid
- :put $from
- :if ($param1="add") do={
- /ip hotspot user add name=$param2 password=$param3 profile=Mahasiswa
- $send chat=$chatid text=("Username: $param2 Password: $param3 Berhasil dibuat...") mode="Markdown"
- }
- :if ($param1="delete") do={
- /ip hotspot user remove [find name=$param2]
- $send chat=$chatid text=("User: $param2 Berhasil dihapus") mode="Markdown"
- }
- :if ($param1="disable") do={
- /ip hotspot user disable [find name=$param2]
- $send chat=$chatid text=("User: $param2 Berhasil di disable") mode="Markdown"
- }
- :if ($param1="enable") do={
- /ip hotspot user enable [find name=$param2]
- $send chat=$chatid text=("User: $param2 Berhasil di enable") mode="Markdown"
- }
- :if ($param1="setprofil") do={
- /ip hotspot user set password=$param3 [find name=$param2]
- /ip hotspot active remove [find name=$param2]
- $send chat=$chatid text=("User: $param2 Berhasil diganti profile menjadi $param3...") mode="Markdown"
- }
- :if ($param1="pasword") do={
- /ip hotspot user set password=$param3 [find name=$param2]
- /ip hotspot active remove [find name=$param2]
- $send chat=$chatid text=("User: $param2 pasword diganti menjadi $param3...") mode="Markdown"
- }
- :if ($params="print") do={
- :local output
- :foreach activeIndex in=[/ip hotspot active find] do={
- :local activeUser ("*Username:* ".[/ip hotspot active get value-name="user" $activeIndex]."%0A")
- :local activeAddress ("*Address:* ".[/ip hotspot active get value-name="address" $activeIndex]."%0A")
- :local activeMACAddr ("*MAC Address:* ".[/ip hotspot active get value-name="mac-address" $activeIndex]."%0A")
- :local activeLoginBy ("*Login by:* ".[/ip hotspot active get value-name="login-by" $activeIndex]."%0A")
- :local activeUptime ("*Uptime:* ".[/ip hotspot active get value-name="uptime" $activeIndex]."%0A")
- :set output ($output.$activeUser.$activeAddress.$activeMACAddr.$activeUptime.$activeLoginBy."%0A")
- }
- $send chat=$chatid text=("$output") mode="Markdown"
- }
- :if ($param1="user") do={
- :local output
- :foreach activeIndex in=[/ip hotspot user find profile=$param2] do={
- :local byteout [/ip hotspot user get value-name="bytes-out" $activeIndex];
- :local bytein [/ip hotspot user get value-name="bytes-in" $activeIndex];
- :local kuota ("*Kuota Terpakai: * ".(($byteout+$bytein) / 1024 / 1024)."Mb %0A");
- :local user ("*Username:* ".[/ip hotspot user get value-name="name" $activeIndex]."%0A")
- :local password ("*Password:* ".[/ip hotspot user get value-name="password" $activeIndex]."%0A")
- :local uptime ("*Uptime:* ".[/ip hotspot user get value-name="disable" $activeIndex]."%0A")
- :set output ($output.$user.$password.$uptime.$kuota."%0A")
- }
- $send chat=$chatid text=("$output") mode="Markdown"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement