Gamestudio Links
Zorro Links
Newest Posts
A9
by 3run. 07/08/20 18:44
Historical ticks for Lookback backfill
by Zheka. 07/08/20 09:10
Trade Mode without a broker
by jj02520024. 07/08/20 01:20
How to handle algo name in Simulate.c
by happysun. 07/07/20 08:56
Erasing a datapoint in a plot array
by jcl. 07/06/20 09:51
typo
by jcl. 07/06/20 09:44
Video Panel System
by Emre. 07/06/20 09:39
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
7 registered members (3run, Quad, FLD, deus777, Ayumi, jenGs, kvm), 425 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
TraderKevin, deus777, carolthesecond, Roger399, vrindger
18474 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Reading a TXT file on server #479790
04/26/20 16:39
04/26/20 16:39
Joined: Jun 2008
Posts: 137
London
T
Truth Offline OP
Member
Truth  Offline OP
Member
T

Joined: Jun 2008
Posts: 137
London
Hi,

Is there a way to read a text file on a server into a STRING object? I need to be able to be able to change or add another "session_connect" ip address after I've released my game just by modifying a text file.

Currently I'm using a local text file

STRING Server = null;
var FileServerTxt;

function multiplayer
{
FileServerTxt = file_open_read("Server.txt"); <-------I thought I could just change this txt to the URL of the server but it doesn't work
file_str_read(FileServerTxt, Server);
session_connect("highroad", Server);
file_close(FileServerTxt);
}

thanks

Re: Reading a TXT file on server [Re: Truth] #479796
04/26/20 20:13
04/26/20 20:13
Joined: Jan 2002
Posts: 4,223
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,223
Germany / Essen
You can use the HTTP and FTP commands to download the file and then open it as any other file.


Always learn from history, to be sure you make the same mistakes again...
Re: Reading a TXT file on server [Re: Uhrwerk] #479798
04/26/20 20:43
04/26/20 20:43
Joined: Jun 2008
Posts: 137
London
T
Truth Offline OP
Member
Truth  Offline OP
Member
T

Joined: Jun 2008
Posts: 137
London
Thanks, I'll look into that

Re: Reading a TXT file on server [Re: Uhrwerk] #480421
06/05/20 18:22
06/05/20 18:22
Joined: Jun 2008
Posts: 137
London
T
Truth Offline OP
Member
Truth  Offline OP
Member
T

Joined: Jun 2008
Posts: 137
London
I'm guessing there's no way to use ftp with c-script? frown

Re: Reading a TXT file on server [Re: Truth] #480446
06/06/20 23:28
06/06/20 23:28
Joined: Jun 2008
Posts: 137
London
T
Truth Offline OP
Member
Truth  Offline OP
Member
T

Joined: Jun 2008
Posts: 137
London
I done it by using the "exec" function to launch a silent batch file which downloads the txt from my FTP server using WinSCP


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1