[Tease Program] Tease-AI Java (1.4)

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

Triple Alfa
Explorer At Heart
Explorer At Heart
Posts: 175
Joined: Wed Dec 05, 2007 12:35 pm

Re: [Tease Program] Tease-AI Java (1.2.2)

Post by Triple Alfa »

SOLVED:
I was missing RandomUtils.js from Spicy.

I'm getting an exception when using a runnable vocabulary.
My Code:

Code: Select all

sendMessage("%CapWonderful%.");
The Vocab(Called "CapWonderful.js)":

Code: Select all

function capWonderfulVocabulary(){
    if (getVar(VARIABLE.DOMME_USES_FRENCH, false) === true) {
        const answers = ["Magnifique", "Merveilleux"];
        return answers[randomInteger(0, answers.length - 1)];
    }else {
        const answers = ["Wonderful"];
        return answers[randomInteger(0, answers.length - 1)];
    }
}
The Log:

Code: Select all

10:30:48 am INFO: Checking libraries for updates...
10:30:48 am INFO: Library uber-EstimAPI-0.0.1-SNAPSHOT.jar is only local but keeping and not deleting.
10:30:48 am INFO: Libraries checked and up-to-date.
10:30:48 am INFO: Initialization done.
10:30:49 am INFO: Launching TAJ 1.2.2
Warning: Nashorn engine is planned to be removed from a future JDK release
10:30:50 am INFO: Personality 'Amelie' version 0.0.1 loaded.
10:30:50 am INFO: Personality 'Default Personality' version 1.0 loaded.
10:30:53 am INFO: Loaded 0 picture sets for Widowmaker
10:30:53 am INFO: Loaded 0 picture sets for Tracer
10:30:53 am INFO: Loaded 0 picture sets for Pharah
10:30:53 am INFO: Loaded 0 picture sets for Brigitte
Set script thread!
Warning: Nashorn engine is planned to be removed from a future JDK release
10:30:59 am INFO: Loaded 10 vocabularies.
10:30:59 am INFO: Loaded 0 responses.
10:30:59 am INFO: main: Beginning
10:30:59 am INFO: startsession: Choosing starting module
10:30:59 am INFO: FirstSessionTeasing: Beginning
10:30:59 am CHAT: 10:30 am Widowmaker: 4
10:31:08 am CHAT: 10:31 am Widowmaker: Welcome back, boyfriend :)
10:31:14 am CHAT: 10:31 am Widowmaker: Ready for our first real session?
10:31:19 am CHAT: 10:31 am Anon: Yes Mistress
Exception in thread "Thread-29" java.lang.ClassCastException: class java.lang.Double cannot be cast to class java.lang.Integer (java.lang.Double and java.lang.Integer are in module java.base of loader 'bootstrap')
	at me.goddragon.teaseai.api.scripts.nashorn.RandomIntegerFunction.call(RandomIntegerFunction.java:36)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker.JSObjectLinker.jsObjectScopeCall(JSObjectLinker.java:254)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$13$\^eval\_/0x00000008011d0c40.capWonderfulVocabulary(<eval>:4)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.ScriptObjectMirror.callMember(ScriptObjectMirror.java:202)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScriptEngine.java:393)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.invokeFunction(NashornScriptEngine.java:197)
	at me.goddragon.teaseai.api.chat.vocabulary.RunableVocabulary.toString(RunableVocabulary.java:52)
	at me.goddragon.teaseai.api.chat.vocabulary.VocabularyHandler.replaceAllVocabularies(VocabularyHandler.java:121)
	at me.goddragon.teaseai.api.chat.vocabulary.VocabularyHandler.replaceAllVocabularies(VocabularyHandler.java:110)
	at me.goddragon.teaseai.api.chat.ChatParticipant.customMessage(ChatParticipant.java:103)
	at me.goddragon.teaseai.api.scripts.nashorn.SendMessageFunction.call(SendMessageFunction.java:32)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker.JSObjectLinker.jsObjectScopeCall(JSObjectLinker.java:254)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$12$\^eval\_.:scopeCall-1(<eval>)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$12$\^eval\_.:program(<eval>:14)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:456)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:413)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:409)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:157)
	at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249)
	at me.goddragon.teaseai.api.scripts.ScriptHandler.runScript(ScriptHandler.java:191)
	at me.goddragon.teaseai.api.scripts.ScriptHandler.evalScript(ScriptHandler.java:172)
	at me.goddragon.teaseai.api.scripts.nashorn.RunFunction.call(RunFunction.java:30)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker.JSObjectLinker.jsObjectScopeCall(JSObjectLinker.java:254)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$11$\^eval\_.:program(<eval>:16)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:456)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:413)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:409)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:157)
	at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249)
	at me.goddragon.teaseai.api.scripts.ScriptHandler.runScript(ScriptHandler.java:191)
	at me.goddragon.teaseai.api.scripts.ScriptHandler.evalScript(ScriptHandler.java:172)
	at me.goddragon.teaseai.api.scripts.nashorn.RunFunction.call(RunFunction.java:30)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker.JSObjectLinker.jsObjectScopeCall(JSObjectLinker.java:254)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$6$\^eval\_/0x000000080114b440.:program(<eval>:8)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:456)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:413)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:409)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:157)
	at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249)
	at me.goddragon.teaseai.api.scripts.ScriptHandler.runScript(ScriptHandler.java:191)
	at me.goddragon.teaseai.api.scripts.ScriptHandler.startPersonality(ScriptHandler.java:145)
	at me.goddragon.teaseai.api.scripts.ScriptHandler.startPersonality(ScriptHandler.java:125)
	at me.goddragon.teaseai.api.session.Session$1.run(Session.java:41)
I copied the function from Spicy so I don't understand what I'm doing wrong here.
GodDragon
Explorer At Heart
Explorer At Heart
Posts: 795
Joined: Sun Jun 11, 2017 4:30 pm
Gender: Male
Sexual Orientation: Straight
I am a: Switch

Re: [Tease Program] Tease-AI Java (1.2.2)

Post by GodDragon »

Triple Alfa wrote: Fri May 08, 2020 8:50 pm Bug report:
Images in main viewer do not rescale when the window is resized.
Steps to repeat:
1) Start with TAJ in a small window.
2) Start personality that loads a high resolution image.
3) Enlarge TAJ to fullscreen.
4) The high-res image is now low-res.
5) Start with TAJ in fullscreen.
6) Start personality that loads a high resolution image.
7) Observe the difference.
Dunno if that is too relevant to fix right now. Images often switch quite frequently and you rarely resize the window during runtime imo.
Triple Alfa wrote: Sat May 09, 2020 8:44 am SOLVED:
I was missing RandomUtils.js from Spicy.

I'm getting an exception when using a runnable vocabulary.
My Code:

Code: Select all

sendMessage("%CapWonderful%.");
The Vocab(Called "CapWonderful.js)":

Code: Select all

function capWonderfulVocabulary(){
    if (getVar(VARIABLE.DOMME_USES_FRENCH, false) === true) {
        const answers = ["Magnifique", "Merveilleux"];
        return answers[randomInteger(0, answers.length - 1)];
    }else {
        const answers = ["Wonderful"];
        return answers[randomInteger(0, answers.length - 1)];
    }
}
The Log:

Code: Select all

10:30:48 am INFO: Checking libraries for updates...
10:30:48 am INFO: Library uber-EstimAPI-0.0.1-SNAPSHOT.jar is only local but keeping and not deleting.
10:30:48 am INFO: Libraries checked and up-to-date.
10:30:48 am INFO: Initialization done.
10:30:49 am INFO: Launching TAJ 1.2.2
Warning: Nashorn engine is planned to be removed from a future JDK release
10:30:50 am INFO: Personality 'Amelie' version 0.0.1 loaded.
10:30:50 am INFO: Personality 'Default Personality' version 1.0 loaded.
10:30:53 am INFO: Loaded 0 picture sets for Widowmaker
10:30:53 am INFO: Loaded 0 picture sets for Tracer
10:30:53 am INFO: Loaded 0 picture sets for Pharah
10:30:53 am INFO: Loaded 0 picture sets for Brigitte
Set script thread!
Warning: Nashorn engine is planned to be removed from a future JDK release
10:30:59 am INFO: Loaded 10 vocabularies.
10:30:59 am INFO: Loaded 0 responses.
10:30:59 am INFO: main: Beginning
10:30:59 am INFO: startsession: Choosing starting module
10:30:59 am INFO: FirstSessionTeasing: Beginning
10:30:59 am CHAT: 10:30 am Widowmaker: 4
10:31:08 am CHAT: 10:31 am Widowmaker: Welcome back, boyfriend :)
10:31:14 am CHAT: 10:31 am Widowmaker: Ready for our first real session?
10:31:19 am CHAT: 10:31 am Anon: Yes Mistress
Exception in thread "Thread-29" java.lang.ClassCastException: class java.lang.Double cannot be cast to class java.lang.Integer (java.lang.Double and java.lang.Integer are in module java.base of loader 'bootstrap')
	at me.goddragon.teaseai.api.scripts.nashorn.RandomIntegerFunction.call(RandomIntegerFunction.java:36)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker.JSObjectLinker.jsObjectScopeCall(JSObjectLinker.java:254)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$13$\^eval\_/0x00000008011d0c40.capWonderfulVocabulary(<eval>:4)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.ScriptObjectMirror.callMember(ScriptObjectMirror.java:202)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScriptEngine.java:393)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.invokeFunction(NashornScriptEngine.java:197)
	at me.goddragon.teaseai.api.chat.vocabulary.RunableVocabulary.toString(RunableVocabulary.java:52)
	at me.goddragon.teaseai.api.chat.vocabulary.VocabularyHandler.replaceAllVocabularies(VocabularyHandler.java:121)
	at me.goddragon.teaseai.api.chat.vocabulary.VocabularyHandler.replaceAllVocabularies(VocabularyHandler.java:110)
	at me.goddragon.teaseai.api.chat.ChatParticipant.customMessage(ChatParticipant.java:103)
	at me.goddragon.teaseai.api.scripts.nashorn.SendMessageFunction.call(SendMessageFunction.java:32)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker.JSObjectLinker.jsObjectScopeCall(JSObjectLinker.java:254)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$12$\^eval\_.:scopeCall-1(<eval>)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$12$\^eval\_.:program(<eval>:14)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:456)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:413)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:409)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:157)
	at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249)
	at me.goddragon.teaseai.api.scripts.ScriptHandler.runScript(ScriptHandler.java:191)
	at me.goddragon.teaseai.api.scripts.ScriptHandler.evalScript(ScriptHandler.java:172)
	at me.goddragon.teaseai.api.scripts.nashorn.RunFunction.call(RunFunction.java:30)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker.JSObjectLinker.jsObjectScopeCall(JSObjectLinker.java:254)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$11$\^eval\_.:program(<eval>:16)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:456)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:413)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:409)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:157)
	at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249)
	at me.goddragon.teaseai.api.scripts.ScriptHandler.runScript(ScriptHandler.java:191)
	at me.goddragon.teaseai.api.scripts.ScriptHandler.evalScript(ScriptHandler.java:172)
	at me.goddragon.teaseai.api.scripts.nashorn.RunFunction.call(RunFunction.java:30)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker.JSObjectLinker.jsObjectScopeCall(JSObjectLinker.java:254)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$6$\^eval\_/0x000000080114b440.:program(<eval>:8)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:655)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:513)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:527)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:456)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:413)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:409)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:157)
	at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249)
	at me.goddragon.teaseai.api.scripts.ScriptHandler.runScript(ScriptHandler.java:191)
	at me.goddragon.teaseai.api.scripts.ScriptHandler.startPersonality(ScriptHandler.java:145)
	at me.goddragon.teaseai.api.scripts.ScriptHandler.startPersonality(ScriptHandler.java:125)
	at me.goddragon.teaseai.api.session.Session$1.run(Session.java:41)
