Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / can dbpro download or read txt from website?

Author
Message
mr Handy
16
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 2nd Jul 2009 21:39
Hi!
Can dbpro download or read txt from website?
path like www.test.com/files/test.txt
I found only ftp commands in help but this requires password
and login, and thats useless for this task...
Anyway, the idea is that game reads highscores from website.
10x

Lee Bamber is so~o swett'n'cool desu nya ^^
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 2nd Jul 2009 22:58
Search the forum for "http", there are many hits. I believe there is an "http request data" type command but have never tried them.

I'm not a real programmer but I play one with DBPro!
Humanoid
20
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Finland
Posted: 3rd Jul 2009 01:22
spooky maded code:



Suomi Finland PERKELE!
Daniel TGC
Retired Moderator
17
Years of Service
User Offline
Joined: 19th Feb 2007
Location: TGC
Posted: 3rd Jul 2009 01:22 Edited at: 3rd Jul 2009 01:26
Yes, make sure your copy of DBPro is up to date then you can use these commands.

http connect "www.mywebsite.com",80
MyWebData$=http request data("GET","MyTextFile.txt","",0)
print MyWebData$
http disconnect

From the help file:

HTTP CONNECT


HTTP REQUEST DATA


HTTP DISCONNECT


mr Handy
16
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 3rd Jul 2009 18:16
Daniel TGC
your code's failed, sorry

But i've searched for "http" in forum, and found code snippet with use of "urlmon" dll, and it worked.

Lee Bamber is so~o swett'n'cool desu nya ^^
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd Jul 2009 20:29
Did you read this bit...
Quote: "Yes, make sure your copy of DBPro is up to date then you can use these commands."

...because if you did, it would have worked fine.

mr Handy
16
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 3rd Jul 2009 20:49 Edited at: 3rd Jul 2009 20:54
Of course i have latest update!
And this command seems to work only with php code together.

EDIT thanks, humanoid! your code works fine. I think i should add progressbar for perfection.

Lee Bamber is so~o sweet'n'cool desu nya ^^
spooky
21
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 4th Jul 2009 23:51
If you want to do progess bar there is another way of downloading files bit by bit and directly into a memblock, ie no file need be writen, which is a lot better.

Have a read of this post;

http://forum.thegamecreators.com/?m=forum_view&t=77150&b=18

Boo!
Clbembry
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Minnesota
Posted: 5th Jul 2009 02:30
Couldn't the program download the HTML file and read it from there?

Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 5th Jul 2009 10:25 Edited at: 5th Jul 2009 10:29
In the next version of DarkNet (to be released soon) you can communicate with web servers. You could probably put a progress bar in. Here is some demo code:


Screenshot

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-05-04 02:50:08
Your offset time is: 2024-05-04 02:50:08