[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

ski23
Explorer At Heart
Explorer At Heart
Posts: 464
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: Mon May 18, 2020 7:47 am
ski23 wrote: Sun May 17, 2020 2:18 pm I can try to improve the logic but you dont need </b>. You can just use <> to end the formatting or start a new format and it will end the previous one.

EDIT: Here is an updated version where your logic should work as intended as well:
https://www.mediafire.com/file/wfro4ydd ... I.jar/file
Thank you, I did a quick test and it seems to work.
Since I already had a bunch of text with the old logic working it'll save me time going over all the old code.
I understand why you might want to simplify code like this, but since there is a working public version out there you need to be careful with those kinds of changes.
Yea technically I didn’t make any changes. The way I mentioned is how it worked originally and the functionality you described GodDragon added in the recent update. However that was also the functionality that was breaking several pieces. Regardless it should all work now.
GodDragon
Explorer At Heart
Explorer At Heart
Posts: 790
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 »

ski23 wrote: Mon May 18, 2020 12:37 pm
Triple Alfa wrote: Mon May 18, 2020 7:47 am
ski23 wrote: Sun May 17, 2020 2:18 pm I can try to improve the logic but you dont need </b>. You can just use <> to end the formatting or start a new format and it will end the previous one.

EDIT: Here is an updated version where your logic should work as intended as well:
https://www.mediafire.com/file/wfro4ydd ... I.jar/file
Thank you, I did a quick test and it seems to work.
Since I already had a bunch of text with the old logic working it'll save me time going over all the old code.
I understand why you might want to simplify code like this, but since there is a working public version out there you need to be careful with those kinds of changes.
Yea technically I didn’t make any changes. The way I mentioned is how it worked originally and the functionality you described GodDragon added in the recent update. However that was also the functionality that was breaking several pieces. Regardless it should all work now.
It was working however I didn't push the latest changes. We are gonna go back to what I created if ski can verify it is working on his end too.
Manolas Smith wrote: Tue May 12, 2020 3:12 pm 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!
I haven't had any of those issues yet. can you show some extracts from your log file to us please?
GodDragon
Explorer At Heart
Explorer At Heart
Posts: 790
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 »

Some news on the Text To Speech end:
We don't want to port the original TTS from TAI but I have found a way to use google translate which sounds pretty similar to the original TTS (also supports different accents). Since that voice is still very robotic I have digged deeper and after looking into payed services such as google duplex, amazon polly and other futuristic TTS services I have found a way to generate realistic voices using an open source library with no additional cost money wise.
It will take some time and hardware power, like 5 seconds to render a sentence in my case however we could hide that behind the typing speed.
Here are some examples:
https://mega.nz/folder/PzYQla7B#vC2bkTbvUEN4E1OWNVfBMQ
Imo they sound great and it would actually convince me to use TTS myself. However the installation for that will obviously be voluntary because it is quite troublesome. I will try to create a good tutorial and setup which should work for most people. But it's not gonna be quick and easy as downloading 2 things and being done. So what do you think? Do you think those recordings sound good? Would you actually use it even if it was like 20-30 minutes of work to set it up? In the best case it might be done within like 5-10 minutes but I cannot gurantee for it sadly.
swirly
Curious Newbie
Curious Newbie
Posts: 2
Joined: Fri May 22, 2020 10:43 pm
Gender: Male
Sexual Orientation: Straight

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

Post by swirly »

Hey folks,

I'm a developer, and I've been playing around with TAIJ for a little bit. I've come across a couple of bugs, and was wondering if you guys had somewhere you've been tracking issues? I checked the github for the project, but there didn't seem to be anything there.

I'm using TeaseAI Java v1.2.2 with Mischevious v1.2.0

One issue I've noticed is that the metronome doesn't seem to work when using the Mischevious personality, until you get to the code in End_1.js. It will suddenly kick in once you get there and startStroking is called with the value 220. I thought that it was a bug in the JS code for that personality where the BPM wasn't getting floored properly when calling startStroking, but I patched it locally and it didn't fix the issue. Here's the relevant chunk of the log:

Code: Select all

07:56:13 PM CHAT: Info: Starting session
07:56:14 PM CHAT: Info: IWasJustThinkingAboutYou: Beginning
07:56:18 PM CHAT: 07:56 PM Leah: I was just thinking about you swirly
07:56:31 PM CHAT: 07:56 PM Leah: Your pecker must have sensed I'm feeling a little wicked this afternoon
07:56:43 PM CHAT: 07:56 PM Leah: In fact, I'm feeling so wicked
07:56:55 PM CHAT: 07:56 PM Leah: That the only thing that's going to satisfy me is making you suffer *smiles innocently*
07:57:09 PM CHAT: 07:57 PM Leah: So why don't you wrap your hand around that poor leaky cock
07:57:14 PM CHAT: Info: calculated speed 146.5174128749531
07:57:15 PM CHAT: Info: calculated duration 209.82958720680003
07:57:25 PM CHAT: 07:57 PM Leah: Hold down the skin of your frustrated dick and stroke the tip with the other hand with lube
07:57:25 PM SEVERE: startStroking called with invalid args:[146.0]
07:57:34 PM CHAT: Info: ShowTeaseImage: Beginning
07:57:34 PM CHAT: Info: GetTeasePicture: Beginning
07:57:34 PM CHAT: Info: GetTeasePicture: Debug 2
07:57:35 PM CHAT: Info: GetTeasePicture: End
07:57:35 PM CHAT: Info: ShowTeaseImage: End
07:57:37 PM CHAT: 07:57 PM Leah: Don't mind me xD 
I traced it back to where the logging call is made, and it's being logged at

Code: Select all

teaseai/api/scripts/nashorn/StartStrokingFunction.java:43
. That makes me think that there's a problem with the way that data is being passed from the personality code to the main program, but that only makes sense if I'm not the only one getting this problem ;)

