ShareShortcuts

Counter

Simple counter for 1 V 1 games like table tennis or tic tac toe

kuba799
Dupliquer « Counter »

Tu as créé quelque chose de nouveau à partir de ce raccourci ? Partage-le comme version dérivée : il devient un raccourci à toi, que tu gères, et les deux pages renvoient l’une vers l’autre pour que kuba799 soit crédité.

  1. 1Obtenez le raccourci et modifiez-le dans l’app Raccourcis. Donnez-lui un nom bien à lui.
  2. 2Partage-le depuis l’app Raccourcis et copie le lien iCloud.
  3. 3Reviens ici, colle le lien et décris ce qui change, par exemple : « Ajout d’une étape qui utilise Apple Intelligence pour personnaliser le texte. »
Créer mon fork
Téléchargements
66K
Enregistré
1
Actions
136
Catégorie
Utilities
Version
2.1
Langue
EN

Aperçu

Simple counter for 1 V 1 games like table tennis or tic tac toe...

...and much more!

Just add names and then click on name that win.

Features:

Automaticly save to Files

Nouveautés

Version 2.1

New EDIT option, bug fixes

Historique des versions
2.1 15 déc. 2020

New EDIT option, bug fixes

2.0 8 nov. 2020

Re-built

1.2 2 sept. 2019

Bug fix, shoother running

1.1 1 sept. 2019

Shortcuts Updater avabile

1.0 1 sept. 2019

First release

Ce qu’il fait

136 actions
  1. Create Folder
  2. Get File
  3. Set Variable
    Counter
  4. If
  5. Get My Shortcuts
  6. If
  7. Dictionary
  8. Run Shortcut
    Swing Updater
  9. If
  10. Text
  11. Choose from Menu
    …
  12. Choose from Menu
    Continue
  13. Choose from Menu
    New counting
  14. Delete Files
  15. Run Shortcut
    Counter
  16. Stop This Shortcut
  17. Choose from Menu
    Delete
  18. Delete Files
  19. Stop This Shortcut
  20. If
  21. If
  22. Show Alert
    No configuration
  23. Repeat
  24. Set Variable
    Name
  25. Ask for Input
    Please, enter name of person n.…:
  26. Set Variable
    Name
  27. Repeat
  28. Get Dictionary Value
  29. If
  30. Text
  31. Ask for Input
    …
  32. Set Variable
    Name
  33. Set Dictionary Value
  34. Set Variable
    Counter
  35. Save File
  36. If
  37. Text
  38. If
  39. Nothing
  40. Choose from Menu
    … person…
  41. Choose from Menu
    Add person
  42. Choose from Menu
    Done
  43. If
  44. Show Notification
    There will be only one person...
  45. Choose from Menu
  46. Choose from Menu
    Yes, I’m sure
  47. Run Shortcut
    Counter 5
  48. Stop This Shortcut
  49. Choose from Menu
    No, add more
  50. If
  51. Run Shortcut
    Counter 5
  52. Stop This Shortcut
  53. Show Notification
    To start, re-open the shortcut.
  54. Stop This Shortcut
  55. Repeat with Each
  56. Get Dictionary Value
  57. Text
  58. Add to Variable
  59. Get Dictionary from Input
  60. If
  61. Get Dictionary Value
  62. If
  63. Set Variable
    Menu
  64. Text
  65. Add to Variable
  66. Choose from List
  67. Set Variable
    ChoosenMenuItem
  68. If
  69. Text
  70. Set Variable
    EditMenu
  71. Add to Variable
  72. Text
  73. Add to Variable
  74. Choose from List
  75. Set Variable
    ChoosenEditMenuItem
  76. If
  77. Repeat
  78. Set Variable
    Name
  79. Count
  80. Calculate
  81. Ask for Input
    Please, enter name of person n.…:
  82. Set Variable
    Name
  83. Repeat
  84. Get Dictionary Value
  85. If
  86. Text
  87. Ask for Input
    …
  88. Set Variable
    Name
  89. Set Dictionary Value
  90. Set Variable
    Counter
  91. Save File
  92. Choose from Menu
    … persons
  93. Choose from Menu
    Add person
  94. Choose from Menu
    Done and continue
  95. Run Shortcut
    Counter
  96. Stop This Shortcut
  97. Show Notification
    To start, re-open the shortcut.
  98. Stop This Shortcut
  99. If
  100. Run Shortcut
    Counter
  101. Stop This Shortcut
  102. Replace Text
  103. Get Dictionary Value
  104. If
  105. Show Notification
    File doesn't contains selected item.
  106. Stop This Shortcut
  107. Text
  108. If
  109. Show Notification
    Unexpected fault.
  110. Ask for Input
    …:
  111. If
  112. Set Dictionary Value
  113. If
  114. Replace Text
  115. If
  116. Replace Text
  117. If
  118. Replace Text
  119. If
  120. Replace Text
  121. If
  122. Show Notification
    Unexpected fault.
  123. Set Variable
    Counter
  124. Save File
  125. Dictionary
  126. Run Shortcut
    Counter
  127. If
  128. Replace Text
  129. Get Dictionary Value
  130. If
  131. Show Notification
    File doesn't contains selected item.
  132. Stop This Shortcut
  133. Calculate
  134. Set Dictionary Value
  135. Save File
  136. Run Shortcut
    Counter 5

Afficher en tant que code
Bêta

Chaque action de ce raccourci écrite en Cherri, un langage de programmation pour Raccourcis. Idéal pour comprendre son fonctionnement.

#include 'actions/text'
#include 'actions/shortcuts'
#include 'actions/documents'
#define color green
#define glyph circledPi

