SexScripts : Quick tricks - https://ss.deviatenow.com:443/viewtopic.php?f=4&t=290 | Page 1 of 1 |
Quick tricks |
LMW [ Sat Jan 26, 2013 2:57 pm ] |
---|---|
Hi all, Firstly, wonderful program! I spent a few weeks relying on the ssScriptMaker program and had some fun there, but then I tried some actual groovy script. Wow. It's awesome, isn't it? With that in mind, I'd like to show you a neat closure I've come up with to make my life a little easier. See what you think: Code: def showFor = { showUntil, showText -> show(showText) if (showUntil.toString().isInteger()) { this.wait(showUntil.toInteger()) } else { showButton(showUntil) } } showFor("Yes, Master","Are you ready to begin?") // Shows the question and waits for the "Yes, Master" button to be clicked showFor(60, "Stand in the corner for 1 minute") // Shows the text for 60 secs I find it saves me a bit of time and a lot of space, particularly with the kinds of scripts that I write (mostly image slideshows with bossing about, humiliation and general mockery) So, have you guys got any other quick tricks like this to share? LMW |
Re: Quick tricks |
riya [ Wed Jul 31, 2013 11:35 am ] |
---|---|
About the font, there is a script to globally change the font, could this also include the size? If i write my script i don't want to force my taste for larger fonts on anyone else, so i would prefer it to be an option for the user. |
Re: Quick tricks |
doti [ Wed Jul 31, 2013 7:55 pm ] |
---|---|
Sorry, the size of the font follows a complex algorithm, setting a default size is not really possible ; script should hardly ever set the size of text. |
Re: Quick tricks |
w00tz0rz4 [ Sat Nov 30, 2013 11:18 am ] |
---|---|
Neat trick! Here's one that I make use of Code: def percentChance = { percent -> switch(getRandom(100)){ case 0..percent: return true default: return false } } Code: if(percentChance(75)) return 1 else return 0 75% chance to return true, 25% chance to return false I find it reads a nicely on more complex conditionals. |
Page 1 of 1 | All times are UTC + 1 hour [ DST ] |