Anyway, is there any issue tracking set up for this kind of thing?

-- swirly
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 »

I'm getting a TypeError and I don't understand why:
Log snippet:

Code: Select all

11:35:36 am SEVERE: Latest loaded file was 'D:\Temp ICO\Teases\Tease AI Java\TeaseAI Java 1.2.2\Personalities\Amelie\Modules\Special\FirstSessionTeasing.js' and error was found in line 36
Error: TypeError: allActiveTeaseCategories.includes is not a function in <eval> at line number 36
javax.script.ScriptException: TypeError: allActiveTeaseCategories.includes is not a function in <eval> at line number 36
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:477)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:461)
	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$16$\^eval\_.:program(<eval>:23)
	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$7$\^eval\_.:scopeCall(<eval>)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$7$\^eval\_.:program(<eval>:13)
	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:43)
Caused by: <eval>:36 TypeError: allActiveTeaseCategories.includes is not a function
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:213)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:185)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:172)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.Undefined.lookup(Undefined.java:100)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker.NashornLinker.getGuardedInvocation(NashornLinker.java:106)
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker.NashornLinker.getGuardedInvocation(NashornLinker.java:96)
	at jdk.dynalink/jdk.dynalink.linker.support.CompositeTypeBasedGuardingDynamicLinker.getGuardedInvocation(CompositeTypeBasedGuardingDynamicLinker.java:161)
	at jdk.dynalink/jdk.dynalink.linker.support.CompositeGuardingDynamicLinker.getGuardedInvocation(CompositeGuardingDynamicLinker.java:109)
	at jdk.dynalink/jdk.dynalink.LinkerServicesImpl.lambda$getGuardedInvocation$0(LinkerServicesImpl.java:137)
	at jdk.dynalink/jdk.dynalink.LinkerServicesImpl.getWithLookupInternal(LinkerServicesImpl.java:168)
	at jdk.dynalink/jdk.dynalink.LinkerServicesImpl.getGuardedInvocation(LinkerServicesImpl.java:135)
	at jdk.dynalink/jdk.dynalink.DynamicLinker.relink(DynamicLinker.java:242)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$34$1231A$\^eval\_.isActiveTeaseCategory(<eval>:36)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$Recompilation$33$1337A$\^eval\_.randomActiveTeaseCategory(<eval>:43)
	at jdk.scripting.nashorn.scripts/jdk.nashorn.internal.scripts.Script$24$\^eval\_.:program(<eval>:469)
	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)
	... 35 more
This is referring to:

Code: Select all

function isActiveTeaseCategory(category) {
    return allActiveTeaseCategories.includes(category);
}
Which refers to an array created by:

Code: Select all

function collectAllActiveTeaseImages(){
    let allFolders = ["Anal", "Asses", "Assjobs", "Blowjobs", "Boobjobs", "Boobs", "CBT", "Feet", "Femdom", "Footjobs", "Fucking", "Futa", "Handjobs", "Other", "POV", "Ruined Orgasms", "Thighjobs", "Thighs", "Traps"];
    const allActiveTeaseCategories = [];

    let i = 0;
    let imageCat;
    let imageCatUS;
    let imageVar;
    for (i = 0; i < allFolders.length; i++){
        imageCat = allFolders[i];
        imageCatUS = imageCat.replace(/\s/g, "_");
        imageVar = "IMAGES_" + imageCatUS.toUpperCase();
        if (getVar(VARIABLE[imageVar])){
            allActiveTeaseCategories.push(imageCat);
        }
    }

    let activeFolderName;
    let activeFolder;
    let fileList = [];
    for (i = 0; i < allActiveTeaseCategories.length; i++){
        activeFolderName = allActiveTeaseCategories[i];
        activeFolder = getImageSubFolder(activeFolderName);
        fileList = TAJFileUtils.getMatchingFiles(activeFolder + "\\*.*");
        let x = 0;
        for (x = 0; x < fileList.length; x++){
            allActiveTeaseImages.push(fileList[x]);
        }
    }
}
The offending code is called by:

Code: Select all

function randomActiveTeaseCategory(categoryArray) {
    let activeCategories = [];
    let i;
    for (i = 0; i < categoryArray.length; i++){
        if(isActiveTeaseCategory(categoryArray[i])){
            activeCategories.push(categoryArray[i]);
        }
    }
    if (activeCategories.length > 0) {
        let rnd = randomInteger(0, activeCategories.length - 1);
        return activeCategories[rnd];
    }else{
        return null;
    }
}
Which in turn is called by:

Code: Select all

let categories = ["Asses", "Boobs", "Feet", "Thighs"];
let randomCategory = randomActiveTeaseCategory(categories);
swirly
Curious Newbie
Curious Newbie
Posts: 2
Joined: Fri May 22, 2020 10:43 pm
Gender: Male
Sexual Orientation: Straight

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

Post by swirly »

Triple Alfa wrote: Sat May 23, 2020 9:59 am I'm getting a TypeError and I don't understand why:
Log snippet:

Code: Select all

11:35:36 am SEVERE: Latest loaded file was 'D:\Temp ICO\Teases\Tease AI Java\TeaseAI Java 1.2.2\Personalities\Amelie\Modules\Special\FirstSessionTeasing.js' and error was found in line 36
Error: TypeError: allActiveTeaseCategories.includes is not a function in <eval> at line number 36
javax.script.ScriptException: TypeError: allActiveTeaseCategories.includes is not a function in <eval> at line number 36
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:477)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:461)
<snip>
	at me.goddragon.teaseai.api.scripts.ScriptHandler.startPersonality(ScriptHandler.java:125)
	at me.goddragon.teaseai.api.session.Session$1.run(Session.java:43)
Caused by: <eval>:36 TypeError: allActiveTeaseCategories.includes is not a function
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
<snip>
	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)
	... 35 more