createFolder("counter")
getFile("counter/counter.json", false)
@Counter

if !ShortcutInput {
	const MojeZkratky = getShortcuts()
	if MojeZkratky['Name'] contains "Swing Updater" {
		const Slovnk = {
			"Name": "Counter",
			"RH ID": "7322",
			"Version": "1.1"
		}
		run("Swing Updater", Slovnk)
	}
	if @Counter {
		menu  {
		item "Continue":
		item "New counting":
			deleteFiles(@Counter)
			runSelf()
			stop()
		item "Delete":
			deleteFiles(@Counter)
			stop()
		}
	}
}

if !@Counter {
	if !ShortcutInput {
		alert("Please, set-up names.", "No configuration")
	}
	repeat _ for 20 {
		@Name = nil
		prompt("Please, enter name of person n.{@RepeatIndex}:")
		@Name
		repeat _ for 50 {
			const HodnotaZeSlovnku = getValue(@Counter, @Name)
			if HodnotaZeSlovnku {
				prompt()
				@Name
			}
		}
		setValue(@Counter, @Name, "0")
		@Counter
		saveFile("counter/counter.json", @Counter, true)
		if @RepeatIndex > 1 {
		} else {
		}
		menu "{@RepeatIndex} person{}" {
		item "Add person":
		item "Done":
			if @RepeatIndex <= 1 {
				showNotification("There will be only one person...", "Are you sure?")
				menu "" {
				item "Yes, I’m sure":
					runSelf()
					stop()
				item "No, add more":
				}
			} else {
				runSelf()
				stop()
			}
		}
	}
	showNotification("To start, re-open the shortcut.", "Too much persons")
	stop()
}

for _ in @Counter {
	@RawMenu += "{@RepeatItem}: {}"
}
const Slovnk1 = getDictionary(ShortcutInput)

if Slovnk1['ChoosenMenuItem'] {
	getValue(Slovnk1, "ChoosenMenuItem")
} else {
	@Menu = @RawMenu
	@Menu += "EDIT"
	chooseFromList(@Menu)
}
@ChoosenMenuItem

if @ChoosenMenuItem == "EDIT" {
	@EditMenu = "Add person(s)"
	@EditMenu = @RawMenu
	@EditMenu += "← Back"
	chooseFromList(@EditMenu, "Choose:")
	@ChoosenEditMenuItem
	if @ChoosenEditMenuItem == "Add person(s)" {
		repeat _ for 20 {
			@Name = nil
			const Poet = count(@Counter)
			prompt("Please, enter name of person n.{}:")
			@Name
			repeat _ for 50 {
				const HodnotaZeSlovnku1 = getValue(@Counter, @Name)
				if HodnotaZeSlovnku1 {
					prompt()
					@Name
				}
			}
			setValue(@Counter, @Name, "0")
			@Counter
			saveFile("counter/counter.json", @Counter, true)
			menu "{} persons" {
			item "Add person":
			item "Done and continue":
				runSelf()
				stop()
			}
		}
		showNotification("To start, re-open the shortcut.", "Too much persons")
		stop()
	}
	if @ChoosenEditMenuItem == "← Back" {
		runSelf()
		stop()
	}
	replaceText(": (\d+)$", "", false, true)
	const HodnotaZeSlovnku2 = getValue(@Counter)
	if !HodnotaZeSlovnku2 {
		showNotification("File doesn't contains selected item.", "Error", HodnotaZeSlovnku2)
		stop()
	}
	const Text = "{}: {HodnotaZeSlovnku2}"
	if Text !=  {
		showNotification("Unexpected fault.", "Error")
	}
	const PijatVstup = prompt("{}:", "Number")
	if PijatVstup {
		setValue(@Counter, PijatVstup)
	} else {
		const AktualizovanText = replaceText("\"{}\":{HodnotaZeSlovnku2},", "", @Counter)
		if AktualizovanText == @Counter {
			const AktualizovanText1 = replaceText("\"{}\":{HodnotaZeSlovnku2}", "", @Counter)
			if AktualizovanText1 == @Counter {
				const AktualizovanText2 = replaceText("\"{}\":\"{HodnotaZeSlovnku2}\",", "", @Counter, true)
				if AktualizovanText2 == @Counter {
					const AktualizovanText3 = replaceText("\"{}\":\"{HodnotaZeSlovnku2}\"", "", @Counter, true)
					if AktualizovanText3 == @Counter {
						showNotification("Unexpected fault.", "Error")
					}
				}
			}
		}
	}
	@Counter
	saveFile("counter/counter.json", @Counter, true)
	const Slovnk2 = {
		"ChoosenMenuItem": "EDIT"
	}
	runSelf(Slovnk2)
} else {
	replaceText(": (\d+)$", "", false, true)
	const HodnotaZeSlovnku3 = getValue(@Counter)
	if !HodnotaZeSlovnku3 {
		showNotification("File doesn't contains selected item.", "Error")
		stop()
	}
	const Slovnk3 = setValue(@Counter)
	saveFile("counter/counter.json", Slovnk3, true)
	runSelf()
}
Ouvrir dans Cherri Playground Décompilé avec cherri 2.3.0 (GPL-2.0). Quelques corrections peuvent être nécessaires avant la compilation.

Notes et avis

Écrire un avis
–
sur 5
★★★★★
★★★★
★★★
★★
★
0 ratings

Aucun avis pour le moment. Sois le premier à partager ton avis !

Publicité

Plus de kuba799

Tout afficher

Ça pourrait aussi te plaire

Tout afficher
Publicité