You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add this new function - Cosmos.System.Power.GetBatteryPercentage(); - Returns the value of how many percent the battery is, this function only works for laptop users, if the user is running a desktop, it does nothing, this function can be used in an if statement to do something if the battery percentage is of a certain level, for example:
"if (Cosmos.System.Power.GetBatteryPercentage(); == 0) {
Console.WriteLine("Battery has run out, shutting down...");
System.Threading.Thread.Sleep(1);
Cosmos.System.Power.Shutdown();
}
".
The text was updated successfully, but these errors were encountered:
Add this new function - Cosmos.System.Power.GetBatteryPercentage(); - Returns the value of how many percent the battery is, this function only works for laptop users, if the user is running a desktop, it does nothing, this function can be used in an if statement to do something if the battery percentage is of a certain level, for example:
"if (Cosmos.System.Power.GetBatteryPercentage(); == 0) {
Console.WriteLine("Battery has run out, shutting down...");
System.Threading.Thread.Sleep(1);
Cosmos.System.Power.Shutdown();
}
".
The text was updated successfully, but these errors were encountered: