GodDragon wrote: Sun Jun 03, 2018 9:04 pm
ski23 wrote: Sat Jun 02, 2018 10:55 pm
Code: Select all
var z = getImagePath();
z = "" + z;
var x = z.split("\\");
var fileName = x[x.length - 1];
moveFile("C:\\Users\\tyler\\Desktop\\test\\teaseaijava2\\" + getImagePath(), "C:\\Users\\tyler\\Desktop\\test\\teaseaijava2\\images\\liked\\" + fileName);
function moveFile(path, newPath)
{
var myFile = new java.io.File(path);
myFile.renameTo(new java.io.File(newPath));
myFile.delete();
}
Also, I found a bug. With responses, the response doesnt get called every time. Sometimes it fails to get called and just continues on with whatever is happening. I'm not yet sure how to replicate or if this can be replicated. I know one thing though. One time I run the program with a string im entering and i never enter the response code. Then, I run the program again and I do get in the response code with the EXACT same string
This works:
Code: Select all
var TeaseAI = Java.type("me.goddragon.teaseai.TeaseAI");
var file = new java.io.File(TeaseAI.class.getProtectionDomain().getCodeSource().getLocation().toURI());
//The path to the main directory
sendMessage(file.getParent());
Maybe you should copy it to the personality folder though:
Code: Select all
var TeaseAI = Java.type("me.goddragon.teaseai.TeaseAI");
var file = TeaseAI.application.getSession().getActivePersonality().getFolder();
//The path to your personality directory
sendMessage(file.getAbsolutePath());
And you probably shouldn't call myFile.delete() because renameTo should already delete the old file. And maybe don't rename but copy it, because the original image file is used for caching so that it doesn't need to be downloaded again.
Copy it like so:
Code: Select all
java.nio.file.Files.copy(file1.toPath(), file2.toPath());
I will look into your response issue. Can you send me the response code or even update your repository and just send me the link to the corresponding response there?
The reason I'm deleting the files and moving them is because i want them grouped in different folders. Eventually, I will remove the url from the url file as well when I do this so it wont ever try to redownload the same image. As far as the copy thing, renameto doesnt actually remove the original file. Also, here is a repository link to the personality im working on. Keep in mind that it is still in progress. To replicate the issue, type "picturesmode" try typing it with paramters too. For example, valid parameters would be "picturesmode (2|3|4|liked|normal|loved)." Sometimes the response triggers immediately, sometimes it triggers but takes a few seconds and, other times it does not trigger at all.
Here is the repository:
https://github.com/skier233/Mischevious
Here is a sample log demonstrating the error:
Code: Select all
06:18:57 PM CHAT: 06:18 PM Tyler: Picturesmode 3
06:19:03 PM CHAT: 06:19 PM Tyler: Picturesmode 3
06:19:07 PM CHAT: 06:19 PM Tyler: Picturesmode 2
06:19:16 PM CHAT: 06:19 PM Tyler: Picturesmode 4
06:19:20 PM CHAT: 06:19 PM Tyler: Picturesmode liked
06:19:25 PM CHAT: 06:19 PM Tyler: Picturesmode loved
06:19:28 PM CHAT: 06:19 PM Tyler: Picturesmode
06:19:28 PM CHAT: 06:19 PM Madison: Picturesmode
06:19:29 PM CHAT: 06:19 PM Madison: Path: images\normal\tumblr_o2j4oxInGF1v2pop5o1_1280.jpg
06:19:29 PM CHAT: 06:19 PM Madison: Do you like this one? (Options: hate, ok, like, love (1,2,3,4))
06:19:36 PM CHAT: 06:19 PM Tyler: 5
06:19:36 PM CHAT: 06:19 PM Madison: Picturesmode
06:19:37 PM CHAT: 06:19 PM Madison: Path: images\normal\tumblr_oyr01mO8Qc1w3tw51o1_400.gif
06:19:37 PM CHAT: 06:19 PM Madison: Do you like this one? (Options: hate, ok, like, love (1,2,3,4))
06:19:41 PM CHAT: 06:19 PM Tyler: 5
06:19:44 PM CHAT: 06:19 PM Tyler: Picturesmode 3
06:19:50 PM CHAT: 06:19 PM Tyler: Picturesmode liked
06:19:54 PM CHAT: 06:19 PM Tyler: Picturesmode loved
06:19:56 PM CHAT: 06:19 PM Madison: Picturesmode loved
06:19:58 PM CHAT: 06:19 PM Madison: Path: images\loved\tumblr_onnbdgyxWu1v3uyquo2_r1_1280.jpg
06:19:58 PM CHAT: 06:19 PM Madison: Do you like this one? (Options: hate, ok, like, love (1,2,3,4))
When the domme says "Picturesmode", that is when I successfully got into the response.