This is referring to:

Code: Select all

function isActiveTeaseCategory(category) {
    return allActiveTeaseCategories.includes(category);
}
Which refers to an array created by:

Code: Select all

function collectAllActiveTeaseImages(){
    let allFolders = ["Anal", "Asses", "Assjobs", "Blowjobs", "Boobjobs", "Boobs", "CBT", "Feet", "Femdom", "Footjobs", "Fucking", "Futa", "Handjobs", "Other", "POV", "Ruined Orgasms", "Thighjobs", "Thighs", "Traps"];
    const allActiveTeaseCategories = [];

    let i = 0;
    let imageCat;
    let imageCatUS;
    let imageVar;
    for (i = 0; i < allFolders.length; i++){
        imageCat = allFolders[i];
        imageCatUS = imageCat.replace(/\s/g, "_");
        imageVar = "IMAGES_" + imageCatUS.toUpperCase();
        if (getVar(VARIABLE[imageVar])){
            allActiveTeaseCategories.push(imageCat);
        }
    }

    let activeFolderName;
    let activeFolder;
    let fileList = [];
    for (i = 0; i < allActiveTeaseCategories.length; i++){
        activeFolderName = allActiveTeaseCategories[i];
        activeFolder = getImageSubFolder(activeFolderName);
        fileList = TAJFileUtils.getMatchingFiles(activeFolder + "\\*.*");
        let x = 0;
        for (x = 0; x < fileList.length; x++){
            allActiveTeaseImages.push(fileList[x]);
        }
    }
}
The offending code is called by:

Code: Select all

function randomActiveTeaseCategory(categoryArray) {
    let activeCategories = [];
    let i;
    for (i = 0; i < categoryArray.length; i++){
        if(isActiveTeaseCategory(categoryArray[i])){
            activeCategories.push(categoryArray[i]);
        }
    }
    if (activeCategories.length > 0) {
        let rnd = randomInteger(0, activeCategories.length - 1);
        return activeCategories[rnd];
    }else{
        return null;
    }
}
<snip>
Just a disclaimer, I'm new to JS so I'm not super familiar with its scoping rules and nuances.

I noticed that you're declaring the allActiveTeaseCategories array as

Code: Select all

function collectAllActiveTeaseImages(){
    let allFolders = ["Anal", "Asses", "Assjobs", "Blowjobs", "Boobjobs", "Boobs", "CBT", "Feet", "Femdom", "Footjobs", "Fucking", "Futa", "Handjobs", "Other", "POV", "Ruined Orgasms", "Thighjobs", "Thighs", "Traps"];
    const allActiveTeaseCategories = [];
    ...
}
which has 2 potential issues. 1) allActiveTeaseCategories is defined within the scope of thefunction block of collectAllActiveTeaseImages, so may not be accessible from isActiveTeaseCategory(), and 2) is declared as a const array, but you're calling allActiveTeaseCategories.push(imageCat). I don't know if that's allowed, since I would think that pushing to an array would mutate it.

Can you try declaring the array with let, and/or either making it global or passing it as an argument to isActiveTeaseCategory?
GodDragon
Explorer At Heart
Explorer At Heart
Posts: 790
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 »

swirly wrote: Sat May 23, 2020 12:27 pm
Triple Alfa wrote: Sat May 23, 2020 9:59 am I'm getting a TypeError and I don't understand why:
Log snippet:

Code: Select all

11:35:36 am SEVERE: Latest loaded file was 'D:\Temp ICO\Teases\Tease AI Java\TeaseAI Java 1.2.2\Personalities\Amelie\Modules\Special\FirstSessionTeasing.js' and error was found in line 36
Error: TypeError: allActiveTeaseCategories.includes is not a function in <eval> at line number 36
javax.script.ScriptException: TypeError: allActiveTeaseCategories.includes is not a function in <eval> at line number 36
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:477)
	at jdk.scripting.nashorn/jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:461)
<snip>
	at me.goddragon.teaseai.api.scripts.ScriptHandler.startPersonality(ScriptHandler.java:125)
	at me.goddragon.teaseai.api.session.Session$1.run(Session.java:43)
Caused by: <eval>:36 TypeError: allActiveTeaseCategories.includes is not a function
	at jdk.scripting.nashorn/jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57)
<snip>
	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)
	... 35 more
This is referring to:

Code: Select all

function isActiveTeaseCategory(category) {
    return allActiveTeaseCategories.includes(category);
}
Which refers to an array created by:

Code: Select all

function collectAllActiveTeaseImages(){
    let allFolders = ["Anal", "Asses", "Assjobs", "Blowjobs", "Boobjobs", "Boobs", "CBT", "Feet", "Femdom", "Footjobs", "Fucking", "Futa", "Handjobs", "Other", "POV", "Ruined Orgasms", "Thighjobs", "Thighs", "Traps"];
    const allActiveTeaseCategories = [];

    let i = 0;
    let imageCat;
    let imageCatUS;
    let imageVar;
    for (i = 0; i < allFolders.length; i++){
        imageCat = allFolders[i];
        imageCatUS = imageCat.replace(/\s/g, "_");
        imageVar = "IMAGES_" + imageCatUS.toUpperCase();
        if (getVar(VARIABLE[imageVar])){
            allActiveTeaseCategories.push(imageCat);
        }
    }

    let activeFolderName;
    let activeFolder;
    let fileList = [];
    for (i = 0; i < allActiveTeaseCategories.length; i++){
        activeFolderName = allActiveTeaseCategories[i];
        activeFolder = getImageSubFolder(activeFolderName);
        fileList = TAJFileUtils.getMatchingFiles(activeFolder + "\\*.*");
        let x = 0;
        for (x = 0; x < fileList.length; x++){
            allActiveTeaseImages.push(fileList[x]);
        }
    }
}
The offending code is called by:

Code: Select all

function randomActiveTeaseCategory(categoryArray) {
    let activeCategories = [];
    let i;
    for (i = 0; i < categoryArray.length; i++){
        if(isActiveTeaseCategory(categoryArray[i])){
            activeCategories.push(categoryArray[i]);
        }
    }
    if (activeCategories.length > 0) {
        let rnd = randomInteger(0, activeCategories.length - 1);
        return activeCategories[rnd];
    }else{
        return null;
    }
}
<snip>
Just a disclaimer, I'm new to JS so I'm not super familiar with its scoping rules and nuances.

I noticed that you're declaring the allActiveTeaseCategories array as

Code: Select all

function collectAllActiveTeaseImages(){
    let allFolders = ["Anal", "Asses", "Assjobs", "Blowjobs", "Boobjobs", "Boobs", "CBT", "Feet", "Femdom", "Footjobs", "Fucking", "Futa", "Handjobs", "Other", "POV", "Ruined Orgasms", "Thighjobs", "Thighs", "Traps"];
    const allActiveTeaseCategories = [];
    ...
}
which has 2 potential issues. 1) allActiveTeaseCategories is defined within the scope of thefunction block of collectAllActiveTeaseImages, so may not be accessible from isActiveTeaseCategory(), and 2) is declared as a const array, but you're calling allActiveTeaseCategories.push(imageCat). I don't know if that's allowed, since I would think that pushing to an array would mutate it.

Can you try declaring the array with let, and/or either making it global or passing it as an argument to isActiveTeaseCategory?
Yes the scope is definitely the issue here. You can't define a variable inside a function and reuse it in another. You need to put it into the global scope. I think "var" or just not giving it specification will make it global but that is considered bad practice in newer versions. So just move the var outside of your function and change its value inside your function.

Since pushing does change the state of the object but does not reassign the value it is fine. Const is the same as final in other languages such as java.
GodDragon
Explorer At Heart
Explorer At Heart
Posts: 790
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 »

