A simple shortcut that detects whether you are on flight mode (stopping the shortcut), Wi-Fi or Data. Feel free to use in your own shortcuts, no credits needed!
Neue Funktionen
Version 1.0
First release
Was er macht
17 Aktionen-
Show Alert
-
Get IP Address
-
If
-
Show AlertError
-
Stop This Shortcut
-
Get Device Details
-
Wait
-
Get Network Details
-
If
-
CommentThis detects if the user is on Wi-Fi or Data, because shortcuts doesn’t allow us to set variables to custom text, we have to set it to something like the device model instead.
-
Set VariableOn Wi-Fi
-
If
-
Set VariableOn Wi-Fi
-
If
-
Show Alert
-
If
-
Show Alert
Als Code ansehen
Jede Aktion dieses Kurzbefehls als Cherri ausgeschrieben, eine Programmiersprache für Kurzbefehle. Ideal, um zu lernen, wie er funktioniert.
#include 'actions/network'
#define color green
confirm("Getting Network Details..")
const CurrentIPAddress = getExternalIP()
if !CurrentIPAddress {
alert("You are on Airplane Mode!", "Error")
stop()
}
getDeviceDetail("Device Model")
wait(3)
const NetworkDetails = getWifiDetail("Network Name")
if NetworkDetails {
// This detects if the user is on Wi-Fi or Data, because shortcuts doesn’t allow us to set variables to custom text, we have to set it to something like the device model instead.
@OnWiFi
} else {
@OnWiFi = nil
}
if @OnWiFi {
confirm("You are using Wi-Fi!")
} else {
confirm("You are using Data!")
}
In Cherri Playground öffnen
Mit cherri 2.3.0 (GPL-2.0) dekompiliert. Eventuell sind kleine Korrekturen nötig, bevor es kompiliert wird.
Bewertungen und Rezensionen
Rezension schreiben–
von 5
★★★★★
★★★★
★★★
★★
★
0 ratings
No reviews yet. Be the first to share what you think!
Werbung
Mehr von gollap-exe
Das gefällt dir vielleicht auch
Werbung