$hostBattery
A Compact Function resolving data about your hosts battery (If applicable) with 14 options to choose from.

FUNCTION USAGE

    $hostBattery[option]

Properties:

option - The data option.

OPTIONS:

Option
Description
capacityunit
The format at which the battery capacity is measured.
current
The host's current remaining battery life measured in Milliwatts (mW)
cyclecount
Returns the number of times the battery has been charged. (Some hosts may return 0. This means the function cannot return the data for the host.)
designedmax
The designed maximum amount of mW the battery can hold.
hasbattery
Returns true if the host device has a battery. Otherwise, function returns false.
ischarging
Returns true if the host device is charging. Otherwise, function returns false.
ispluggedin
Returns true if the host device is plugged in. Otherwise, function returns false.
manufacturer
The name of the manufacturer. (Some hosts may not return data for this option, even if the host device has a battery.)
max
The maximum amount of mW the battery can hold.
model
The model name of the battery.
percent
The percent remaining on the battery life.
timeremaining
Returns the how long the battery has to charge. (Some hosts may return undefined)
type
The type of battery. (Some hosts may not return the data even if the host device has a battery.)
voltage
The voltage at which the battery is pumped at.

Example 1: Returns the voltage the battery is pumped at.

1
bot.Command({
2
name: "test",
3
code: `
4
$hostBattery[voltage]
5
`
6
})
Copied!

Example 2: Returnstrue if the battery is being charged, otherwise returns false.

1
bot.Command({
2
name: "test",
3
code: `
4
$hostBattery[ischarging]
5
`
6
})
Copied!
Last modified 1mo ago
Copy link