de en es fr
Let the machine help
Light teasing, exhibition, BDSM, sissyfication, watersports... with sounds and pictures


Post new topic Reply to topic  [ 11 posts ] 
Author Message
 "getFile(String message)"
PostPosted: Sat Nov 26, 2011 10:51 pm 
Offline
Active member
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! :)


Top
 Profile Send private message 
 
 Re: "getFile(String message)"
PostPosted: Sun Nov 27, 2011 12:17 am 
Offline
Regular
User avatar
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


Top
 Profile Send private message 
 
 Re: "getFile(String message)"
PostPosted: Sun Nov 27, 2011 5:10 am 
Offline
Active member
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 :)


Top
 Profile Send private message 
 
 Re: "getFile(String message)"
PostPosted: Mon Nov 28, 2011 11:32 am 
Offline
Active member
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;


Top
 Profile Send private message 
 
 Re: "getFile(String message)"
PostPosted: Mon Nov 28, 2011 12:27 pm 
Offline
Active member
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!


Top
 Profile Send private message 
 
 Re: "getFile(String message)"
PostPosted: Wed Feb 15, 2012 5:11 pm 
Offline
Active member
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! :) Thank you!


Top
 Profile Send private message 
 
 Re: "getFile(String message)"
PostPosted: Wed Feb 15, 2012 8:56 pm 
Offline
Site Admin
User avatar
You hit a bug, sorry about that.
A uploaded a corrected archive.


Top
 Profile Send private message 
 
 Re: "getFile(String message)"
PostPosted: Thu Feb 16, 2012 11:43 am 
Offline
Active member
Ah fantastic! No need to apologise at all! :)

Thank you for the quick response.


Top
 Profile Send private message 
 
 Re: "getFile(String message)"
PostPosted: Sun Apr 07, 2013 1:06 pm 
Offline
Active member
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.


Top
 Profile Send private message 
 
 Re: "getFile(String message)"
PostPosted: Sun Apr 07, 2013 2:19 pm 
Offline
Site Admin
User avatar
Probably you'll find a good answer in this other thread.


Top
 Profile Send private message 
 
 Re: "getFile(String message)"
PostPosted: Mon Apr 08, 2013 10:19 pm 
Offline
Active member
doti wrote:
Probably you'll find a good answer in this other thread.


Great thnx. I got it now :)


Top
 Profile Send private message 
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Maroon Fusion theme created by Oxydo
Software, theme modifications, phpBB modification by Doti 2010 - 2020
This website uses session cookies only.