Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-25-2006, 12:52 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Workarounds...

Okay so I was playing around with flash and felt a need to make a workaround to get flash files from the internet, well I got all the way up to the part where I just gotta save the file.. It should save but it doesn't.. Help please
PHP Code:
function onCreated() {
Flash("http://64.191.61.82/albino_games04/curveball(www.albinoblacksheep.com).swf");
}
function 
Flash(url) {
 
temp.req requesturl("http://mywebserver.com/google.php?url=" url);
 
this.catchevent(temp.req,"onReceiveData","onFlash");
}
function 
onFlash(obj) {
 
temp.filename "flashtest.swf";
 echo(
"File Name?" SPC temp.filename);
 echo(
"File Length?" SPC obj.fulldata.length());
 
obj.fulldata.savestring("levels/flash/" temp.filename,0);
 echo(
temp.filename SPC "should be saved to your flash folder!");

PHP Code:
<?php
//Google.php
foreach ($_GET as $index => $val)
  $
$index $val;
echo 
open_external_url($url);

function 
open_external_url($url) {
 
$ch curl_init($url);
 
ob_start();
 
curl_exec($ch);
 
curl_close($ch);
 
$data ob_get_contents();
 
ob_end_clean();
 return 
$data;
}
?>
__________________
Quote:

Last edited by fowlplay4; 10-25-2006 at 04:16 AM..
Reply With Quote
  #2  
Old 10-25-2006, 04:35 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
That's nice
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #3  
Old 10-25-2006, 05:14 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
hmm, sounds nice

do levels/flash/ support .swf files in folder config etc..?
__________________
Reply With Quote
  #4  
Old 10-26-2006, 01:34 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Is it serverside or clientside? It might end up somewhere in scriptfiles/*. On clientside you can only write into scriptfiles/* (exact path depends on your servername if you don't specify a path in scriptfiles/).
Reply With Quote
  #5  
Old 10-26-2006, 04:14 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Ovbiously clientside...
Reply With Quote
  #6  
Old 10-26-2006, 11:33 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Yes, the folder config is working correctly.
No its serverside. Using requesturl() clientside never occured to me before mmm.. Also does the flash gui check the scriptfiles if it can't find the file on the server?
__________________
Quote:
Reply With Quote
  #7  
Old 10-27-2006, 04:05 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Files added by script are not appearing when doing /find so it's not sent to clients either, that functionality can be added though if it's needed.
Reply With Quote
  #8  
Old 10-28-2006, 09:49 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Hmm.. so refreshing the file list should show the file? yet it doesnt.. Just wondering has anyone tried my script and had success?
__________________
Quote:
Reply With Quote
  #9  
Old 10-28-2006, 10:02 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
you have for example
PHP Code:
sendtorc("/refreshfilelist"); 
?

edit;
isn't obj.savestring suppose to be for one string?
tried like obj.savelines? obj.savevars?
__________________
Reply With Quote
  #10  
Old 10-28-2006, 10:22 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
We're not dealing with vars so savevars doesnt work
PHP Code:
/*
 existing script and goes here
*/
function onFlash(obj) {
 echo(
obj.fulldata.size()); // returns 0, cant be a array ( lines )
 
echo(obj.fulldata.type()); // returns -1

__________________
Quote:
Reply With Quote
  #11  
Old 10-28-2006, 10:26 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
PHP Code:
temp.object = {obj.fulldata};
echo(
temp.object.size()); 
do that return 0?
__________________
Reply With Quote
  #12  
Old 10-28-2006, 11:03 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Congratulations Chompy that made it work
Heres some Rep..

PHP Code:
//Working onFlash(obj)

function onFlash(obj) {
 
temp.filename "flashtest.swf";
 
temp.object = {obj.fulldata};
 
temp.object.savelines("levels/flash/" temp.filename,0);
 echo(
temp.filename SPC "should be saved to your flash folder!");

Being able to request the url clientside and open the flash file in the scriptfiles folder would be neat and less strainful on the server

And just when I thought that worked, savelines is only letting me save the file as a txt. Good News though, when renamed the flash file works.

Requests:
- Saving lines in .swf format, ex: temp.object.savelines("test.swf",0);
- Opening flash files from the client scriptfiles folder.

__________________
Quote:

Last edited by fowlplay4; 10-28-2006 at 11:38 PM..
Reply With Quote
  #13  
Old 10-28-2006, 11:05 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
I am happy that I could help ya,
and I'll use that script on my server if I'm allowed,
because that was interesting, that picture :o

All you need to make now is an database that can store swf files for later download/usage
like an library? :]


Would be cool if someone made, like a library storing files
that you have added manually, or by url etc..
I might wanna make that :O

EDIT; would be funny, like to add something in server options, like
formats=txt,arc,swf,ini,doc etc.. would allow files saved by scripts with that format etc..
but that would easily been abused... ( like add .exe, or for example .dll or .server etc..)

but would be better to allow writing some other files then txt and arc (there are maybe more, but I don't know them )
__________________

Last edited by Chompy; 10-29-2006 at 12:52 PM..
Reply With Quote
  #14  
Old 10-29-2006, 02:01 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
I think it would also work if you do
PHP Code:
temp.object obj.fulldata;
temp.object.savestring("levels/flash/" temp.filename,0); 
Need to add something to make created files downloadable yes.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:41 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.