I copied the function from Spicy so I don't understand what I'm doing wrong here.
Was about say that while this might indeed is a bug inside the version of TAJ it works in Spicy since I am using a custom version of that function. Glad you got it working.
Triple Alfa
Explorer At Heart
Explorer At Heart
Posts: 175
Joined: Wed Dec 05, 2007 12:35 pm

Re: [Tease Program] Tease-AI Java (1.2.2)

Post by Triple Alfa »

GodDragon wrote: Sat May 09, 2020 12:32 pm Dunno if that is too relevant to fix right now. Images often switch quite frequently and you rarely resize the window during runtime imo.
Probably low priority. The one case where it will probably happen to a real user is right at the start where they could click start first before switching to fullscreen. This is what happened to me during testing. I made a simple intro logo/image and that sticks around through my narrator bit, so it was very noticeable. Beyond that point it seems unlikely people would resize the window unless they were multi-tasking.

Edit:
Oh and I had one even lower priority bug to report:
The first line written in the chat is misaligned one position to the left.
Maybe you can get that in polish a year from now xD

Edit2:
One, more important, bug/oversight:
All lines in the chat automatically have their first letter capitalized.
The problem here is that that is not always appropriate. For example:
"I could do the thing you like,"
"But not yet :D"
The sentence gets finished in the second line, and the "B" in "But" should not be capitalized.
It also seems a little redundant as we have full control over capitalization. And it feels a bit strange to have the sub's messages not appear exactly as they typed it.
Manolas Smith
Explorer
Explorer
Posts: 56
Joined: Sat Feb 25, 2017 5:16 pm
Gender: Male
Sexual Orientation: Straight
I am a: Slave

Re: [Tease Program] Tease-AI Java (1.2.2)

Post by Manolas Smith »

Hi!

I've been trying to find information about this, and although it seems to be a recurring problem, I haven't really understood how to fix this.
During the session on Spicy, most of the url files doens't show, and neither does the Domme images. I've setup it as indicated (actually I haven't changed the url files from the last update, which I have installed from scratch).

Sometimes, a couple of domme images show, but most of the time don't.

Any help here?

Thanks!
Triple Alfa
Explorer At Heart
Explorer At Heart
Posts: 175
Joined: Wed Dec 05, 2007 12:35 pm

Re: [Tease Program] Tease-AI Java (1.2.2)

Post by Triple Alfa »

WORKAROUND/SOLUTION FOUND

I'm having troubles with one of my new functions.
A do/while loop does not seem to function correctly.
Full code:

Code: Select all

function showRandomImage(numOfImgs, delay, category){
    sendDebugMessage("numOfImgs: " + numOfImgs); //DEBUG
    sendDebugMessage("delay: " + delay); //DEBUG
    sendDebugMessage("category: " + category); //DEBUG

    if (numOfImgs === undefined || numOfImgs <= 0){ numOfImgs = 1; }
    if (delay === undefined || delay < 0){ delay = 0; }
    if (category === undefined){
        sendDebugMessage("No category"); //DEBUG
        let i;
        let lastRnd = -2;
        for (i = 0; i < numOfImgs; i++){
            let rnd;
            do{
                rnd = randomInteger(0, allActiveTeaseImages.length - 1);
            }while (rnd === lastRnd)
            lastRnd = rnd;
            showImage(allActiveTeaseImages[rnd]);
            sleep(delay);
        }
    }else {
        let i;
        let image;
        let lastImage = null;
        for (i = 0; i < numOfImgs; i++){
            do {
                image = showImage(getImageSubFolder(category) + separator + "*.*");
                sendDebugMessage("image in loop: " + image);
                sendDebugMessage("lastImage in loop: " + lastImage);
            }while (image === lastImage)
            sendDebugMessage("image after loop: " + image);
            sendDebugMessage("lastImage after loop: " + lastImage);
            lastImage = image;
            sleep(delay);
        }
    }
}
Problematic code:

Code: Select all

else {
        let i;
        let image;
        let lastImage = null;
        for (i = 0; i < numOfImgs; i++){
            do {
                image = showImage(getImageSubFolder(category) + separator + "*.*");
                sendDebugMessage("image in loop: " + image);
                sendDebugMessage("lastImage in loop: " + lastImage);
            }while (image === lastImage)
            sendDebugMessage("image after loop: " + image);
            sendDebugMessage("lastImage after loop: " + lastImage);
            lastImage = image;
            sleep(delay);
        }
    }
The do/while loop is supposed to make sure that the last image shown is not the same image as the new image. It should keep looping until showImage() produces a new image. The problem is that the loop ends even when image and lastImage are the same as can be seen in the log:

Code: Select all

02:51:38 pm INFO: Checking libraries for updates...
02:51:39 pm INFO: Library uber-EstimAPI-0.0.1-SNAPSHOT.jar is only local but keeping and not deleting.
02:51:39 pm INFO: Libraries checked and up-to-date.
02:51:39 pm INFO: Initialization done.
02:51:39 pm INFO: Launching TAJ 1.2.2
Warning: Nashorn engine is planned to be removed from a future JDK release
02:51:41 pm INFO: Personality 'Amelie' version 0.0.1 loaded.
02:51:41 pm INFO: Personality 'Default Personality' version 1.0 loaded.
02:51:44 pm INFO: Loaded 0 picture sets for Widowmaker
02:51:44 pm INFO: Loaded 0 picture sets for Tracer
02:51:44 pm INFO: Loaded 0 picture sets for Pharah
02:51:44 pm INFO: Loaded 0 picture sets for Brigitte
Set script thread!
Warning: Nashorn engine is planned to be removed from a future JDK release
02:51:48 pm INFO: Loaded 10 vocabularies.
02:51:48 pm INFO: Loaded 0 responses.
02:51:48 pm INFO: main: Beginning
02:51:49 pm INFO: startsession: Choosing starting module
02:51:49 pm INFO: FirstSessionTeasing: Beginning
02:51:51 pm CHAT: 02:51 pm Widowmaker: Welcome back, boyfriend :)
02:51:52 pm CHAT: 02:51 pm Widowmaker: Ready for our first real session?
02:51:53 pm CHAT: 02:51 pm Anon: Yes Mistress
02:51:53 pm CHAT: 02:51 pm Widowmaker: Magnifique.
02:51:54 pm CHAT: 02:51 pm Widowmaker: Are you nice and horny for me like I asked?
02:51:58 pm CHAT: 02:51 pm Anon: Yes Mistress
02:51:58 pm CHAT: 02:51 pm Widowmaker: Perfect!
02:51:59 pm CHAT: 02:51 pm Widowmaker: So...
02:52:00 pm CHAT: 02:52 pm Widowmaker: You didn't happen to ruin your last orgasm for me, did you?
02:52:00 pm CHAT: 02:52 pm Anon: No Mistress
02:52:00 pm CHAT: 02:52 pm Widowmaker: That's too bad.
02:52:01 pm CHAT: 02:52 pm Widowmaker: Maybe next time :)
02:52:02 pm CHAT: 02:52 pm Widowmaker: Now before we can start I have to ask you:
02:52:03 pm CHAT: 02:52 pm Widowmaker: How many minutes do I have to play with you today Anon?
02:52:04 pm CHAT: 02:52 pm Anon: 60
02:52:04 pm CHAT: 02:52 pm Widowmaker: Great, I'll keep that in mind.
02:52:05 pm CHAT: 02:52 pm Widowmaker: Well then, let's get our first session started.
02:52:06 pm CHAT: 02:52 pm Widowmaker: Grab that cock for me.
02:52:07 pm CHAT: 02:52 pm Widowmaker: A medium grip will do.
02:52:08 pm CHAT: 02:52 pm Widowmaker: And give me one full stroke for every beat.
02:52:13 pm CHAT: 02:52 pm Widowmaker: Very good.
02:52:18 pm CHAT: 02:52 pm Widowmaker: In anticipation of becoming your girlfriend I've been collecting some porn for you to stroke to.
02:52:19 pm CHAT: 02:52 pm Widowmaker: Only the hottest, sexiest, most irresistible porn made the cut of course. 
02:52:20 pm CHAT: 02:52 pm Widowmaker: Only the best for my cute boyfriend :)
02:52:21 pm CHAT: 02:52 pm Widowmaker: So let's see...
02:52:22 pm CHAT: 02:52 pm Widowmaker: Ah I'm sure you'll appreciate some hot asses to stroke to.
02:52:23 pm INFO: numOfImgs: 10
02:52:23 pm INFO: delay: 4
02:52:23 pm INFO: category: Asses
02:52:23 pm INFO: image in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:23 pm INFO: lastImage in loop: null
02:52:23 pm INFO: image after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:23 pm INFO: lastImage after loop: null
02:52:27 pm INFO: image in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:27 pm INFO: lastImage in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:27 pm INFO: image after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:27 pm INFO: lastImage after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:31 pm INFO: image in loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:31 pm INFO: lastImage in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:31 pm INFO: image after loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:31 pm INFO: lastImage after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:35 pm INFO: image in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:35 pm INFO: lastImage in loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:35 pm INFO: image after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:35 pm INFO: lastImage after loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:39 pm INFO: image in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:39 pm INFO: lastImage in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:39 pm INFO: image after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:39 pm INFO: lastImage after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:43 pm INFO: image in loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:43 pm INFO: lastImage in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:43 pm INFO: image after loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:43 pm INFO: lastImage after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:47 pm INFO: image in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:47 pm INFO: lastImage in loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:47 pm INFO: image after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:47 pm INFO: lastImage after loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:51 pm INFO: image in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:51 pm INFO: lastImage in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:51 pm INFO: image after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:51 pm INFO: lastImage after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:55 pm INFO: image in loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:55 pm INFO: lastImage in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:55 pm INFO: image after loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:55 pm INFO: lastImage after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:59 pm INFO: image in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:59 pm INFO: lastImage in loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:59 pm INFO: image after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:59 pm INFO: lastImage after loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:53:03 pm CHAT: 02:53 pm Widowmaker: Now remember, you're not allowed to edge without permission.
02:53:04 pm CHAT: 02:53 pm Widowmaker: But you're also not allowed to slow down.
02:53:05 pm CHAT: 02:53 pm Widowmaker: I expect you to control yourself.
02:53:06 pm CHAT: 02:53 pm Widowmaker: If you do hit the edge without permission you will hold the edge and tell me immediately.
02:53:07 pm CHAT: 02:53 pm Widowmaker: But I'm sure it won't come to that ;)
02:53:12 pm WARNING: End Stroke was called but can't find an active Stroke!
re it won't come to that ;)
02:53:12 pm WARNING: End Stroke was called but can't find an active Stroke!
At 02:52:27 pm you can see that inside of the loop image and lastImage have the same value. Despite that the loop ends and the after loop debug message also shows the two variables being the same.

