GuideMe Scripting Engine

Webteases are great, but what if you're in the mood for a slightly more immersive experience? Chat about Tease AI and other offline tease software.

Moderator: 1885

User avatar
bobhill
Explorer At Heart
Explorer At Heart
Posts: 164
Joined: Tue Mar 15, 2016 8:49 pm
Gender: Male
Sexual Orientation: Straight
I am a: None of the above

Re: GuideMe Scripting Engine

Post by bobhill »

Deleted and combined in prior post
Last edited by bobhill on Thu Sep 27, 2018 2:42 pm, edited 1 time in total.
User avatar
bobhill
Explorer At Heart
Explorer At Heart
Posts: 164
Joined: Tue Mar 15, 2016 8:49 pm
Gender: Male
Sexual Orientation: Straight
I am a: None of the above

Re: GuideMe Scripting Engine

Post by bobhill »

PlayfulGuy, I know you've been away, but two issues I've identified in 1.5: getVariable doesn't process boolean scriptVars correctly (returns NaN) and if you use more that one parameter in a js function called in a script, in evaluateExpression, the comma isn't parsed out correctly, which causes an error. Not sure if these are addressed in 1.53.

I fixed them this way in the js file: (you may have a better way)

Code: Select all

    // We reach here if str was an alphanumeric string like a variable name, or just a string.
    // Check to see if it's the name of a defined variable
    var temp = scriptVars.get(str);
//    jscriptLog(myName+"temp=" + temp);											
    if ( temp != undefined ) {
      // It was a defined scriptvar so return it's value
      if (temp === true || temp === false) return temp;							//BOBHILL ADD 
	  else if ( ! isNaN(temp) ) {												//It's either a number or a string				
        // It's a number so just return it in the proper form 
		if ( parseInt(temp) == parseFloat(temp) ) return parseInt(temp); // Must be an int 
        else return parseFloat(temp);  // It's a float. Not a root beer float, a number float.   
      }
      else return temp; // Must be a string so just return it
    }