swirly wrote: Fri May 22, 2020 11:23 pm Hey folks,

I'm a developer, and I've been playing around with TAIJ for a little bit. I've come across a couple of bugs, and was wondering if you guys had somewhere you've been tracking issues? I checked the github for the project, but there didn't seem to be anything there.

I'm using TeaseAI Java v1.2.2 with Mischevious v1.2.0

One issue I've noticed is that the metronome doesn't seem to work when using the Mischevious personality, until you get to the code in End_1.js. It will suddenly kick in once you get there and startStroking is called with the value 220. I thought that it was a bug in the JS code for that personality where the BPM wasn't getting floored properly when calling startStroking, but I patched it locally and it didn't fix the issue. Here's the relevant chunk of the log:

Code: Select all

07:56:13 PM CHAT: Info: Starting session
07:56:14 PM CHAT: Info: IWasJustThinkingAboutYou: Beginning
07:56:18 PM CHAT: 07:56 PM Leah: I was just thinking about you swirly
07:56:31 PM CHAT: 07:56 PM Leah: Your pecker must have sensed I'm feeling a little wicked this afternoon
07:56:43 PM CHAT: 07:56 PM Leah: In fact, I'm feeling so wicked
07:56:55 PM CHAT: 07:56 PM Leah: That the only thing that's going to satisfy me is making you suffer *smiles innocently*
07:57:09 PM CHAT: 07:57 PM Leah: So why don't you wrap your hand around that poor leaky cock
07:57:14 PM CHAT: Info: calculated speed 146.5174128749531
07:57:15 PM CHAT: Info: calculated duration 209.82958720680003
07:57:25 PM CHAT: 07:57 PM Leah: Hold down the skin of your frustrated dick and stroke the tip with the other hand with lube
07:57:25 PM SEVERE: startStroking called with invalid args:[146.0]
07:57:34 PM CHAT: Info: ShowTeaseImage: Beginning
07:57:34 PM CHAT: Info: GetTeasePicture: Beginning
07:57:34 PM CHAT: Info: GetTeasePicture: Debug 2
07:57:35 PM CHAT: Info: GetTeasePicture: End
07:57:35 PM CHAT: Info: ShowTeaseImage: End
07:57:37 PM CHAT: 07:57 PM Leah: Don't mind me xD 
I traced it back to where the logging call is made, and it's being logged at

Code: Select all

teaseai/api/scripts/nashorn/StartStrokingFunction.java:43
. That makes me think that there's a problem with the way that data is being passed from the personality code to the main program, but that only makes sense if I'm not the only one getting this problem ;)

Anyway, is there any issue tracking set up for this kind of thing?

-- swirly
Yes this is an issue introduced by Java 14. I have a local build that is working fine. I think this one should work:
https://www.mediafire.com/file/wfro4ydd ... I.jar/file
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 23, 2020 2:46 pm Yes the scope is definitely the issue here. You can't define a variable inside a function and reuse it in another. You need to put it into the global scope. I think "var" or just not giving it specification will make it global but that is considered bad practice in newer versions. So just move the var outside of your function and change its value inside your function.

Since pushing does change the state of the object but does not reassign the value it is fine. Const is the same as final in other languages such as java.
The variable is first declared outside the function like this:

Code: Select all

const allActiveTeaseImages = [];
const allActiveTeaseCategories = [];

