ShareShortcuts

Dice Roller

PLEASE GO TO MY PROFILE TO GET THE LATEST VERSION OF DICE ROLLER

asboy
Fork “Dice Roller”

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 asboy 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
36K
Saved
0
Actions
40
Category
Fun
Version
1.0
Language
EN

Preview

PLEASE GO TO MY PROFILE TO GET THE LATEST VERSION OF DICE ROLLER. THIS IS NOT THE LATEST.

What's New

Version 1.0

First release

Version History
1.0 Dec 14, 2022

First release

What it does

40 actions
  1. If
  2. Text
  3. Set Variable
    Menu
  4. If
  5. Text
  6. Set Variable
    Menu
  7. Dictionary
  8. Text
  9. Set Variable
    iCloudLink
  10. Number
  11. Set Variable
    Save1
  12. Number
  13. Set Variable
    Save2
  14. Number
  15. Set Variable
    Save3
  16. Text
  17. Set Name
  18. Get Contacts from Input
  19. Choose from List
  20. If
  21. Random Number
  22. Run Shortcut
    Dice Roller
  23. If
  24. If
  25. Random Number
  26. Run Shortcut
    Dice Roller
  27. If
  28. If
  29. Random Number
  30. Run Shortcut
    Dice Roller
  31. If
  32. If
  33. Ask for Input
    How many sides?
  34. Random Number
  35. Run Shortcut
    Dice Roller
  36. If
  37. Share
  38. Show Alert
    😎
  39. Text
  40. Run Shortcut
    Dice Roller

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/sharing'
#include 'actions/contacts'
#define color violet
#define glyph dice


if ShortcutInput {
	@Menu = "{ShortcutInput}. How many sides for next roll?"
} else {
	@Menu = "How many sides?"
}
@iCloudLink = "https://www.icloud.com/shortcuts/0a56860ecb564bb88dee26da91216be8"
@Save1 = 4
@Save2 = 6
@Save3 = 20
const Text = "BEGIN:VCARD\nVERSION:3.0\nN:{@Save1}\nPHOTO;ENCODING=b:{['1']}\nEND:VCARD\nBEGIN:VCARD\nVERSION:3.0\nN:{@Save2}\nPHOTO;ENCODING=b:{['2']}\nEND:VCARD\nBEGIN:VCARD\nVERSION:3.0\nN:{@Save3}\nPHOTO;ENCODING=b:{['3']}\nEND:VCARD\nBEGIN:VCARD\nVERSION:3.0\nN:Custom\nPHOTO;ENCODING=b:{['C']}\nEND:VCARD\nBEGIN:VCARD\nVERSION:3.0\nN:Share shortcut\nPHOTO;ENCODING=b:{['S']}\nEND:VCARD"
const RenamedItem = setName(Text, "Menu.vcf")
const Contacts = getContacts(RenamedItem)
const ChosenItem = chooseFromList(Contacts, @Menu)

if ChosenItem['Last Name'] contains @Save1 {
	const RandomNumber = randomNumber(1, @Save1)
	runSelf(RandomNumber)
} else {
	if ChosenItem['Last Name'] contains @Save2 {
		const RandomNumber1 = randomNumber(1, @Save2)
		runSelf(RandomNumber1)
	} else {
		if ChosenItem['Last Name'] contains @Save3 {
			const RandomNumber2 = randomNumber(1, @Save3)
			runSelf(RandomNumber2)
		} else {
			if ChosenItem['Last Name'] contains "Custom" {
				const ProvidedInput = prompt("How many sides?", "Number")
				const RandomNumber3 = randomNumber(1, ProvidedInput)
				runSelf(RandomNumber3)
			} else {
				share(@iCloudLink)
				alert("Thank You for sharing!", "😎")
				const Text1 = "Thank you for sharing"
				runSelf(Text1)
			}
		}
	}
}
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

More by asboy

See All

You Might Also Like

See All
Advertisement