low BNB alert

stable
By mimaflexi in Miscellaneous Published May 2024 👁 605 views 💬 0 comments

Description

This simple script is suitable in the case of using cheaper fees through BNB. It monitors the BNB balance, and when it falls below the specified limit, the script will notify via Discord/Telegram about the low balance on the account. dependencies: CC_broadcast
HaasScript
-- low BNB alert
-- Author: MiMaFlexi

--[[

This simple script is suitable in the case of using cheaper fees through BNB. 
It monitors the BNB balance, and when it falls below the specified limit, 
the script will notify via Discord/Telegram about the low balance on the account.

dependencies: CC_broadcast (https://www.haasscripts.com/t/lightly-extended-broadcast/)

]]

HideTradeAmountSettings()
HideOrderSettings()

cfMinAmount = Input("Min. amount", 0.5)
cfName = Input("Name of account", "")
cfBroadcastTo = InputOptions("Broadcast to","all",{"all", "discord", "telegram"},"Where to broadcast in case of low amount")
OptimizedForInterval(0, function()
    currentAmount = BalanceAmount(AccountGuid(),"BNB",PriceMarket())
    if cfMinAmount > currentAmount then 
        CC_broadcast("Low BNB for fees at account: "..cfName..", current amount: "..currentAmount..", need: "..cfMinAmount,false,"all")
        LogWarning("Low BNB for fees!!")
        CustomReport("balance","!! LOW BALANCE !!","Status",true)
        else 
        Log("current amount is ok ("..currentAmount.." BNB)")
        CustomReport("balance","ok","Status",true)
    end
end)

0 Comments

Sign in to leave a comment.

No comments yet. Be the first!