function collectAllActiveTeaseImages(){
    let allFolders = ["Anal", "Asses", "Assjobs", "Blowjobs", "Boobjobs", "Boobs", "CBT", "Feet", "Femdom", "Footjobs", "Fucking", "Futa", "Handjobs", "Other", "POV", "Ruined Orgasms", "Thighjobs", "Thighs", "Traps"];
    const allActiveTeaseCategories = [];

    let i = 0;
    let imageCat;
    let imageCatUS;
    let imageVar;
    for (i = 0; i < allFolders.length; i++){
        imageCat = allFolders[i];
        imageCatUS = imageCat.replace(/\s/g, "_");
        imageVar = "IMAGES_" + imageCatUS.toUpperCase();
        if (getVar(VARIABLE[imageVar])){
            allActiveTeaseCategories.push(imageCat);
        }
    }

    let activeFolderName;
    let activeFolder;
    let fileList = [];
    for (i = 0; i < allActiveTeaseCategories.length; i++){
        activeFolderName = allActiveTeaseCategories[i];
        activeFolder = getImageSubFolder(activeFolderName);
        fileList = TAJFileUtils.getMatchingFiles(activeFolder + "\\*.*");
        let x = 0;
        for (x = 0; x < fileList.length; x++){
            allActiveTeaseImages.push(fileList[x]);
        }
    }
}
Does that mean that the second "const allActiveTeaseCategories = [];" inside the function is limiting its scope to the function?
If that is the case I guess I should clear the array with "allActiveTeaseCategories.length = 0;" instead.

Edit:
So I changed "const allActiveTeaseCategories = [];" inside the function to "allActiveTeaseCategories.length = 0;" so the scope is now outside the function and the problem persists.
I'll just give you guys the entire ImageUtils.js:

Code: Select all

const allActiveTeaseImages = [];
const allActiveTeaseCategories = [];

function collectAllActiveTeaseImages(){
    let allFolders = ["Anal", "Asses", "Assjobs", "Blowjobs", "Boobjobs", "Boobs", "CBT", "Feet", "Femdom", "Footjobs", "Fucking", "Futa", "Handjobs", "Other", "POV", "Ruined Orgasms", "Thighjobs", "Thighs", "Traps"];
    //const allActiveTeaseCategories = []; //DEBUG
    allActiveTeaseCategories.length = 0;

    let i = 0;
    let imageCat;
    let imageCatUS;
    let imageVar;
    for (i = 0; i < allFolders.length; i++){
        imageCat = allFolders[i];
        imageCatUS = imageCat.replace(/\s/g, "_");
        imageVar = "IMAGES_" + imageCatUS.toUpperCase();
        if (getVar(VARIABLE[imageVar])){
            allActiveTeaseCategories.push(imageCat);
        }
    }

    let activeFolderName;
    let activeFolder;
    let fileList = [];
    for (i = 0; i < allActiveTeaseCategories.length; i++){
        activeFolderName = allActiveTeaseCategories[i];
        activeFolder = getImageSubFolder(activeFolderName);
        fileList = TAJFileUtils.getMatchingFiles(activeFolder + "\\*.*");
        let x = 0;
        for (x = 0; x < fileList.length; x++){
            allActiveTeaseImages.push(fileList[x]);
        }
    }
}

function isActiveTeaseCategory(category) {
    return allActiveTeaseCategories.includes(category);
}

function randomActiveTeaseCategory(categoryArray) {
    let activeCategories = [];
    let i;
    for (i = 0; i < categoryArray.length; i++){
        if(isActiveTeaseCategory(categoryArray[i])){
            activeCategories.push(categoryArray[i]);
        }
    }
    if (activeCategories.length > 0) {
        let rnd = randomInteger(0, activeCategories.length - 1);
        return activeCategories[rnd];
    }else{
        return null;
    }
}

