de en es fr
Let the machine help
Light teasing, exhibition, BDSM, sissyfication, watersports... with sounds and pictures


Post new topic Reply to topic  [ 4 posts ] 
Author Message
 duplicating report/reportlate from CM
PostPosted: Fri Aug 19, 2011 3:13 am 
Offline
Regular
I've been wondering if this is possible to duplicate in some way in sexscripts. I'm at a loss because all uses of buttons seem to freeze the script. Is it possible to have a button just sit until it is clicked?

Code:
In CM:
[Block]
message=Start!
report=Done!
delay=30
reportlate=BlockTimeOut
next=BlockSuccess

[BlockSuccess]
message=Completed
next=End

[BlockTimeOut]
message=Out of Time
next=End


Most people probably know this but just for the users who might not; The above code would give you 30 seconds to click the button and be directed to [BlockSuccess], if 30s pass without a a click from the user you would be redirected to [BlockTimeOut].

Ideally in SS we could use a passive button to sit idle during loops without freezing the script then upon being clicked could break a loop or set a value, anything. I'm pretty rusty in legit programming languages, but I can't figure it out, if anyone has a way I'd appreciate it. Thanks!

What I wish was possible:
Code:
while(!Ended){
  def i = getRandom(5);
  show("The current number is "+i+", when you see a number you like tell me")
  if(idleButton("I like this number"))
      Ended = true;
  wait(5);
}


Top
 Profile Send private message 
 
 Re: duplicating report/reportlate from CM
PostPosted: Fri Aug 19, 2011 9:06 am 
Offline
Site Admin
User avatar
What you want is parrallel computing, something that is not simple (groovy would be able to do it, but the solution will not please you).
But there is an optional argument in showButton() that would do the trick, in this case :
Code:
def ended = false
while(!ended){
  def i = getRandom(6);
  show("The current number is "+i+", when you see a number you like tell me")
  if(showButton("I like this number", 5)<5)
      ended = true;
}

5 means : wait at most 5 seconds, return the time waiting (5 if the user did not click).


Top
 Profile Send private message 
 
 Re: duplicating report/reportlate from CM
PostPosted: Mon Mar 18, 2013 7:40 am 
Offline
Veteran
User avatar
I tried this script out today and found I needed to change it to:
Code:
def ended = false;
def i = 0;
while(!ended){
  i = getRandom(6);
  show("The current number is "+i+", when you see a number you like tell me")
  if(showButton("I like this number", 5)<5)
      ended = true;
}
show("You picked "+i+".");

Did I do something wrong initially, or is the correction needed? Defining 'i' outside the loop seemed to solve my original issue of not having it recognize 'i' when I tried to show it later.


Top
 Profile Send private message 
 
 Re: duplicating report/reportlate from CM
PostPosted: Mon Mar 18, 2013 8:47 pm 
Offline
Site Admin
User avatar
Yes, you need this if you want to use "i" later. A variable (like "i") if defined only in its blocks (things bounded with "{" "}" ).


Top
 Profile Send private message 
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Maroon Fusion theme created by Oxydo
Software, theme modifications, phpBB modification by Doti 2010 - 2020
This website uses session cookies only.