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


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Conditional loop doesn't work
PostPosted: Thu Oct 27, 2016 1:35 pm 
Offline
Active member
User avatar
Hi everybody. A new problem: in my script slave can repeat an exercise with the opportunity to ask for mercy.
BUT mistress can say no and then slave must continue the same routine without any button to ask....
My code doesn't work....why?

Code:
//EXERCISE NO MERCY
def exercisenomercy = {
........
}

//-------------------------------------------

//EXERCISE WITH MERCY
def exerciseyesmercy = {
........
def tempo = getRandom(2)+3
def time = showButton("Please stop!", tempo)
}

//-------------------------------------------

//MISTRESS DECISION
def decision = {
def yesno = getRandom(2)
switch (yesno) {
case 0: def mercy = 1
default: def mercy = 0
}

//-------------------------------------------


(1..10).each {
switch (mercy) {
case 0: exerciseyesmercy()
default: exercisenomercy()
}
//-------------------------------------------


Top
 Profile Send private message 
 
 Re: Conditional loop doesn't work
PostPosted: Thu Oct 27, 2016 1:46 pm 
Offline
Site Admin
User avatar
Some closing } must be missing here, but the main thing is : mercy is defined local here (inside some {} ), so can not be read later.
Start with a definition that is not in {}
Code:
def mercy

Then change it only
Code:
case 0: mercy = 1

And it should work


Top
 Profile Send private message 
 
 Re: Conditional loop doesn't work
PostPosted: Thu Oct 27, 2016 2:57 pm 
Offline
Active member
User avatar
I have found the solution:

(1..10).each {
switch (calzatolta) {
case 0: exercisewithmercy()
....}
break

default: exercisewithnomercy()
}
}

In this way script repeat the switch action....
Thank you doti!


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 9 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.