Code: Select all

     else {
        // We have the start of some other expression element
        // Find the next delimiter character (opening or closing parentheses, operator or space) **** OR COMMA **** BOBHILL
        // If we are parsing a special function argument we ignore plus signs
        if ( isFunctionArg ) while (end < expression.length && expression.charAt(end).search(/[\s\(\)\<\>\,\=\!\-\*\/\"]/) == -1 ) end++;	//added comma BOBHILL
        else while (end < expression.length && expression.charAt(end).search(/[\s\(\)\<\>\,\=\!\+\-\*\/\"]/) == -1 ) end++;					//added comma BOBHILL
//        jscriptLog(myName+"end=" + end + ", char=\"" + expression.charAt(end) + "\"");	
User avatar
PlayfulGuy
Explorer At Heart
Explorer At Heart
Posts: 778
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: GuideMe Scripting Engine

Post by PlayfulGuy »

bobhill wrote: Wed Sep 19, 2018 12:20 pm I am calling a script from a GM page.

On the final page of the script, I have buttons to exit, such as "North", "South" and I have GM pages that these buttons should go to. Here's the updated code:

<snip>

I've tried various methods - and they do go to the correct GM page, but for some reason, the text portion of ShowScriptPage is displayed ("Something went wrong") before proceeding to the target GM page called from the script. I don't see anything in the js or gm logs that indicate why this is happening. I've stepped through the js code and and ShowScriptPage appears to be working. It recognizes the "Exit" command in the script and goes to the correct target GM page - it's just that ShowScriptPage displays the <text> component before 'target' is loaded.


EDITED: Updated script code, identified code in ScriptEngine.xml, and combined with next post


Update: this happens with Script Engine 1.50 and GM 0.3.7 combination but not with Engine 1.50 and GM 1.5.32b, so I guess it's a compatibility issue in one of the GM updates?
Hi bobhill,

Sorry I haven't been around Milovana much lately, and when I have been I keep forgetting to check this thread.

The code snippets you posted are interesting. I'm very curious about what you're building and how it works. :-)

I have encountered this issue of that page text displaying before an overRide kicks in with GM 3.6 and 3.7. You can safely remove the text node from the ShowScriptPage page in ScriptEngine.xml and that should fix it. That was only there as an error indication so if the code crashed at least you got some indication that something was wrong. Otherwise you would just see a blank page.

I'll reply to your other post separately.
PG
User avatar
PlayfulGuy
Explorer At Heart
Explorer At Heart
Posts: 778
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: GuideMe Scripting Engine

Post by PlayfulGuy »

bobhill wrote: Wed Sep 26, 2018 8:33 pm PlayfulGuy, I know you've been away, but two issues I've identified in 1.5: getVariable doesn't process boolean scriptVars correctly (returns NaN) and if you use more that one parameter in a js function called in a script, in evaluateExpression, the comma isn't parsed out correctly, which causes an error. Not sure if these are addressed in 1.53.

I fixed them this way in the js file: (you may have a better way)

Code: Select all

    // We reach here if str was an alphanumeric string like a variable name, or just a string.
    // Check to see if it's the name of a defined variable
    var temp = scriptVars.get(str);
//    jscriptLog(myName+"temp=" + temp);											
    if ( temp != undefined ) {
      // It was a defined scriptvar so return it's value
      if (temp === true || temp === false) return temp;							//BOBHILL ADD 
	  else if ( ! isNaN(temp) ) {												//It's either a number or a string				
        // It's a number so just return it in the proper form 
		if ( parseInt(temp) == parseFloat(temp) ) return parseInt(temp); // Must be an int 
        else return parseFloat(temp);  // It's a float. Not a root beer float, a number float.   
      }
      else return temp; // Must be a string so just return it
    }

Code: Select all

     else {
        // We have the start of some other expression element
        // Find the next delimiter character (opening or closing parentheses, operator or space) **** OR COMMA **** BOBHILL
        // If we are parsing a special function argument we ignore plus signs
        if ( isFunctionArg ) while (end < expression.length && expression.charAt(end).search(/[\s\(\)\<\>\,\=\!\-\*\/\"]/) == -1 ) end++;	//added comma BOBHILL
        else while (end < expression.length && expression.charAt(end).search(/[\s\(\)\<\>\,\=\!\+\-\*\/\"]/) == -1 ) end++;					//added comma BOBHILL
//        jscriptLog(myName+"end=" + end + ", char=\"" + expression.charAt(end) + "\"");	
Interesting. I've never had need to use boolean variables in a script before so never encountered that. I've added your fix to the code for the next release.

As for the multiple arguments to a javascript function I did run into that bug myself after version 1.53 was released so that will be in the next release as well. As usual I've no idea when I'll get around to that.

Thanks,

PG
User avatar
bobhill
Explorer At Heart
Explorer At Heart
Posts: 164
Joined: Tue Mar 15, 2016 8:49 pm
Gender: Male
Sexual Orientation: Straight
I am a: None of the above

Re: GuideMe Scripting Engine

Post by bobhill »

Hi PG,

Thanks for the replies, they are very helpful!
You can safely remove the text node from the ShowScriptPage page in ScriptEngine.xml and that should fix it.
Great - that's what I did.
I've added your fix to the code for the next release.
For the boolean test, I used the strict equality initially and it worked with GM 3.7, but I had to drop to loose equality "==" when testing with some of the other GM versions. That really doesn't make sense to me, but it works and I was tired of debugging it. :lol:
The code snippets you posted are interesting. I'm very curious about what you're building and how it works. :-)
It's a big project and I never have enough time, but I've finally finished most of the 'infrastructure'. Even the small coding parts tend to take me a lot of trial and error to work out syntax, etc. Next, I've been working on story and scripts. I need to do more work, but will release a partial version when it's far enough along. :-)

A new question, when you return: In 1.53 and GM 3.7 I am having problems with GlobalButton command, as the ScriptEngine treats it as regular text and it never runs through the "processCommands" function. I've run through the java debugger and haven't been able to identify an error yet. Thanks! BH :wave:
User avatar
bobhill
Explorer At Heart
Explorer At Heart
Posts: 164
Joined: Tue Mar 15, 2016 8:49 pm
Gender: Male
Sexual Orientation: Straight
I am a: None of the above

Re: GuideMe Scripting Engine

Post by bobhill »

Hi PG - two more items I've found. I just want to mention, otherwise I will forget.

I'm having trouble using if with <= or >=. evaluateExpression seems to have problem parsing both together, but does fine if only one is used. I just adjusted to use < or > not <= or >=, I haven't found the exact point in the code where it happens yet.

This works, 31 evaluates to a number:

Code: Select all

if (vElapsedTime < 31) goto Begs30
This doesn't work, 30 evaluates to a string:

Code: Select all

if (vElapsedTime <= 30) goto Begs30
Also, in the Wait.xml, if you list an image as an argument, the Wait page gets the full image path, which is also retrieved in getImage, so the path is repeated twice, resulting in image not found. I was able to work around by specifically using the "Image" parameter with the image name:

Code: Select all

Wait <vWait> minutes Image 161.jpg "Rest for <vWait> minutes"
User avatar
PlayfulGuy
Explorer At Heart
Explorer At Heart
Posts: 778
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: GuideMe Scripting Engine

Post by PlayfulGuy »

bobhill wrote: Mon Oct 22, 2018 4:06 am A new question, when you return: In 1.53 and GM 3.7 I am having problems with GlobalButton command, as the ScriptEngine treats it as regular text and it never runs through the "processCommands" function. I've run through the java debugger and haven't been able to identify an error yet. Thanks! BH :wave:
bobhill wrote: Sun Oct 28, 2018 10:19 am Hi PG - two more items I've found. I just want to mention, otherwise I will forget.

I'm having trouble using if with <= or >=. evaluateExpression seems to have problem parsing both together, but does fine if only one is used. I just adjusted to use < or > not <= or >=, I haven't found the exact point in the code where it happens yet.

Also, in the Wait.xml, if you list an image as an argument, the Wait page gets the full image path, which is also retrieved in getImage, so the path is repeated twice, resulting in image not found. I was able to work around by specifically using the "Image" parameter with the image name:

Code: Select all

Wait <vWait> minutes Image 161.jpg "Rest for <vWait> minutes"
Hi Bob,

I did a quick setup of a Guideme 3.7 installation with the release code for script engine 1.53 modified so the javascript files load properly, and I'm unable to reproduce these errors. Here's the script I used to test.

Code: Select all

// Testing stuff for bobhill

imageFolder Models/Sarah       // Sets the default image folder

GlobalButton Yes Mistress
temp = 30
if (temp <= 30) *.jpg Temp is 30 or less
set DEBUG
Wait <temp> minutes Image *.jpg "Rest for <temp> minutes"
Wait <temp> minutes Image no-06.jpg "Rest for <temp> minutes"
unset DEBUG
exit
When I run that I get the screen saying Temp is 30 or less with the global button I defined, and then I get the wait page with a random image, and then the wait page with the specified image exactly as I'd expect.

I know you've made a couple other changes to the script engine code to fix some other issues and I have not replicated those code changes for this test, so perhaps one of your other changes has introduced some other issue.

If I have time and energy later I'll go back and update the code with the changes you reported earlier and see what happens. And if you could post the ScriptEngine,js file you are using and the relevant portion of the script you're building I will do some tests and try to nail it down.

Regards,

PG
User avatar
PlayfulGuy
Explorer At Heart
Explorer At Heart
Posts: 778
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: GuideMe Scripting Engine

Post by PlayfulGuy »

bobhill wrote: Wed Sep 19, 2018 12:20 pm I am calling a script from a GM page.

On the final page of the script, I have buttons to exit, such as "North", "South" and I have GM pages that these buttons should go to. Here's the updated code:

<snip>

I've tried various methods - and they do go to the correct GM page, but for some reason, the text portion of ShowScriptPage is displayed ("Something went wrong") before proceeding to the target GM page called from the script. I don't see anything in the js or gm logs that indicate why this is happening. I've stepped through the js code and and ShowScriptPage appears to be working. It recognizes the "Exit" command in the script and goes to the correct target GM page - it's just that ShowScriptPage displays the <text> component before 'target' is loaded.

This is the part of ShowScriptPage that is being executed. Upon the 'return' command, is when the text is displayed.

Code: Select all

        // Check for an Exit command (exit the script)
        if ( page.text == "exit" ) {
          // Exit the script and go somewhere else
          jscriptLog(myName+"Exiting script " + page.filename);
          target = ExitCurrentScript();
          overRide.setPage(target);
          return; // And go do it.
        }
Hi Bob,

I've been digging in to this and have discovered that it seems to be an issue with the overRide.setPage() command in the newer GM versions. In the code snippet you posted above you can see the command

Code: Select all

overRide.setPage(target);
If you replace that with

Code: Select all

overRide.setDelay(target,"0","","hidden","","","");
it should completely resolve the problem.

Just above that you'll also find another reference to setPage() in the code that checks for a gotoPage command. It looks like

Code: Select all

overRide.setPage(page.text);
You should also replace that with

Code: Select all

overRide.setDelay(page.text,"0","","hidden","","","");
I've posted a bug report for philo in the Guideme thread as well so it should get fixed in a future release of GM.

Regards,

PG
User avatar
bobhill
Explorer At Heart
Explorer At Heart
Posts: 164
Joined: Tue Mar 15, 2016 8:49 pm
Gender: Male
Sexual Orientation: Straight
I am a: None of the above

Re: GuideMe Scripting Engine

Post by bobhill »

PlayfulGuy wrote: Sat Nov 03, 2018 5:46 pm
I did a quick setup of a Guideme 3.7 installation with the release code for script engine 1.53 modified so the javascript files load properly, and I'm unable to reproduce these errors. Here's the script I used to test.

Code: Select all

// Testing stuff for bobhill

imageFolder Models/Sarah       // Sets the default image folder

GlobalButton Yes Mistress
temp = 30
if (temp <= 30) *.jpg Temp is 30 or less
set DEBUG
Wait <temp> minutes Image *.jpg "Rest for <temp> minutes"
Wait <temp> minutes Image no-06.jpg "Rest for <temp> minutes"
unset DEBUG
exit
When I run that I get the screen saying Temp is 30 or less with the global button I defined, and then I get the wait page with a random image, and then the wait page with the specified image exactly as I'd expect.

I know you've made a couple other changes to the script engine code to fix some other issues and I have not replicated those code changes for this test, so perhaps one of your other changes has introduced some other issue.
PG - Sorry, I've been away and haven't had a chance to respond. Thanks for looking at this. I'll try to run your code first to confirm I'm not doing something stupid and then I'll recheck any changes I made in the js vs a clean download.
PlayfulGuy wrote: Sat Nov 03, 2018 5:46 pm
If I have time and energy later I'll go back and update the code with the changes you reported earlier and see what happens. And if you could post the ScriptEngine,js file you are using and the relevant portion of the script you're building I will do some tests and try to nail it down.
Ok, thanks. If the steps above don't show anything clearly wrong to me, then I'll post the js and script. It may be a few days before I can reply.
User avatar
bobhill
Explorer At Heart
Explorer At Heart
Posts: 164
Joined: Tue Mar 15, 2016 8:49 pm
Gender: Male
Sexual Orientation: Straight
I am a: None of the above

Re: GuideMe Scripting Engine

Post by bobhill »

PlayfulGuy wrote: Wed Nov 07, 2018 8:16 pm I've been digging in to this and have discovered that it seems to be an issue with the overRide.setPage() command in the newer GM versions.
Great, thanks! I'll make these changes! :-D :wave:
User avatar
bobhill
Explorer At Heart
Explorer At Heart
Posts: 164
Joined: Tue Mar 15, 2016 8:49 pm
Gender: Male
Sexual Orientation: Straight
I am a: None of the above

Re: GuideMe Scripting Engine

Post by bobhill »

PlayfulGuy wrote: Sat Nov 03, 2018 5:46 pm
I did a quick setup of a Guideme 3.7 installation with the release code for script engine 1.53 modified so the javascript files load properly, and I'm unable to reproduce these errors. Here's the script I used to test.
Hi PG - I reran my script and I am not able to reproduce my error and your script works fine. If I have the problem again, I'll let you know.

Separately, given the addTimer functionality in GM, would it be possible to implement a similar command in the script engine that would change the right pane html but keep the same GM page? My specific use is to have changing text/buttons on right pane with a single video playing on left pane.
User avatar
PlayfulGuy
Explorer At Heart
Explorer At Heart
Posts: 778
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: GuideMe Scripting Engine

Post by PlayfulGuy »

bobhill wrote: Thu Dec 27, 2018 11:12 pm Hi PG - I reran my script and I am not able to reproduce my error and your script works fine. If I have the problem again, I'll let you know.
Excellent!
bobhill wrote: Thu Dec 27, 2018 11:12 pm Separately, given the addTimer functionality in GM, would it be possible to implement a similar command in the script engine that would change the right pane html but keep the same GM page? My specific use is to have changing text/buttons on right pane with a single video playing on left pane.
I've actually had a couple times where I would have liked the same functionality myself, and have thought about ways to implement it, but haven't settled on a good solution. Do you have a suggestion on how you would like to see it? How would you like to be able to code it?

I don't know if Guideme lets you change the buttons in a timer. Have to look at that.

Anyway, the script engine wasn't really designed with this functionality in mind and it's structured to process commands in a very linear, line by line sort of fashion. If you have some thoughts on how you would like to see it done it might help stimulate my creativity a bit. And since I'd like to have the functionality myself I have some motivation :-D

Cheers,

PG
User avatar
bobhill
Explorer At Heart
Explorer At Heart
Posts: 164
Joined: Tue Mar 15, 2016 8:49 pm
Gender: Male
Sexual Orientation: Straight
I am a: None of the above

Re: GuideMe Scripting Engine

Post by bobhill »

PlayfulGuy wrote: Fri Dec 28, 2018 6:05 am Do you have a suggestion on how you would like to see it? How would you like to be able to code it?
I had not thought about it, but in v1.5, with the Enhanced Page Command, the default if the image field is blank is to keep the same, but it changes the page (and the right pane)(so leaving the image blank would not work for this purpose) and under the old notation, a quotation mark also keeps the same image. So, using the old syntax, would it make sense to use a different marker that could indicate to change the right pane only and not to change the GM page, such as a "#" or "%"?

As a potential sample, here's something adapted from the GM I'm working on:
Spoiler: show

Code: Select all

	003.jpg,  {
		<vHeaderText>\n
		gt I'll guide your stroking, so pay attention!\n\n
		Button Continue
	}
	
	004.jpg,  {
		<vHeaderText>\n
		gt As always, don't come or edge unless you are given permission!\n\n
		Button Continue
	}

	005.jpg,  {
		<vHeaderText>\n
		gt Let's get started...\n\n
		gt Lube up your cock now.\n\n
		Button Continue
	}
	
	// replace 'next' with 30, which is the Delay
	// could we have a label to go to when video is complete and if no label then it's assumed there's a 'wait' + button 
	// what can change in right pane - text and buttons or only text?
	
	Video media/video/model.mp4 00:00:00 00:15:00, 30, EndLabel {      	
		<vHeaderText>\n							
		gt Start stroking - once per second.\n\n
	}
	vTemp = fChangeXP(30)
	
	#, 30 {								//Use "#" to change right pane, but not change page
		<vHeaderText>\n
		gt Speed up to twice per second.\n\n
	}
	vTemp = fChangeXP(60)

	#, 30 {
		<vHeaderText>\n
		gt Stay at that speed\n\n
		button Edging, EdgeFail
	}
	vTemp = fChangeXP(60)
	
	...
	
EndLabel:
	...
	
As you said, I'm not sure you can add buttons, I'm still working on this in GM. I may need to have the buttons on the page from the start of the video and enable / disable them when applicable. Philo did mention adding a target page to the Delay commands (it needs to be both overRide and Guide, I think), which would increase flexibility around content.

Edit - p.s. - this is very exciting, I'm glad you are interested in adding, also!! :yes:
User avatar
PlayfulGuy
Explorer At Heart
Explorer At Heart
Posts: 778
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: GuideMe Scripting Engine

Post by PlayfulGuy »

bobhill wrote: Fri Dec 28, 2018 5:42 pm
PlayfulGuy wrote: Fri Dec 28, 2018 6:05 am Do you have a suggestion on how you would like to see it? How would you like to be able to code it?
I had not thought about it, but in v1.5, with the Enhanced Page Command, the default if the image field is blank is to keep the same, but it changes the page (and the right pane)(so leaving the image blank would not work for this purpose) and under the old notation, a quotation mark also keeps the same image. So, using the old syntax, would it make sense to use a different marker that could indicate to change the right pane only and not to change the GM page, such as a "#" or "%"?

As a potential sample, here's something adapted from the GM I'm working on:
Spoiler: show

Code: Select all

	003.jpg,  {
		<vHeaderText>\n
		gt I'll guide your stroking, so pay attention!\n\n
		Button Continue
	}
	
	004.jpg,  {
		<vHeaderText>\n
		gt As always, don't come or edge unless you are given permission!\n\n
		Button Continue
	}

	005.jpg,  {
		<vHeaderText>\n
		gt Let's get started...\n\n
		gt Lube up your cock now.\n\n
		Button Continue
	}
	
	// replace 'next' with 30, which is the Delay
	// could we have a label to go to when video is complete and if no label then it's assumed there's a 'wait' + button 
	// what can change in right pane - text and buttons or only text?
	
	Video media/video/model.mp4 00:00:00 00:15:00, 30, EndLabel {      	
		<vHeaderText>\n							
		gt Start stroking - once per second.\n\n
	}
	vTemp = fChangeXP(30)
	
	#, 30 {								//Use "#" to change right pane, but not change page
		<vHeaderText>\n
		gt Speed up to twice per second.\n\n
	}
	vTemp = fChangeXP(60)

	#, 30 {
		<vHeaderText>\n
		gt Stay at that speed\n\n
		button Edging, EdgeFail
	}
	vTemp = fChangeXP(60)
	
	...
	
EndLabel:
	...
	
As you said, I'm not sure you can add buttons, I'm still working on this in GM. I may need to have the buttons on the page from the start of the video and enable / disable them when applicable. Philo did mention adding a target page to the Delay commands (it needs to be both overRide and Guide, I think), which would increase flexibility around content.

Edit - p.s. - this is very exciting, I'm glad you are interested in adding, also!! :yes:
I've spent a bit of time looking at this and have a comment on a question you ask in your sample code, and a thought on adding the timer functionality.

First, in your sample code you had

Code: Select all

	// replace 'next' with 30, which is the Delay
	// could we have a label to go to when video is complete and if no label then it's assumed there's a 'wait' + button 
	// what can change in right pane - text and buttons or only text?
	
	Video media/video/model.mp4 00:00:00 00:15:00, 30, EndLabel {      	
		<vHeaderText>\n							
		gt Start stroking - once per second.\n\n
	}
	vTemp = fChangeXP(30)

First of all the video command does not presently support a text block that way you show it here, but I have actually considered adding this also. My initial thought was simply to make the page command smarter so you can just specify a video instead of a still image and it would detect that and adapt. Sounds easy when you say it fast, but it's never that easy. I'm still keeping it in mind but I'm trying to get another version of the script engine released and don't want to get into anything too involved or it will just delay the release that much longer. That said, I'll make a note to look at adding the option of a delay instead of next or wait.

You also ask if we can have a label to go to when the video completes. This is probably doable too, but I think you can actually get the same effect now with one of the following (but I'm too lazy to test it):

Code: Select all

	Video media/video/model.mp4 00:00:00 00:15:00 wait	// Wait means wait for a button press
	" 30 {      	// The timer here should make it continue even if there's no button pressed
		<vHeaderText>\n							
		gt Start stroking - once per second.\n\n
	}
	vTemp = fChangeXP(30)
	goto EndLabel	// And then you go to EndLabel

OR the following should show 15 seconds of video then goto EndLabel

Code: Select all

	// Next means go to next page, which actually means continue processing with the next
	// command, so the goto kicks in.
	Video media/video/model.mp4 00:00:00 00:15:00 next	
	" { 
		<vHeaderText>\n							
		gt Start stroking - once per second.\n\n
	}
	vTemp = fChangeXP(30)
	goto EndLabel	// And then you go to EndLabel
That got longer than I anticipated so I'll reply separately about the timer idea.
User avatar
PlayfulGuy
Explorer At Heart
Explorer At Heart
Posts: 778
Joined: Sat Jul 07, 2012 10:08 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): No domme
Sub/Slave(s): No sub
Location: British Columbia, Canada

Re: GuideMe Scripting Engine

Post by PlayfulGuy »

bobhill wrote: Fri Dec 28, 2018 5:42 pm
PlayfulGuy wrote: Fri Dec 28, 2018 6:05 am Do you have a suggestion on how you would like to see it? How would you like to be able to code it?
I had not thought about it, but in v1.5, with the Enhanced Page Command, the default if the image field is blank is to keep the same, but it changes the page (and the right pane)(so leaving the image blank would not work for this purpose) and under the old notation, a quotation mark also keeps the same image. So, using the old syntax, would it make sense to use a different marker that could indicate to change the right pane only and not to change the GM page, such as a "#" or "%"?


Edit - p.s. - this is very exciting, I'm glad you are interested in adding, also!! :yes:
Looking at the code for the script engine and the way it's structured, and looking at the addTimer() documentation and the other options it has, it occurred to me that the simplest approach is to add a Timer command to the text block processing so you could say

Code: Select all

InitialImage.jpg {
	Initial text
	Timer 10 New text 1
	Timer 10 New text 2
	Timer 10 Image newImage.jpg
}
And then it's all nice and clean and logical, and can it supports changing images too.

The above would show "Initial text" first with InitialImage.jpg, and set the timer to change the text 10 seconds later to "New text 1", and then 10 seconds later to "New text 2", and 10 seconds later change the image to newImage.jpg

This actually fits very nicely with how the script engine processes commands now, and the implementation of it would be similar to how I handle buttons, so I'd say it's looking pretty good.

And it would work with videos too.

And then if I smarten up the page command so it detects videos and handles the other options you suggest as well, things start looking pretty sweet.

I'm making no promises on when I might be able to get that done, but that gave me the creative boost I needed :-D

Cheers,

PG
Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests