Toying With This Week (11/29-12/05)
Added 2020-11-29 13:55:26 +0000 UTCChanging How Script Connections Work
This work is still ongoing but it should be done today or tomorrow.
Scripts will now connect to parts of a toy instead of an entire toy. So you can write a script for toys with accelerometers or for toys with rotators and have the script work for any toys that have those parts.
I'll basically being using the Input/Output list from www.iostindex.com since that seems extremely comprehensive.
I'm just figuring out how best to handle stroking toys having two 'modes' (stroke speed vs setting a position)...plus the fact that not all strokers are going to have positional controls. And I haven't really solved whether shock collars should have 3 connections (vibrate, tone, shock) or just be their own...thing. I'm pretty sure I'm going to leave them as a separate thing.
Lovense Max/Nora Accelerometer Triggers
This is working great and will go live once I push the script connection changes.
The Handy Integration
This ended up being simple. I had it integrated and working within an hour of it showing up on my doorstep. There's some issues with it failing and switching to a red light sometimes if you have it go too slow...but this appears to be a known issue with the toy and less so something wrong with XToys.
Expression Triggers
The old way I was handling variable triggers only allowed for checking one variable and only against a single operation (ex. is the variable <= 50). This was always going to become an issue for complex scripts.
Math.js to the rescue again though! It supports taking in any expression like 0 <= {var} < 10 and returning whether it's true or false. Math.js isn't designed for comparing strings so I did have to modify it's behaviour there, but other than that it's working great.
I may also leverage these Expressions to make Triggers only fire if an expression is also true. I've seen there's some need for the ability to toggle Triggers on and off for Global Triggers or to prevent Triggers from firing without needing to leave the current Job step.
Webpage Triggers + Writing to Webpages
I updated the Chrome Extension to allow for reading in jquery matches for use in variables in a script which should be useful in a lot of situations.
It's also now possible to fill out an submit an input textbox. I'm hoping this can be used for automatic providing toy updates to users for people that are using XToys for cam sites.
Apparently Google has been taking weeks to approve extensions, and I have an additional update to submit but you can't edit a submission while you're waiting for approval...so it might take all of December before all of these updates are actually live and usable.
Job Queuing
Jobs can now be queued up. This is again mostly for people wanting to have XToys react to 'tips' in cam sites. The desired tip reactions can be queued up and run one after another instead of all firing at once.
Queues can also take in variables scoped only to that instance of the Job so that the scheduled Job can contain data about for example the tip amount and who send the tip.
Writing Guides on how to use Scripts and Patterns
I avoided writing up guides again? How unexpected. đź This week for sure! ....
Easier Locating Scripts and Connecting Everything
I'm going to be working on adding search/filter controls when adding a Script. And at having Scripts either automatically connect to Blocks if there's only 1 valid match, or when there's no matches just allowing you to add and connect that missing Block directly from the Script connector dialog.
If someone adds a Script that uses Speech Recognition but that Block isn't added yet they obviously are going to add it next, lets save them some clicks.
Pattern Connection Changes
I'm not sure I'll get to it this week or even next week since I have no idea yet how I want it to work, but I want Patterns to have the same connection options as the new Script connectors. Like writing a Pattern for a Vibrator and a Rotator.
Toy Connection State Sync
I really need to go back and actually finish all the sync state code for online sessions. In particular I want toy connection state synced and to show how many toys are connected (since multiple people can connect to the same toy Block during an online session). If the Script connection changes haven't caused a pile of bugs that need to be worked on all week I'll probably start this this week.