function showRandomImage(numOfImgs, delay, category){
    if (numOfImgs === undefined || numOfImgs <= 0){ numOfImgs = 1; }
    if (delay === undefined || delay < 0){ delay = 0; }
    if (category === undefined){
        let i;
        let lastRnd = -2;
        for (i = 0; i < numOfImgs; i++){
            let rnd;
            let currentImage = getCurrentImageURL();
            do {
                do {
                    rnd = randomInteger(0, allActiveTeaseImages.length - 1);
                } while (rnd === lastRnd)
                showImage(allActiveTeaseImages[rnd]);
            }while(currentImage === getCurrentImageURL())
            lastRnd = rnd;
            if(getVar(VARIABLE.DEBUG_RAPID_TESTING) && delay > 2){
                sleep(2);
            }else {
                sleep(delay);
            }
        }
    }else {
        let i;
        let image;
        let lastImage = "";
        for (i = 0; i < numOfImgs; i++){
            let currentImage = getCurrentImageURL();
            do {
                image = showImage(getImageSubFolder(category) + separator + "*.*");
            }while (image.toString() === lastImage.toString() || currentImage === getCurrentImageURL())
            lastImage = image;
            if(getVar(VARIABLE.DEBUG_RAPID_TESTING) && delay > 2){
                sleep(2);
            }else {
                sleep(delay);
            }
        }
    }
}
Note that the showRandomImage() function works without issues.

Edit2:
Calling isActiveTeaseCategory() directly results in the same error.
Using "typeof" I determined that "allActiveTeaseCategories" is an object as it should be.

Edit3:
By adding "sendDebugMessage(allActiveTeaseCategories[0]); //DEBUG" right before "return allActiveTeaseCategories.includes(category);" I have also determined that "allActiveTeaseCategories" is a working array right before the error.
GodDragon
Explorer At Heart
Explorer At Heart
Posts: 790
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: Sat May 23, 2020 6:08 pm Does that mean that the second "const allActiveTeaseCategories = [];" inside the function is limiting its scope to the function?
If that is the case I guess I should clear the array with "allActiveTeaseCategories.length = 0;" instead.

Edit:
So I changed "const allActiveTeaseCategories = [];" inside the function to "allActiveTeaseCategories.length = 0;" so the scope is now outside the function and the problem persists.
I'll just give you guys the entire ImageUtils.js:
const allActiveTeaseImages = [];
const allActiveTeaseCategories = [];
Includes is currently not supported by the language standard java nashorn implements for JavaScript. You should use:
.indexOf(x) !== -1 which means your array contains the element. We have to switch to GraalVM anyway since Nashorn will be removed with Java 14 and then includes should work too since GraalVM supports the newest Javascript standards.
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 23, 2020 10:02 pm Includes is currently not supported by the language standard java nashorn implements for JavaScript. You should use:
.indexOf(x) !== -1 which means your array contains the element. We have to switch to GraalVM anyway since Nashorn will be removed with Java 14 and then includes should work too since GraalVM supports the newest Javascript standards.
Thank you. I swapped out the code and it's working now.
MarilynW
Curious Newbie
Curious Newbie
Posts: 4
Joined: Tue Sep 24, 2019 10:33 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Submissive

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

Post by MarilynW »

Is there a way to re-retrieve image links? I occasionally get nothing or errors.
ski23
Explorer At Heart
Explorer At Heart
Posts: 464
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 »

MarilynW wrote: Wed Jun 03, 2020 8:17 pm Is there a way to re-retrieve image links? I occasionally get nothing or errors.
Those errors are part of the tumblr api so there isnt really anything we can do about it. If you see issues from other sites than tumblr let us know.
MarilynW
Curious Newbie
Curious Newbie
Posts: 4
Joined: Tue Sep 24, 2019 10:33 pm
Gender: Male
Sexual Orientation: Bisexual/Bi-Curious
I am a: Submissive

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

Post by MarilynW »

It happens with reddit's. When pictures gets removed for reddit or imgur. Also, does it auto-update for new pictures?
GodDragon
Explorer At Heart
Explorer At Heart
Posts: 790
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 »

MarilynW wrote: Thu Jun 04, 2020 8:03 pm It happens with reddit's. When pictures gets removed for reddit or imgur. Also, does it auto-update for new pictures?
No it does not auto update. As far as I know there is no way to update them right now. You might try to readd the same url again without deleting the old one. But we should probably just add an update button.
Post Reply

Who is online

Users browsing this forum: Baidu [Spider], Rar1197 and 8 guests