I do not understand how this is possible. Is there a bug or am I overlooking an error on my part?

Edit:
I added an if statement after the loop to compare image and lastImage and it never equals to true either:

Code: Select all

else {
        let i;
        let image;
        let lastImage = null;
        for (i = 0; i < numOfImgs; i++){
            do {
                image = showImage(getImageSubFolder(category) + separator + "*.*");
                sendDebugMessage("image in loop: " + image); //DEBUG
                sendDebugMessage("lastImage in loop: " + lastImage); //DEBUG
            }while (image === lastImage)
            sendDebugMessage("image after loop: " + image); //DEBUG
            sendDebugMessage("lastImage after loop: " + lastImage); //DEBUG
            if(image === lastImage){ sendDebugMessage("image === lastImage") } //DEBUG
            lastImage = image;
            sleep(delay);
        }
    }
So somehow the two are different, but I don't understand how that is possible if after every loop I do "lastImage = image;".

Edit2:
I used "typeof" to check the type of both variables after the loop and both come back as object.

Edit3:
WORKAROUND/SOLUTION:

Since both are objects by doing the comparison using the string conversions of both objects the issue is avoided:

Code: Select all

else {
        let i;
        let image;
        let lastImage = "";
        for (i = 0; i < numOfImgs; i++){
            do {
                image = showImage(getImageSubFolder(category) + separator + "*.*");
            }while (image.toString() === lastImage.toString())
            lastImage = image;
            sleep(delay);
        }
    }
I guess two objects can never be equal?
Last edited by Triple Alfa on Thu May 14, 2020 1:50 pm, edited 1 time in total.
ski23
Explorer At Heart
Explorer At Heart
Posts: 466
Joined: Sun Jun 11, 2017 12:53 am
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): Courtney
Sub/Slave(s): Courtney
Location: Virginia
Contact:

Re: [Tease Program] Tease-AI Java (1.2.2)

Post by ski23 »

Triple Alfa wrote: Thu May 14, 2020 1:08 pm I'm having troubles with one of my new functions.
A do/while loop does not seem to function correctly.
Full code:

Code: Select all

function showRandomImage(numOfImgs, delay, category){
    sendDebugMessage("numOfImgs: " + numOfImgs); //DEBUG
    sendDebugMessage("delay: " + delay); //DEBUG
    sendDebugMessage("category: " + category); //DEBUG

    if (numOfImgs === undefined || numOfImgs <= 0){ numOfImgs = 1; }
    if (delay === undefined || delay < 0){ delay = 0; }
    if (category === undefined){
        sendDebugMessage("No category"); //DEBUG
        let i;
        let lastRnd = -2;
        for (i = 0; i < numOfImgs; i++){
            let rnd;
            do{
                rnd = randomInteger(0, allActiveTeaseImages.length - 1);
            }while (rnd === lastRnd)
            lastRnd = rnd;
            showImage(allActiveTeaseImages[rnd]);
            sleep(delay);
        }
    }else {
        let i;
        let image;
        let lastImage = null;
        for (i = 0; i < numOfImgs; i++){
            do {
                image = showImage(getImageSubFolder(category) + separator + "*.*");
                sendDebugMessage("image in loop: " + image);
                sendDebugMessage("lastImage in loop: " + lastImage);
            }while (image === lastImage)
            sendDebugMessage("image after loop: " + image);
            sendDebugMessage("lastImage after loop: " + lastImage);
            lastImage = image;
            sleep(delay);
        }
    }
}
Problematic code:

Code: Select all

else {
        let i;
        let image;
        let lastImage = null;
        for (i = 0; i < numOfImgs; i++){
            do {
                image = showImage(getImageSubFolder(category) + separator + "*.*");
                sendDebugMessage("image in loop: " + image);
                sendDebugMessage("lastImage in loop: " + lastImage);
            }while (image === lastImage)
            sendDebugMessage("image after loop: " + image);
            sendDebugMessage("lastImage after loop: " + lastImage);
            lastImage = image;
            sleep(delay);
        }
    }
The do/while loop is supposed to make sure that the last image shown is not the same image as the new image. It should keep looping until showImage() produces a new image. The problem is that the loop ends even when image and lastImage are the same as can be seen in the log:

Code: Select all

