Page 17 of 121
Re: GuideMe (TeaseMe v2.0): BETA Thread
Posted: Sun May 18, 2014 9:08 pm
by philo
Pascal wrote:But I still have the problem that I cant access the JavaScript function globally is there a way to archive this.
There is a GlobalJavascript node.
Hopefully the snippet below explains how it works.
If it doesn't let me have a few more details and I will see if I can work out how to do it.
Code: Select all
<Settings> <AutoSetPageWhenSeen>false</AutoSetPageWhenSeen> </Settings> <GlobalJavascript> <![CDATA[ function gsGetCapitalisedText(txtIn) { txtOut = "This is uppercase " + txtIn.toUpperCase(); return txtOut; } ]]> </GlobalJavascript> <Pages> <Page id="title"> <Text> <span>screpttext</span> </Text> <javascript> <![CDATA[ function pageLoad() { var fnctText = gsGetCapitalisedText("lowercase text"); scriptVars.put("screpttext", fnctText); } ]]> </javascript> </Page>
Re: GuideMe (TeaseMe v2.0): BETA Thread
Posted: Mon May 26, 2014 12:18 pm
by d3vi0n
Hi, what did i miss while i was gone? :D Updated the first page with the new version (v0.1.0).
Re: GuideMe (TeaseMe v2.0): BETA Thread
Posted: Mon May 26, 2014 1:37 pm
by philo
d3vi0n wrote:Hi, what did i miss while i was gone? :D Updated the first page with the new version (v0.1.0).
Welcome back, I did wonder if you had gone for good it was so long
debug window and converting scriptvars from strings to any variable type were the 2 biggest changes
Re: GuideMe (TeaseMe v2.0): BETA Thread
Posted: Thu May 29, 2014 8:39 pm
by PlayfulGuy
@ Philo or d3vion:
First off thanks for all your hard work on this project.
I'm experimenting with Guideme and have a question/request on working with boolean values and preferences.
Is there an easy way to test a boolean preference? For example, in preferences (UserSettingsUI.xml) there are three variables used to record orientation - gay, bi and straight, with each being either true or false.
In my javascript I'd like to use a test like "if (userSettings.isPref("gay"))" to test whether or not the user is gay.
Unfortunately isPref() only tests for the existence of a key named "gay", essentially doing the same as "if userSettings.keyExists("gay", "Boolean")". To find out if the user is gay I have to use
"if (String(userSettings.isPref("gay")) == 'true' ) which is a little more cumbersome and not intuitive.
I think there should be one way to test for the existence of a key, and another to test the value of the key.
I'd also like to see a preference that simply records the orientation like userSettings.setPref("userOrientation", "straight");
Cheers,
Playful
Re: GuideMe (TeaseMe v2.0): BETA Thread
Posted: Thu May 29, 2014 10:17 pm
by philo
PlayfulGuy wrote:
Is there an easy way to test a boolean preference? For example, in preferences (UserSettingsUI.xml) there are three variables used to record orientation - gay, bi and straight, with each being either true or false.
Unfortunately isPref() only tests for the existence of a key named "gay", essentially doing the same as "if userSettings.keyExists("gay", "Boolean")". To find out if the user is gay I have to use
"if (String(userSettings.isPref("gay")) == 'true' ) which is a little more cumbersome and not intuitive.
I think the main issue is that usersettings.isPref returns a java boolean not a javascript boolean.
JavaScript sees it as an object containing a boolean
if (userSettings.isPref("gay") == true )
will work as it tests the value of the object returned
if (userSettings.isPref("gay"))
will only test to see if an object is returned
PlayfulGuy wrote:
I'd also like to see a preference that simply records the orientation like userSettings.setPref("userOrientation", "straight");
all the user settings are defined in userSettingsUI.xml, what is currently there is a suggestion for the beta testing. If there is a consensus that these be changed or added to that is fine.
I think there are advantages and disadvantages to having them as separate boolean values and a single text value, but I would not want both
Re: GuideMe (TeaseMe v2.0): BETA Thread
Posted: Fri May 30, 2014 5:30 pm
by meson1
Phil
It seems you cannot pass parameters to the JS functions invoked by the onclick clauses.
For instance, if I set up a button like this:
overRide.addButton("page8","Anal","","",'clickGuess("A")',"");
... the JS log says it cannot find function clickGuess("A"), even though clickGuess is quite clearly defined.
If I remove the parameter like this:
overRide.addButton("page8","Anal","","",'clickGuess()',"");
... it works in so far as it finds and runs the function.
Worth a look?
Re: GuideMe (TeaseMe v2.0): BETA Thread
Posted: Fri May 30, 2014 6:49 pm
by philo
meson1 wrote:Phil
It seems you cannot pass parameters to the JS functions invoked by the onclick clauses.
For instance, if I set up a button like this:
overRide.addButton("page8","Anal","","",'clickGuess("A")',"");
... the JS log says it cannot find function clickGuess("A"), even though clickGuess is quite clearly defined.
If I remove the parameter like this:
overRide.addButton("page8","Anal","","",'clickGuess()',"");
... it works in so far as it finds and runs the function.
Worth a look?
I have always set it in scriptvars rather than passed as a parameter
I have had a quick look and it should be fairly easy to add it
New Version 0.1.1
Posted: Mon Jun 02, 2014 8:41 pm
by philo
You will need 0.1.0 installed
Over write the GuideMe.jar file with the one below
https://mega.co.nz/#!dVowEDTY!286YiCMda ... zVPJoCYg9I
Functions can now have parameters
Parameters are separated by commas so you can't pass a string with a comma in it.
No need for quotes around strings
Code: Select all
<javascript> <![CDATA[ function pageLoad() { overRide.addButton("title","Function A","","","clickGuess(A,12)",""); overRide.addButton("title","Function B","","","clickGuess(B,34)",""); } function clickGuess(arg1, arg2) { scriptVars.put("guess", arg1); scriptVars.put("number", arg2); } ]]> </javascript>
Animated gifs were broken in 0.1.0 this has been fixed in 0.1.1
Re: GuideMe (TeaseMe v2.0): BETA Thread
Posted: Tue Jun 03, 2014 4:13 pm
by richman2
Hi there, I have a problem using the download-tool for Milovana, provided for GuideMe.
I can open it (32bit Version), Milovana loads, I can copy a link but where to paste it?!
Is the bottom field supposed to look like on the sceenshot I made?
Thanks for help
Re: GuideMe (TeaseMe v2.0): BETA Thread
Posted: Tue Jun 03, 2014 5:17 pm
by philo
richman2 wrote:Hi there, I have a problem using the download-tool for Milovana, provided for GuideMe.
I can open it (32bit Version), Milovana loads, I can copy a link but where to paste it?!
Is the bottom field supposed to look like on the sceenshot I made?
Thanks for help
Yes you should be able to paste the tease link in the white box, then click save.
it should then download the tease
Re: GuideMe (TeaseMe v2.0): BETA Thread
Posted: Tue Jun 03, 2014 6:03 pm
by richman2
mh this is not possible... cant paste it (not by rightclick paste nor by crtl+v). The bottom window is just like dead (although I can click the save button)
Any suggestions?
Re: GuideMe (TeaseMe v2.0): BETA Thread
Posted: Tue Jun 03, 2014 7:10 pm
by philo
richman2 wrote:mh this is not possible... cant paste it (not by rightclick paste nor by crtl+v). The bottom window is just like dead (although I can click the save button)
Any suggestions?

- Capture.PNG (490.04 KiB) Viewed 2913 times
both right click and paste and ctrl+v should work
Not sure what to try really.
There is a log file that records errors milo.log in the logs directory.
either attach it or post the contents it may give an idea what is going on.
Download 0.0.2
Posted: Wed Jun 04, 2014 8:34 pm
by philo
philo wrote:Trusfrated wrote:
Ah yes, that was it! Thanks for explaining that. I recall how TeaseMe has the same issue but I never understood why or when you would get the incorrect link. Now I see it comes from the TOTM section of the page, and that's where I was copying the link from. I just downloaded it successfully with your program using the proper link.
Do you anticipate developing this program any further, or is it simply to download teases and nothing else?
The reason it does not work in teaseme is the script version attribute is missing at the top of the file. I added it manually and it worked. I will fix that.
Fix to add the version attribute so it will work for TeaseMe
Just need to over write the download.jar form 0.0.1 with the one below
https://mega.co.nz/#!sFB1UJYZ!PquLvpj31 ... i_XddfOExE
Fixed this a while ago but forgot to release it

Re: GuideMe (TeaseMe v2.0): BETA Thread
Posted: Wed Jun 04, 2014 9:28 pm
by PlayfulGuy
@philo:
Forgive me if I'm being dense, but having sorted out how to test for the existence of the boolean preferences I'm now bumping into the same issue with the string and numeric preferences. What would make more sense to me is to have one function like guideSettings.isPref(name) that lets you find out whether or not a setting exists, regardless of type, then others to set or get the value of the bool/string/numeric preferences.
Maybe I'm missing something, but can you give me examples of how to test for the existence of the setting of each type?
What I want to do in the start page of a tease is
Code: Select all
find out if a setting exists if not set a default value retrieve the current value (setting the default above ensures it exists)
Thanks,
PG
Re: GuideMe (TeaseMe v2.0): BETA Thread
Posted: Thu Jun 05, 2014 8:43 pm
by richman2
So here is the file:
Code: Select all
2014-06-05 22:39:40,052 ERROR MainShell - shellCloseListen java.lang.NullPointerException at org.milo.download.MainShell$shellCloseListen.shellClosed(MainShell.java:178) at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source) at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Decorations.closeWidget(Unknown Source) at org.eclipse.swt.widgets.Decorations.WM_CLOSE(Unknown Source) at org.eclipse.swt.widgets.Control.windowProc(Unknown Source) at org.eclipse.swt.widgets.Canvas.windowProc(Unknown Source) at org.eclipse.swt.widgets.Decorations.windowProc(Unknown Source) at org.eclipse.swt.widgets.Shell.windowProc(Unknown Source) at org.eclipse.swt.widgets.Display.windowProc(Unknown Source) at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.DefWindowProc(Unknown Source) at org.eclipse.swt.widgets.Shell.callWindowProc(Unknown Source) at org.eclipse.swt.widgets.Control.windowProc(Unknown Source) at org.eclipse.swt.widgets.Canvas.windowProc(Unknown Source) at org.eclipse.swt.widgets.Decorations.windowProc(Unknown Source) at org.eclipse.swt.widgets.Shell.windowProc(Unknown Source) at org.eclipse.swt.widgets.Display.windowProc(Unknown Source) at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.DefWindowProc(Unknown Source) at org.eclipse.swt.widgets.Shell.callWindowProc(Unknown Source) at org.eclipse.swt.widgets.Control.windowProc(Unknown Source) at org.eclipse.swt.widgets.Canvas.windowProc(Unknown Source) at org.eclipse.swt.widgets.Decorations.windowProc(Unknown Source) at org.eclipse.swt.widgets.Shell.windowProc(Unknown Source) at org.eclipse.swt.widgets.Display.windowProc(Unknown Source) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(Unknown Source) at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) at org.milo.download.App.main(App.java:37)
does that help?