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


Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Switch doesn't work
PostPosted: Wed Jun 21, 2017 3:42 am 
Offline
Shy
Hey, I'm new here and I just tried to make a script, but it doesn't work how I expected it to do.
This is a test form of my script (has the same form as the final product should have, but with less content)
Code:
   setImage("Own Images/Fag Roulette/Roulette Master.jpg")
   show("Hello there, faggot!")
   showButton("Hello, Sir")
   show("Are you ready for the Fag-Roulette?")
   showButton("Of course")
   show("Great, I haven't expected anything different so let's start!")
   showButton("Get your random category")
   def spin_category = [ "Anal", "Chastity", "Cum", "Cumplay", "Dildo", "Humiliation", "Masturbation", "No_Cum", "Proof", "Public" ]
   show(spin_category [getRandom(10) ])
   wait(10)
   switch (spin_category) {
      case "Anal":
         show("Test1")
         break
      case "Chastity":
         show("Test2")
         break   
      case "Cum":
         show("Test3")
         break   
      case "Cumplay":
         show("Test4")
         break   
      case "Dildo":
         show("Test5")
         break   
      case "Humiliation":
         show("Test6")
         break   
      case "Masturbation":
         show("Test7")
         break   
      case "No_Cum":
         show("Test8")
         break   
      case "Proof":
         show("Test9")
         break   
      case "Public":
         show("Test10")   
   }

My problem: I can click the buttons and it shows me one of the 10 categories but in case of switching to the "case" it just ends there ... I tried so much, could anyone help me? (I'm not really experienced and tried it with the help of the manual, so a easy explanation would be good :D)


Top
 Profile Send private message 
 
 Re: Switch doesn't work
PostPosted: Wed Jun 21, 2017 8:28 am 
Offline
Site Admin
User avatar
It should be something like :
Code:
...
wait(10)
   switch (spin_category[getRandom(10)]) {
      case "Anal":
...

or more probably:
Code:
...
def choice = spin_category [getRandom(10) ]
show(choice)
   wait(10)
   switch (choice) {
      case "Anal":
...


Top
 Profile Send private message 
 
 Re: Switch doesn't work
PostPosted: Wed Jun 21, 2017 1:37 pm 
Offline
Shy
doti wrote:
It should be something like :
Code:
...
wait(10)
   switch (spin_category[getRandom(10)]) {
      case "Anal":
...

or more probably:
Code:
...
def choice = spin_category [getRandom(10) ]
show(choice)
   wait(10)
   switch (choice) {
      case "Anal":
...


First of all, thank you :)
I tried your first version and it works now, but there is still some problem but I don't know why:
Sometimes when I get for example the first category it doesn't show me the text of the first one but of another one (e.g. the third category).
Do you know where this could come from?
would the second one be a better option then?


Top
 Profile Send private message 
 
 Re: Switch doesn't work
PostPosted: Wed Jun 21, 2017 1:40 pm 
Offline
Site Admin
User avatar
Yes, the second one is a better option : the 1st one call 2 times getRandom(), so both numbers can be different.


Top
 Profile Send private message 
 
 Re: Switch doesn't work
PostPosted: Wed Jun 21, 2017 2:05 pm 
Offline
Shy
doti wrote:
Yes, the second one is a better option : the 1st one call 2 times getRandom(), so both numbers can be different.

Okay thank you in advance :D
I will try it later and if it shouldn't work I write again.
So if you don't hear from me again: Thank you very much :*


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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, 2015
This website uses session cookies only.