02:51:38 pm INFO: Checking libraries for updates...
02:51:39 pm INFO: Library uber-EstimAPI-0.0.1-SNAPSHOT.jar is only local but keeping and not deleting.
02:51:39 pm INFO: Libraries checked and up-to-date.
02:51:39 pm INFO: Initialization done.
02:51:39 pm INFO: Launching TAJ 1.2.2
Warning: Nashorn engine is planned to be removed from a future JDK release
02:51:41 pm INFO: Personality 'Amelie' version 0.0.1 loaded.
02:51:41 pm INFO: Personality 'Default Personality' version 1.0 loaded.
02:51:44 pm INFO: Loaded 0 picture sets for Widowmaker
02:51:44 pm INFO: Loaded 0 picture sets for Tracer
02:51:44 pm INFO: Loaded 0 picture sets for Pharah
02:51:44 pm INFO: Loaded 0 picture sets for Brigitte
Set script thread!
Warning: Nashorn engine is planned to be removed from a future JDK release
02:51:48 pm INFO: Loaded 10 vocabularies.
02:51:48 pm INFO: Loaded 0 responses.
02:51:48 pm INFO: main: Beginning
02:51:49 pm INFO: startsession: Choosing starting module
02:51:49 pm INFO: FirstSessionTeasing: Beginning
02:51:51 pm CHAT: 02:51 pm Widowmaker: Welcome back, boyfriend :)
02:51:52 pm CHAT: 02:51 pm Widowmaker: Ready for our first real session?
02:51:53 pm CHAT: 02:51 pm Anon: Yes Mistress
02:51:53 pm CHAT: 02:51 pm Widowmaker: Magnifique.
02:51:54 pm CHAT: 02:51 pm Widowmaker: Are you nice and horny for me like I asked?
02:51:58 pm CHAT: 02:51 pm Anon: Yes Mistress
02:51:58 pm CHAT: 02:51 pm Widowmaker: Perfect!
02:51:59 pm CHAT: 02:51 pm Widowmaker: So...
02:52:00 pm CHAT: 02:52 pm Widowmaker: You didn't happen to ruin your last orgasm for me, did you?
02:52:00 pm CHAT: 02:52 pm Anon: No Mistress
02:52:00 pm CHAT: 02:52 pm Widowmaker: That's too bad.
02:52:01 pm CHAT: 02:52 pm Widowmaker: Maybe next time :)
02:52:02 pm CHAT: 02:52 pm Widowmaker: Now before we can start I have to ask you:
02:52:03 pm CHAT: 02:52 pm Widowmaker: How many minutes do I have to play with you today Anon?
02:52:04 pm CHAT: 02:52 pm Anon: 60
02:52:04 pm CHAT: 02:52 pm Widowmaker: Great, I'll keep that in mind.
02:52:05 pm CHAT: 02:52 pm Widowmaker: Well then, let's get our first session started.
02:52:06 pm CHAT: 02:52 pm Widowmaker: Grab that cock for me.
02:52:07 pm CHAT: 02:52 pm Widowmaker: A medium grip will do.
02:52:08 pm CHAT: 02:52 pm Widowmaker: And give me one full stroke for every beat.
02:52:13 pm CHAT: 02:52 pm Widowmaker: Very good.
02:52:18 pm CHAT: 02:52 pm Widowmaker: In anticipation of becoming your girlfriend I've been collecting some porn for you to stroke to.
02:52:19 pm CHAT: 02:52 pm Widowmaker: Only the hottest, sexiest, most irresistible porn made the cut of course. 
02:52:20 pm CHAT: 02:52 pm Widowmaker: Only the best for my cute boyfriend :)
02:52:21 pm CHAT: 02:52 pm Widowmaker: So let's see...
02:52:22 pm CHAT: 02:52 pm Widowmaker: Ah I'm sure you'll appreciate some hot asses to stroke to.
02:52:23 pm INFO: numOfImgs: 10
02:52:23 pm INFO: delay: 4
02:52:23 pm INFO: category: Asses
02:52:23 pm INFO: image in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:23 pm INFO: lastImage in loop: null
02:52:23 pm INFO: image after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:23 pm INFO: lastImage after loop: null
02:52:27 pm INFO: image in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:27 pm INFO: lastImage in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:27 pm INFO: image after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:27 pm INFO: lastImage after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:31 pm INFO: image in loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:31 pm INFO: lastImage in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:31 pm INFO: image after loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:31 pm INFO: lastImage after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:35 pm INFO: image in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:35 pm INFO: lastImage in loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:35 pm INFO: image after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:35 pm INFO: lastImage after loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:39 pm INFO: image in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:39 pm INFO: lastImage in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:39 pm INFO: image after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:39 pm INFO: lastImage after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:43 pm INFO: image in loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:43 pm INFO: lastImage in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:43 pm INFO: image after loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:43 pm INFO: lastImage after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:47 pm INFO: image in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:47 pm INFO: lastImage in loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:47 pm INFO: image after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:47 pm INFO: lastImage after loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:51 pm INFO: image in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:51 pm INFO: lastImage in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:51 pm INFO: image after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:51 pm INFO: lastImage after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:55 pm INFO: image in loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:55 pm INFO: lastImage in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:55 pm INFO: image after loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:55 pm INFO: lastImage after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:59 pm INFO: image in loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:59 pm INFO: lastImage in loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:52:59 pm INFO: image after loop: Images\Amelie\Asses\a30e9631c0a20c7ec656ea8d0993b43b.png
02:52:59 pm INFO: lastImage after loop: Images\Amelie\Asses\ba9a9955e7483437fd5ad7e54bcdc0e3.jpeg
02:53:03 pm CHAT: 02:53 pm Widowmaker: Now remember, you're not allowed to edge without permission.
02:53:04 pm CHAT: 02:53 pm Widowmaker: But you're also not allowed to slow down.
02:53:05 pm CHAT: 02:53 pm Widowmaker: I expect you to control yourself.
02:53:06 pm CHAT: 02:53 pm Widowmaker: If you do hit the edge without permission you will hold the edge and tell me immediately.
02:53:07 pm CHAT: 02:53 pm Widowmaker: But I'm sure it won't come to that ;)
02:53:12 pm WARNING: End Stroke was called but can't find an active Stroke!
re it won't come to that ;)
02:53:12 pm WARNING: End Stroke was called but can't find an active Stroke!
At 02:52:27 pm you can see that inside of the loop image and lastImage have the same value. Despite that the loop ends and the after loop debug message also shows the two variables being the same.

I do not understand how this is possible. Is there a bug or am I overlooking an error on my part?

Edit:
I added an if statement after the loop to compare image and lastImage and it never equals to true either:

Code: Select all

