PDA

View Full Version : Filebrowser for a Client-RC


godofwarares
12-11-2006, 10:42 PM
Does anyone know how to load the filebrowser for a Client-RC?
I know its a requesttext() operation, but I don't know what to request :(

I've tried requesttext("folders", player.account); but that doesn't work ;(

godofwarares
12-13-2006, 01:09 AM
Ignored as usual :cry:

Skyld
12-13-2006, 01:17 AM
When clientside, does this produce any result in your F2 window?
//#CLIENTSIDE

function onCreated()
{
requesttext("clientrc", 1);
}

function onReceiveText(texttype, textoption, textlines)
{
switch (temp.texttype)
{
case "clientrc":
{
if (temp.textoption == 1)
{
requesttext("folders", "");
}

break;
}

case "folders":
{
echo(format("%s %s %s", temp.texttype, temp.textoptions, temp.textlines));

break;
}
}
}
I do not remember if the filebrowser is returning a giant array or if it sends data in parts, I guess you will find out by trying that.

godofwarares
12-13-2006, 01:26 AM
That produced


folders heads/,images/,levels/,levels/bodies/,levels/ganis/,levels/guilds/,levels/heads/,levels/images/,levels/shields/,levels/swords/,logs/,npcs/,scripts/,shields/,temp/,weapons/


x.x

Skyld
12-13-2006, 01:27 AM
Then I assume that your folderlist is being returned in temp.textoptions in that case. You should try sending a folder as requesttext()'s second parameter to see if you get a file listing in the same way. Then you can use the information to build your filemanager.

godofwarares
12-13-2006, 01:36 AM
And I just break down the array (Perferably using a for loop) and put it into a list / menu or whatever?

Skyld
12-13-2006, 10:15 AM
Yep, something like a GuiTreeViewCtrl for the folder tree and a GuiTextListCtrl for a file list.

godofwarares
12-13-2006, 01:41 PM
Nice. This is what I have:

http://img.photobucket.com/albums/v240/spymaster20/FileBrowser.png

:D

Now I need to figure out how to download files with it :x

godofwarares
12-13-2006, 07:58 PM
Does anyone know how to make it download a file?

Isn't it a sendText() thing or something?

Inverness
12-17-2006, 10:01 PM
This is an offhand comment but thats is a nice window theme you got there. Would you mind if I used it on Aeon?

Chompy
12-17-2006, 10:13 PM
This is an offhand comment but thats is a nice window theme you got there. Would you mind if I used it on Aeon?

Its quite 'dark & black', but it looks nice



godofwarares, any new updates on the file browser?

godofwarares
12-17-2006, 11:34 PM
Yep! :D

Check this out:

http://img.photobucket.com/albums/v240/spymaster20/FileBrowser2.png

:D

Still havn't figured out how to download files yet x_x

Someone help me >_<

Skyld
12-17-2006, 11:40 PM
I think the command you are looking for is selectfilefordownload(str filter), which will prompt the user for a location to save the file passed as the parameter (from the server).

godofwarares
12-17-2006, 11:40 PM
This is an offhand comment but thats is a nice window theme you got there. Would you mind if I used it on Aeon?

Sure if you want, I'll give you it later :o

godofwarares
12-17-2006, 11:43 PM
I think the command you are looking for is selectfilefordownload(str filter), which will prompt the user for a location to save the file passed as the parameter (from the server).

o_o

I didn't know you could do requesttext("folder","C:\"); o_O

Cool it works ^^

...somewhat x)

Skyld
12-17-2006, 11:45 PM
o_o

I didn't know you could do requesttext("folder","C:\"); o_O
You can't. requesttext() gets things from the server.

godofwarares
12-18-2006, 12:08 AM
Now another 2 questions:

1.) How do I get the contents of said file and put it in a GUI Text Ctrl?

2.) What is the command to delete folders?

:)

I'm making this as functional as possible :o

godofwarares
12-18-2006, 12:10 AM
You can't. requesttext() gets things from the server.

Aw :(

I should really study all this crap. I never used reqeustText() before I made my Client-RC x_x

godofwarares
12-18-2006, 12:15 AM
Now another 2 questions:

1.) How do I get the contents of said file and put it in a GUI Text Ctrl?

2.) What is the command to delete folders?

:)

I'm making this as functional as possible :o

Got #2: requestfiledeletion(str);

Skyld
12-18-2006, 12:22 AM
I guess you will need to use var.loadlines("path"); for getting the contents of the file either before downloading it (and then triggeractioning it), or after downloading it to your computer and saving it in scriptfiles or so.

Also please use the http://forums.graalonline.com/forums/images/buttons/edit.gif button to edit your posts while it is available instead of double-posting.

godofwarares
12-18-2006, 12:30 AM
Thanks ^^

Btw sorry :( I'll stop double-posting.

--------------------------------------
Edit:

By the way, can anyone post an example
of how to load a file's contents and
display them in F2 window or in a GUI
ML Text Ctrl?

--------------------------------------

godofwarares
12-28-2006, 03:55 PM
Eh cmon!

I need to know how to get a file's contents and display them :(

(I have to have it Client-Side however x.x)

xXziroXx
12-28-2006, 09:38 PM
Eh cmon!

I need to know how to get a file's contents and display them :(

(I have to have it Client-Side however x.x)


this.var.loadlines(path/to/file/filename);

godofwarares
12-29-2006, 12:58 AM
this.var.loadlines(path/to/file/filename);

I do hope thats Client-side.

Skyld
12-29-2006, 01:00 AM
I do hope thats Client-side.
Serverside it will load a file from the server.
Clientside it will load a file from inside the scriptfiles/ folder in your Graal folder.

godofwarares
12-29-2006, 01:06 AM
Serverside it will load a file from the server.
Clientside it will load a file from inside the scriptfiles/ folder in your Graal folder.

Aw man. Now I gotta go through all that serverside crap :(