This is pretty great!
I had a question about multiline pages on a command. Can you do things like this?
Code: Select all
ifSet myFlag image32.jpg, {
style1 Hey there!\n\n
style1 You rock
}
Moderator: 1885
Code: Select all
ifSet myFlag image32.jpg, {
style1 Hey there!\n\n
style1 You rock
}
No. The way the If, ifSet and ifNotSet commands are implemented allowing a text block there is tough. I may implement it in the future because I have run across cases where it would have been useful. And clearly you have too, and since you and I seem to be the only ones using the engine that means 100% of the users would like that featuredesertfox wrote:Welp, merry fucking christmas, that is excelent. Now I can stop writing edge increment commands and can clean up how I'm doing some other things, and oh man I can get rid of this stupid idea I had for using flags since I couldn't keep counts I could check, oh yeah.
This is pretty great!
I had a question about multiline pages on a command. Can you do things like this?Code: Select all
ifSet myFlag image32.jpg, { style1 Hey there!\n\n style1 You rock }
Code: Select all
ifSet UserEdged goto badBoy
Code: Select all
EdgeCount = 0 // reset the count
Code: Select all
if ( expression ) command
Code: Select all
if ( count >= 5) goto EnoughCounting
if ( count < 5 ) count = count + 1
if ( isSet(FlagA) and isNotSet(FlagB) ) goto Condition1
if ( isSet(FlagA+FlagB) ) goto Condition2
if ( count > 5 and isNotSet(UserCame) ) image1.jpg, You are the best!
Code: Select all
if ( ( isSet(FlagA) and isNotSet(FlagB) ) Or (isSet(FlagA) and count > 7) ) set UserIsAMachine
Code: Select all
ifSet SomeFlag myImage.jpg {
block of text for the page on the ifSet command
}
Code: Select all
image27.jpg, So far you've edged <EdgeCount> times.
or
if ( EdgeCount == 5) Image27.jpg, You're up to <EdgeCount> edges now.
Code: Select all
Audio filename, 5
Code: Select all
text = text.replace(/<myname>/i,"[span]myName[/span]");
text = text.replace(/<mysubname>/i,"[span]mySubName[/span]");
text = text.replace(/<mistress1>/i,"[span]mistress1[/span]");
text = text.replace(/<mistress2>/i,"[span]mistress2[/span]");
I seem to have had a lapse in thinking there. What you've done is probably the correct fix.desertfox wrote:Edge counts and flags are working so, so nicely. I really have to go back to the start and play through everything I have to kind of make sure it's stayed consistent, so going back and fixing all my counters is a really good excuse.
I found a small bug maybe. The <myName> command looks like its getting pushed through as [span]myName[/span] when it comes out in the text. Did a really quick look in the scriptengine.js and saw the
If I change them to have <span> around them, they resolve correctly, but wondering if you probably changed that to avoid stepping in the new <variable> stuff and might be a bad thing to be doing.Code: Select all
text = text.replace(/<myname>/i,"[span]myName[/span]"); text = text.replace(/<mysubname>/i,"[span]mySubName[/span]"); text = text.replace(/<mistress1>/i,"[span]mistress1[/span]"); text = text.replace(/<mistress2>/i,"[span]mistress2[/span]");
I have uploaded new versions of the zip files with the corrected code. As always, see the first post of this thread.desertfox wrote: I found a small bug maybe. The <myName> command looks like its getting pushed through as [span]myName[/span] when it comes out in the text. Did a really quick look in the scriptengine.js and saw the
If I change them to have <span> around them, they resolve correctly, but wondering if you probably changed that to avoid stepping in the new <variable> stuff and might be a bad thing to be doing.Code: Select all
text = text.replace(/<myname>/i,"[span]myName[/span]"); text = text.replace(/<mysubname>/i,"[span]mySubName[/span]"); text = text.replace(/<mistress1>/i,"[span]mistress1[/span]"); text = text.replace(/<mistress2>/i,"[span]mistress2[/span]");
Thanks for those notes. I will add appropriate changes to my version. I never thought about the "if(" issue. I'm so accustomed to putting a space in there it just never occurred to me. I'll see how hard it is to allow for that. I've made several other updates to the script engine recently as well. I'll try and release something in the not too distant future.desertfox wrote:Hello! Still plugging away with the engine. One small comment on the exact same block of code in the last post here, I had a page with multiple <myName>'s on it and it was only replacing the first one, so changed the script engine to add g to the regex and seems to be working alright now.
~LN 1611 text = text.replace(/<myname>/gi,"<span>myName</span>");
just thought I would mention that if you wanted to update your master version for your project.
Also, I was going to post I was having trouble using the if stuff but it turns out that it really, really likes having you say "if (" vs "if(" to start the expression which was what was throwing it off so far. Once I got the if ( part its behaving just as expected now. Good stuff.
I agree about breaking backwards compatibility, but as far as I know only desertfox and I have actually used the script engine to make anything. I think using * as a shortcut for button was a mistake because * is a filename wildcard already supported by GuideMe. I didn't think it all the way through, and that special case never occurred to me until later. Mistakes are made though, and they can be corrected.lestrian wrote:PlayfulGuy: I haven't used the scripting engine, but breaking backwards compatibility is usually a bad idea. This seems more like a problem with the parser. Is the wildcard character already used for random files in the scripting engine? If so, then maybe there should simply be a special case where if it is followed by a comma then it is not a button. Otherwise, maybe you should introduce a new keyword/symbol for random image instead, such as the word random or the symbol "_".
Users browsing this forum: leandeanjean and 30 guests