else {
        let i;
        let image;
        let lastImage = null;
        for (i = 0; i < numOfImgs; i++){
            do {
                image = showImage(getImageSubFolder(category) + separator + "*.*");
                sendDebugMessage("image in loop: " + image); //DEBUG
                sendDebugMessage("lastImage in loop: " + lastImage); //DEBUG
            }while (image === lastImage)
            sendDebugMessage("image after loop: " + image); //DEBUG
            sendDebugMessage("lastImage after loop: " + lastImage); //DEBUG
            if(image === lastImage){ sendDebugMessage("image === lastImage") } //DEBUG
            lastImage = image;
            sleep(delay);
        }
    }
So somehow the two are different, but I don't understand how that is possible if after every loop I do "lastImage = image;".

Edit2:
I used "typeof" to check the type of both variables after the loop and both come back as object.
I took your code and debugged it and was able to figure out what is happening. So, what's going on here isn't super obvious immediately. The showImage function actually returns a java File object not a path. When you were printing the file, it would automatically use the toString function to print the path. However, when trying to do a direct comparison between two files, they are not equal because although they point to the same file, they are two separate instances of a File variable. If you replace image === lastImage with (lastImage != null && image.getPath() === lastImage.getPath) then your code will work as expected. This issue isn't immediately clear because in javascript, comparing two different instances of an object that are equivalent will succeed but in java it will not.
ski23
Explorer At Heart
Explorer At Heart
Posts: 466
Joined: Sun Jun 11, 2017 12:53 am
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): Courtney
Sub/Slave(s): Courtney
Location: Virginia
Contact:

Re: [Tease Program] Tease-AI Java (1.2.2)

Post by ski23 »

Triple Alfa wrote: Sat May 09, 2020 8:04 pm
GodDragon wrote: Sat May 09, 2020 12:32 pm Dunno if that is too relevant to fix right now. Images often switch quite frequently and you rarely resize the window during runtime imo.
Probably low priority. The one case where it will probably happen to a real user is right at the start where they could click start first before switching to fullscreen. This is what happened to me during testing. I made a simple intro logo/image and that sticks around through my narrator bit, so it was very noticeable. Beyond that point it seems unlikely people would resize the window unless they were multi-tasking.

Edit:
Oh and I had one even lower priority bug to report:
The first line written in the chat is misaligned one position to the left.
Maybe you can get that in polish a year from now xD

Edit2:
One, more important, bug/oversight:
All lines in the chat automatically have their first letter capitalized.
The problem here is that that is not always appropriate. For example:
"I could do the thing you like,"
"But not yet :D"
The sentence gets finished in the second line, and the "B" in "But" should not be capitalized.
It also seems a little redundant as we have full control over capitalization. And it feels a bit strange to have the sub's messages not appear exactly as they typed it.
I think the capitalization is appropriate personally. For example, most texting apps will auto capitalize the first letter of the first word when texts are sent so that makes it feel closer to that.
Triple Alfa
Explorer At Heart
Explorer At Heart
Posts: 175
Joined: Wed Dec 05, 2007 12:35 pm

Re: [Tease Program] Tease-AI Java (1.2.2)

Post by Triple Alfa »

ski23 wrote: Thu May 14, 2020 1:44 pm I think the capitalization is appropriate personally. For example, most texting apps will auto capitalize the first letter of the first word when texts are sent so that makes it feel closer to that.
I understand your argument, but let me offer a counter.
Let's say the domme requires her name to always be capitalized. Now the sub types:
dommename
TAJ will display this as:
Dommename
Now the domme will complain about the lack of capitalization even though the chat shows no record of the sub ever having made a mistake.

On a different note I solved the issue I had by comparing the string conversions of both objects instead. I edited my post, but you posted before I was done editing.

Edit:
Thinking about it more the big problem I have with the auto-capitalization is that it is unavoidable. It is a part of the base system of TAJ and there is no way to turn it off. Since authors have full control over the domme's messages the only thing the system adds is auto-capitalization of the sub's messages and even that isn't always beneficial as mentioned. So for me the downsides far outweigh the upsides, but there is no way to avoid the system.
ski23
Explorer At Heart
Explorer At Heart
Posts: 466
Joined: Sun Jun 11, 2017 12:53 am
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): Courtney
Sub/Slave(s): Courtney
Location: Virginia
Contact:

Re: [Tease Program] Tease-AI Java (1.2.2)

Post by ski23 »

Triple Alfa wrote: Thu May 14, 2020 1:59 pm
ski23 wrote: Thu May 14, 2020 1:44 pm I think the capitalization is appropriate personally. For example, most texting apps will auto capitalize the first letter of the first word when texts are sent so that makes it feel closer to that.
I understand your argument, but let me offer a counter.
Let's say the domme requires her name to always be capitalized. Now the sub types:
dommename
TAJ will display this as:
Dommename
Now the domme will complain about the lack of capitalization even though the chat shows no record of the sub ever having made a mistake.

On a different note I solved the issue I had by comparing the string conversions of both objects instead. I edited my post, but you posted before I was done editing.

Edit:
Thinking about it more the big problem I have with the auto-capitalization is that it is unavoidable. It is a part of the base system of TAJ and there is no way to turn it off. Since authors have full control over the domme's messages the only thing the system adds is auto-capitalization of the sub's messages and even that isn't always beneficial as mentioned. So for me the downsides far outweigh the upsides, but there is no way to avoid the system.
I'll create a configuration option in the settings to turn off the capitalization.
EDIT:
Btw, I'm not sure if you know but, there are shorthands for those methods such as sendDebugMessage. You can use dm (stands for debug message) and it will have the same effect without having to type the whole thing every time.

