Forum

Please note that you can subscribe to the individual forums. A subscription for news only covers the news.

Notifications
Clear all

Checking Input for specific words.  

   RSS

0

Hi there. 

I've just started adapting the basic "Chastity.ini" script posed by SvenB. I've started adding my own modifications (no doubt I will learn more as I tinker on) but I just wanted to ask if there is any way to check user input for a specific word or phrase? 

e.g.

Input=What do you say, slave?

In the text box I want the slaves response to be checked to make sure it includes the words "Thank you, Mistress.".  If the response from the slave doesn't contain those words I would like a punishment to be issued.

From what I get out of the guide I'm under the impression this can be done using a combination of string variables and If/NotIf statements, but I have no idea how to code it.

Any ideas?

Thanks in advance!

Hoot

8 Answers
1

Try this. I have not tested it.

Input$=$answer,What do you say, slave?
procedure=CheckAnswer

[procedure-CheckAnswer]
Notif=$answer[[Thank you, Mistress.
Punish=50
PunishMessage=You must address you Mistress correct!

 

Sven

@admin

Hi, thanks for the reply.

I tried it as you suggested but I get "Invalid Flag" message upon trying to run the script.

I can see how you're trying to get the answer set then check it, so that's useful to me in it's own way for other things, shame it doesn't work.

Any other ideas?

Thanks again!

0

OK, I used your example and had another read through the Script Writing guide (I've no experience with coding other than this) and I've gotten it to work with the following syntax.

 

[confession-test inputcheck]
Input$=$answer,What do you say, slave?
procedure=CheckAnswer

[procedure-CheckAnswer]
Notif=$answer==$TYM
Punish=50
PunishMessage=You must address you Mistress correct!

Set$=$TYM,Thank You, Mistress.

 

Thank you for your help! Figuring this stuff out is amazing fun! With time it's probably possible to configure all kinds of randomised deviousness!

Thanks again!

Ok, for anyone else reading and wanting to incorporate this into a script, here is a tidied up version that is tested and works.

 

Set$=$TYM,Thank you, Mistress.

 

[Confession-TestTYMProcedure]
procedure=TYM

[procedure-TYM]
drop$=$answer
Input$=$answer,What do you say, slave?
procedure=TYMCorrect
procedure=TYMIncorrect

[procedure-TYMCorrect]
If=$answer==$TYM
message=You're welcome, slave.

[procedure-TYMIncorrect]
NotIf=$answer==$TYM
message=That's not how you thank your Mistress, slut.
Punish=50
PunishMessage=You didn't thank your Mistress properly.

 

In theory you can use the [Procedure-TYM] with reports, punishments, permissions, etc to get the sub to respond in the specific way as shown above.

 

Thanks to Sven B. again. Without your input I wouldn't have figured it out.

0

Great. The problem with this is that it requires the sub to enter exact the right phrase. The original question was that the phrase should just be included in the answer. That's what [[ was supposed to do. But I turned it the wrong way. 

You can try changing it to

If=$TYM[[$answer

(read: if $TYM is part of  $answer)

Again, I haven't tested it, just consulted the manual.

Sven

 

@admin
I was literally just adapting this very thing for other questions where I just wanted the sub to have to include "Mistress" as a salutation.

This has helped again.

Thanks Sven!

0

OK, for the benefit of anyone checking this thread I think this is the last word on this method of getting Input text recognised by the program. All made possible only due to Sven's help. 

I managed to get both ways working. I configured the program to run the following procedure on FirstRun of the script. This sets up the variables.

 

[procedure-SetSALUSetTYM]
set$=$SALU,Mistress
set$=$SALU2,Mistress Lexi
Set$=$TYM,Thank you, Mistress.

 

Next I wrote the following procedure for use as a DoneProcedure following a punishment (or where-ever else you want the sub to say thank you) and you want the sub to use the EXACT phrase you've set previously.

 

[procedure-TYM]
drop$=$answer
Input$=$answer,What do you say, slave?
procedure=TYMCorrect
procedure=TYMIncorrect

[procedure-TYMCorrect]
If=$answer==$TYM
select=random
message=You're welcome, slut.
message=Very good, {$zzsubname}.
message=Good gurl.

[procedure-TYMIncorrect]
NotIf=$answer==$TYM
message=That's not how you thank your Mistress.
Punish=50
PunishMessage=You didn't thank your Mistress properly.

 

If you just want the subs response to contain a particular phrase or word then you can use the following procedure :-

 

[procedure-SALU]
case=all
When=$SALU[[$answer
When=$SALU2[[$answer
When=None
message=You will address me as "Mistress" or "Mistress Lexi".
PunishMessage=You didn't address your Mistress correctly.
Punish=25
setflag=zzDeny
case=end

 

When you pair the above with a permission like this :-

 

[permission-drink something]

BeforeProcedure=WhatToDrink

 

[procedure-WhatToDrink]
drop$=$answer
Input$=$answer,What do you want to drink, slave?
NoInputProcedure=NoInput
Procedure=SALU

 

Then it all works fine. If the sub doesn't include "Mistress" or "Mistress Lexi" in his response then the permission is denied and a punishment is issued. 

 

Big thanks to Sven B for helping me get this working. If you could mark this as the final answer that might make it easier for people reading to integrate this into their scripts. 

@hoot
I was quite interested in this and had a bit of a fiddle and put together the attached sample script with a few ideas worked through in it.

This does have the potential to be exceedingly evil!

0

Oh I like this idea. Thanks for sharing! 

0

I have expanded it with a "Good morning protocol"

 

The sub now when they mark themselves up from bed needs to address the mistress "Good Morning, Mistress." They then need to perfectly recite each line of their Slave Mantra.

0

@subparprogrammer

May I suggest that you share your script here:

Share your scripts > Scripts for Virtual Master version 3 > Routines for Virtual Master version 3

It will make it easier for others to find it and get inspiration.

Sven

 

0

@subparprogrammer

Thank you.

Sven