GodDragon wrote: ↑Mon Jan 25, 2021 7:07 pm
FrozenWolf wrote: ↑Mon Jan 25, 2021 5:34 pm
Good stuff. I think when looking back at it, the only thing that might be different is that the new onCall() methods take Integers as duration values whereas you tweaked the original version to accept Numbers to cope with fractional values. I was doing a cross-comparison at the the time with the sendMessage implementation that only deals with Integers as duration values and probably got my wires crossed. Do you think that all of the API functions that accept durations should handle fractions (even if they're rounded to the nearest integer)? The actual media functions could even use the Duration type for stronger internal consistency.
I made it accept fractional values since for some reason the behaviour of Nashorn seemed to change from Java Version to Java Version. Beforehand I provided the JavaScript call with a 1 and it would yield a 1 as an integer, but in a higher Java Version it ended up being translated to a double in java and thus broke it. Additionally there might be cases where in JavaScript these Integers are calculated using float precision and then casting it just to get it to be a valid parameter seems to much for me. I think it should indeed accept fractional values just for the case of safety. I couldn't guarantee Spicy wouldn't break without the support for it.
Ah, I'd heard about that somewhere, that makes sense now.
I've made some changes to the CustomFunctionExtended that now supports more intelligent matching and I've been running with it for over a week now without any issues. For example, the implementation of sendMessage() has the following handlers:
Code: Select all
void onCall(String message);
void onCall(String message, Number durationSeconds);
void onCall(String message, String imagePath);
void onCall(String message, Number durationSeconds, Boolean showTyping);
which will match against calls to:
Code: Select all
sendMessage("foo");
sendMessage("foo", 1);
sendMessage("foo", 1.5);
sendMessage("foo", "bar");
sendMessage("foo", 1, true);
sendMessage("foo", 1.5, false);
GodDragon wrote: ↑Mon Jan 25, 2021 7:07 pm
FrozenWolf wrote: ↑Mon Jan 25, 2021 5:34 pm
I did have a go at modifying the original, and my poor brain couldn't handle it
. Luckily I've got enough spare time at the moment to be able to tackle bits like this.
Are any other parts of TAJ that you'd like me to look at? I could look into the other API implementations and convert those to use reflection too; it might weed out other some other bugs. Other than that I'll just see if I can find potential issues.
Well, yes indeed reworking the other API calls might be worth a shot.
Great, I've been working through a bunch of the more complex ones. As part of testing them, I found quite a few issues with the audio and video playback, although most of the issues are associated with specifying media with unknown codecs, or missing media. The API part works fine though
. I've broken up the MediaHandler code to better manage the MediaPlayer objects that seem to be a bit of a wild beast at times. It's still a bit experimental but so far it seems to be very robust, and I no longer experience the error of being unable to create a MediaPlayer that used to happen to me about half-way through every session.
The current API for playVideo and playAudio returns the MediaPlayer object. I couldn't find anywhere where that return value was used, and I think it would be better to return null and encapsulate the MediaPlayer behind the API because of the need to carefully manage it. Do you have any thoughts on that?
The current pull request for the API,
https://github.com/GodDragoner/TeaseAIJava/pull/24 is still valid and doesn't include any of the experimental MediaHandler API changes.
GodDragon wrote: ↑Mon Jan 25, 2021 7:07 pm
Apart from that the statistic system was made by ski (I don't use it aynway, dunno if any personality would use it rather than use a custom one, but since I never used it it could need a major rework, because from what I've seen the code isn't optimal in my eyes.
Same goes for the Personality Settings, although I think that one looks better and I've made a few minor changes to fix some things back then.
The Lazy Sub Interface could be prettier and alllow for more and custom options possibly.
The Image ripping from reddit (using a library) was implemented by ski too, so no idea how that one compares.
I mean design wise TAJ could be a bit prettier or allow the theme to change more than that if you want to dig into that.
Estim integration was also made by ski, I can't really test it anyway, since I am lacking such a device for now.
That's a great list, thanks. I've tried to track roughly what I'm doing through a wiki page:
https://github.com/FrozenWolf4887/Tease ... activities
I can change the order around to see what would suit us best; feel free to make requests!