Abusing UIHints for Fun and Profit
juliaschatz
Member, Developers Posts: 8 EDU
I had some fun making an early April Fool's joke about adding microtransactions to my featurescripts. This uses UIHint.REMEMBER_PREVIOUS_VALUE, UIHint.ALWAYS_HIDDEN, and an editing logic function to keep track of how many times someone has used a script and encourages them to buy more uses when they run out. An example of this applied is here.
This isn't practical for this purpose for a few reasons: There's no way to access the internet to verify redemption codes (although large random numbers stored in a private document could work), and all REMEMBER_PREVIOUS_VALUE values are reset when the user changes the version of the script (updates it, for example).
I originally did this just as an experiment about transferring data that the user doesn't interact with between script runs, essentially turning any field marked REMEMBER_PREVIOUS_VALUE into a storage location for anything that can be serialized to a string. This could be used to store configuration information, copy data between part studios, or any number of things.
Hope this is a little bit interesting at least.
Tagged:
9
Comments
-
Onshape developers: We want deterministic behavior for feature regeneration so let's design a new safe language for that.Onshape users: We want microtransactions so let's see, what could we do for that
3 -
Microtransactions in FS for FRC teams. Wow! You have won the Martin Shkreli Generosity Award

Seriously, that's a pretty creative use of the system; I certainly never thought of the interaction of the two UIHints.
BTW (and I know it's still not practical) the way to get around keeping a list of random numbers is to use a secure pseudo-random number generator (https://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator) based on just one secret key.Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc5 -



