hi all this is simple script which found at mikrotik forum , but what im trying is to get more information result .
:local CHID "xxxxx";
:local BotID "xxxxxx";
:local Total [/ip firewall address-list print count-only];
:if ($Total=0) do {
:return true
} else {
:local output
:foreach activeIndex in=[/ip firewall address-list find] do={
:local activeAddress ("".[/ip firewall address-list get value-name="address" $activeIndex]."%0A")
:set output ($output.$activeAddress."%0A")
}
}
/tool fetch url="https://api.telegram.org/bot$BotID/sendmessage\?chat_id=$CHID&text=$output Total Active Address List: $Total";
:delay 10
/file remove [/file find type=""];
with above result finding
im try to get the $activeAddress and locate the /ip hotspot active user
:foreach activeIndex2 in=[/ip hotspot active find where address=$activeAddress] do={
:local activeUser ("*Username*: ".[/ip hotspot active get value-name="user" $activeIndex2]."%0A")
:set output2 ($output2.$activeUser."%0A")
}
this is the result i need,
$activeAddress (eg 10.0.0.1)
$activeUser (abcd)
the first script no issue , please help on the 2nd code, thank you.