EDIT 2:
I added the configuration option. It will be available in the next version of TAJ or if you don't want to wait you can just use this version I built
Last edited by ski23 on Thu May 14, 2020 6:52 pm, edited 1 time in total.
Triple Alfa
Explorer At Heart
Explorer At Heart
Posts: 175
Joined: Wed Dec 05, 2007 12:35 pm

Re: [Tease Program] Tease-AI Java (1.2.2)

Post by Triple Alfa »

ski23 wrote: Thu May 14, 2020 2:46 pm I'll create a configuration option in the settings to turn off the capitalization.
EDIT:
Btw, I'm not sure if you know but, there are shorthands for those methods such as sendDebugMessage. You can use dm (stands for debug message) and it will have the same effect without having to type the whole thing every time.

EDIT 2:
I added the configuration option. It will be available in the next version of TAJ or if you don't want to wait you can just use this version I built
I did not know that "dm" was a thing, but I'm using an IDE anyway so it auto-completes sendDebugMessage for me.

I tried the version you posted, but now my chat text is invisible! This is with or without the new option checked.
I checked the Appearance tab and the chat should be black, but nothing is showing.

Edit:
Also, why is your .jar almost 48MB while the one I got from goddragon is around 1MB.
ski23
Explorer At Heart
Explorer At Heart
Posts: 466
Joined: Sun Jun 11, 2017 12:53 am
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): Courtney
Sub/Slave(s): Courtney
Location: Virginia
Contact:

Re: [Tease Program] Tease-AI Java (1.2.2)

Post by ski23 »

Triple Alfa wrote: Thu May 14, 2020 5:45 pm
ski23 wrote: Thu May 14, 2020 2:46 pm I'll create a configuration option in the settings to turn off the capitalization.
EDIT:
Btw, I'm not sure if you know but, there are shorthands for those methods such as sendDebugMessage. You can use dm (stands for debug message) and it will have the same effect without having to type the whole thing every time.

EDIT 2:
I added the configuration option. It will be available in the next version of TAJ or if you don't want to wait you can just use this version I built
I did not know that "dm" was a thing, but I'm using an IDE anyway so it auto-completes sendDebugMessage for me.

I tried the version you posted, but now my chat text is invisible! This is with or without the new option checked.
I checked the Appearance tab and the chat should be black, but nothing is showing.

Edit:
Also, why is your .jar almost 48MB while the one I got from goddragon is around 1MB.
Sorry about that. I did my testing and then pulled GodDragon's changes but apparently he didn't have it in a working state. I got it back working and exported it in a different way this time so the file size is smaller (it was big last time because normally i package all the dependencies into the jar when building locally). The same link should work now.
Triple Alfa
Explorer At Heart
Explorer At Heart
Posts: 175
Joined: Wed Dec 05, 2007 12:35 pm

Re: [Tease Program] Tease-AI Java (1.2.2)

Post by Triple Alfa »

ski23 wrote: Thu May 14, 2020 6:52 pm Sorry about that. I did my testing and then pulled GodDragon's changes but apparently he didn't have it in a working state. I got it back working and exported it in a different way this time so the file size is smaller (it was big last time because normally i package all the dependencies into the jar when building locally). The same link should work now.
I tried the new version, but now TAJ is stuck on "Loading picture sets" on startup.
ski23
Explorer At Heart
Explorer At Heart
Posts: 466
Joined: Sun Jun 11, 2017 12:53 am
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): Courtney
Sub/Slave(s): Courtney
Location: Virginia
Contact:

Re: [Tease Program] Tease-AI Java (1.2.2)

Post by ski23 »

Triple Alfa wrote: Thu May 14, 2020 7:12 pm
ski23 wrote: Thu May 14, 2020 6:52 pm Sorry about that. I did my testing and then pulled GodDragon's changes but apparently he didn't have it in a working state. I got it back working and exported it in a different way this time so the file size is smaller (it was big last time because normally i package all the dependencies into the jar when building locally). The same link should work now.
I tried the new version, but now TAJ is stuck on "Loading picture sets" on startup.
Sorry. Try once more and it should work.
Triple Alfa
Explorer At Heart
Explorer At Heart
Posts: 175
Joined: Wed Dec 05, 2007 12:35 pm

Re: [Tease Program] Tease-AI Java (1.2.2)

Post by Triple Alfa »

Sorry. Try once more and it should work.
Ok it runs now and the text is visible, but the chat text does not respect my selected font size. The name of the sender does, but not the actual text written.

Also, one quick question: Is there a function to get the currently displayed image?
I need to compare the current image to the one my function randomly selects to be displayed and make sure it's not the same image.

Edit:
Note I've found getCurrentImageURL(), but that doesn't seem to work for local images.
ski23
Explorer At Heart
Explorer At Heart
Posts: 466
Joined: Sun Jun 11, 2017 12:53 am
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Switch
Dom/me(s): Courtney
Sub/Slave(s): Courtney
Location: Virginia
Contact:

Re: [Tease Program] Tease-AI Java (1.2.2)

Post by ski23 »

Triple Alfa wrote: Thu May 14, 2020 8:02 pm
Sorry. Try once more and it should work.
Ok it runs now and the text is visible, but the chat text does not respect my selected font size. The name of the sender does, but not the actual text written.

Also, one quick question: Is there a function to get the currently displayed image?
I need to compare the current image to the one my function randomly selects to be displayed and make sure it's not the same image.

Edit:
Note I've found getCurrentImageURL(), but that doesn't seem to work for local images.
Try now, also, there wasnt a function to get the current image if it is local built in. However, I just added it so that if the current image is a local image, the getCurrentImageUrl() method will return the path so that method should work for you now.
By the way, out of curiosity, what are you working on?
Post Reply