| SexScripts : "getFile(String message)" - https://ss.deviatenow.com:443/viewtopic.php?f=4&t=204 | Page 1 of 1 |
"getFile(String message)" |
seetan101 [ Sat Nov 26, 2011 10:51 pm ] |
|---|---|
Hiya guys! First off I'm a total newb, so forgive me please! I'm trying to mess about with this command, "getFile", to try and get the user to find a picture online, have it saved by SexScripts and be able to call it up later in the script. I've managed to integrate the "getFile" part and I think it's okay, but now, how do I call get SexScripts to call that image out again? Is there any way I can specify what the file should be saved as? I read in the excellent Scripting Main Documentation post (viewtopic.php?f=4&t=2#p3) that the getFile command creates a full name and path, but how do I access that? Thank you for any help, and apologies if it's staring me in the face! |
|
Re: "getFile(String message)" |
Sparrow [ Sun Nov 27, 2011 12:17 am ] |
|---|---|
I'm not too sure what you mean with finding an image on the internet. But as far as I know, getFile() is only used to return the full pathname of a file you select in the popup window as a String. For instance, you can use the following: String c = getFile("test") This will save the full pathname of the file you selected in the variable "c" Afterwards you can use this string c for other things, like: useFile(c) --> this will perform the default action for a file, opening a text file in notepad, a movie in whatever media player you use, ... setImage(c) --> If the file is an image, you can use this to set the image as current image in the ss main window ... Hope that explains something, if it doesn't, try to explain what you mean with getting an image from the internet, perhaps I'll be able to answer better then. S |
|
Re: "getFile(String message)" |
seetan101 [ Sun Nov 27, 2011 5:10 am ] |
|---|---|
Okay! i think I've got that!! Thank you so much for helping! With the internet thing, I just meant that as an example of what I was trying to do, sorry for confusing matters. But that's really useful, thank you |
|
Re: "getFile(String message)" |
wololo [ Mon Nov 28, 2011 11:32 am ] |
|---|---|
If you want the slave to retrieve a file from internet, you should ask him to save first in his computer for later being able to get it into your script with getFile(msg) like it was answered above. And you have to be sure that the pic the slave sends is in a proper format for sexscripts (jpg png gif) or it will not be shown. I'm sorry if it's not here the propper place to comment that, but I already tried to get an image file from the user, and I think if your script is thought to be run several times it's better to save in its image folder a copy of the image file, so if the user removes the original file he passed to the script and runs afterwards the script, it will be able to show the image. I tried to copy the file with the copy methods from AntBuilder, but it didn't seem to work. So I implemented a copy function to copy an image file pretended to be shown afterwards. I put here the code within an example for the case someone's find it useful. Code: setInfos(3, "AssPic", "Test Script to show how to get a pic from slave", "wololo", "complete", -52, "en", ["test"]);
// getImage(msg) definition def getImage = { msg -> def imgPath = getFile(msg); // Change here myScriptImageFolder to your script Image folder relative to the "images/" folder def pic = "myScriptImageFolder/"+(new File(imgPath)).getName(); def inStream = new FileInputStream(imgPath); def outStream = new FileOutputStream("images/"+pic, false); outStream.getChannel().transferFrom(inStream.getChannel(), 0, (new File(imgPath)).length()); inStream.close(); outStream.close(); return pic; } // Script body setImage("default-female.jpg"); show("Send me a photo of your ass"); showButton("Ok mistress"); def assPic = getImage("Send me your ass"); show("I got it."); wait(4); setImage(assPic); show("this is your ass"); wait(5); setImage("default-female.jpg"); show("I hope you liked it"); showButton("yes mistress"); setImage(null); show(""); return null; |
|
Re: "getFile(String message)" |
seetan101 [ Mon Nov 28, 2011 12:27 pm ] |
|---|---|
That's great! Thank you for that sample. I ended up with almost exactly that progression of code so it's great to know. Thank you for putting that together. Also I like your idea for saving the image to be possibly called upon at a later date. It opens up many possibilities! |
|
Re: "getFile(String message)" |
seetan101 [ Wed Feb 15, 2012 5:11 pm ] |
|---|---|
Hi guys, sorry to resurrect this thread, but I was having a few issues with the getFile command :S I've been using this: String Ex= getFile("Show Me, bitch.") wait(5) setImage(Ex) wait(10) ...and previously it had been working absolutely fine! It allowed me to choose an image previously saved on my machine and re-call it in the dialogue. However, having come back to this, whenever I pick an image, no matter where it is saved it now cannot find the image. I've tried to re-phrase this: String Ex= getFile("Show Me, bitch.") in a few different ways but to no avail. I wonder if something in one of the updates has negated this somehow?! Any help is seriously appreciated! |
|
Re: "getFile(String message)" |
doti [ Wed Feb 15, 2012 8:56 pm ] |
|---|---|
You hit a bug, sorry about that. A uploaded a corrected archive. |
|
Re: "getFile(String message)" |
seetan101 [ Thu Feb 16, 2012 11:43 am ] |
|---|---|
Ah fantastic! No need to apologise at all! Thank you for the quick response. |
|
Re: "getFile(String message)" |
humbleswede [ Sun Apr 07, 2013 1:06 pm ] |
|---|---|
Great. This works fine. But I want to decide under what filename the picture should be saved? (So I can load it from another script) Please advice. |
|
Re: "getFile(String message)" |
doti [ Sun Apr 07, 2013 2:19 pm ] |
|---|---|
Probably you'll find a good answer in this other thread. |
|
Re: "getFile(String message)" |
humbleswede [ Mon Apr 08, 2013 10:19 pm ] |
|---|---|
doti wrote: Probably you'll find a good answer in this other thread. Great thnx. I got it now |
|
| Page 1 of 1 | All times are UTC + 1 hour [ DST ] |