ShareShortcuts

Thời gian sạc

Kiểm tra thời gian sạc đầy đến 100%

khaicute2009
Fork “Thời gian sạc”

Built something new on top of this Shortcut? Share it as a fork: it becomes a Shortcut of your own, which you manage, and both pages link to each other so khaicute2009 gets credit.

  1. 1Get the Shortcut and change it in the Shortcuts app. Give it a name of its own.
  2. 2Share it from the Shortcuts app and copy the iCloud link.
  3. 3Come back here, paste the link and describe what is different, e.g. “Added a step that uses Apple Intelligence to personalise the text.”
Downloads
43K
Saved
0
Actions
18
Category
Utilities
Version
1.0
Language
VI

Kiểm tra thời gian sạc đầy đến 100%

What's New

Version 1.0

First release

Version History
1.0 Mar 11, 2022

First release

What it does

18 actions
  1. Get Battery Level
  2. Calculate
  3. Set Variable
    battery needed
  4. Calculate
  5. Calculate
  6. Round Number
  7. Set Variable
    time left
  8. If
  9. Calculate
  10. Set Variable
    minutes
  11. Show Result
  12. If
  13. If
  14. Calculate
  15. Set Variable
    minutes
  16. Show Result
  17. If
  18. Show Result

View as code
Beta

Every action of this Shortcut written out as Cherri, a programming language for Shortcuts. Great for learning how it works.

#include 'actions/math'
#include 'actions/device'
#define color green
#define glyph rectangleSplitThreeOutline

const McPin = getBatteryLevel()
@BatteryNeeded = 100 - McPin
const RsultatDuCalcul = @BatteryNeeded * 110
const RsultatDuCalcul1 = RsultatDuCalcul / 60
round(RsultatDuCalcul1)
@TimeLeft

if @TimeLeft > 120 {
	@minutes = @TimeLeft - 120
	show("Máy của bạn đang ở {McPin}%\nNó sẽ mất 2 tiếng và {@minutes} phút để sạc đến 100%")
}

if @TimeLeft > 60 {
	if @TimeLeft <= 120 {
		@minutes = @TimeLeft - 60
		show("Máy của bạn đang ở{McPin}%\nNó sẽ mất 1 tiếng và {@minutes} phút để sạc đến 100%")
	}
} else {
	show("Máy của bạn đang ở {McPin}%\nNó sẽ mất {@TimeLeft} phút để sạc đến 100%")
}
Open in Cherri Playground Decompiled with cherri 2.3.0 (GPL-2.0). May need small fixes before it compiles.

Ratings & Reviews

Write a Review
–
out of 5
★★★★★
★★★★
★★★
★★
★
0 ratings

No reviews yet. Be the first to share what you think!

Advertisement

You Might Also Like

See All
Advertisement