TrevorS-3701,
If you want to go through the network the easiest way to do it would be to use the LitDev extension.
There goto LDNetwork. Within that you will see that you can set a highscore and other players can do the same.
JR
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Can Small-Basic read/write to cloud storage (e.g. OneDrive), without needing to sync it locally? I'm looking to hold a "high score" for a game, which can be compared to the current score. These lines, which are to a local sync for OneDrive, work:
HighScore = File.ReadLine("C:\Users\trevo\OneDrive\Folder\HighScore.txt",1)
If score > HighScore Then
GraphicsWindow.ShowMessage( "Game Over. You have beaten the current high score: " + HighScore + ".", "Title" )
File.WriteLine("C:\Users\trevo\OneDrive\Folder\HighScore.txt",1,score)
Else
GraphicsWindow.ShowMessage( "Game Over.", "Title" )
EndIf
When replacing the filepath/name with the OneDrive edit link (a URL starting "https://1drv.ms/") the program still runs but nothing is read / written, making every game a new high score!
TrevorS-3701,
If you want to go through the network the easiest way to do it would be to use the LitDev extension.
There goto LDNetwork. Within that you will see that you can set a highscore and other players can do the same.
JR
A bit late, but following JR's suggestion, LDNetwork has been updated (version 1.2.25.0 - currently Beta).
A couple of reasons:
1] litdev.co.uk has reinstated to litdev.uk (where highscore is saved)
2] SSL security (https) is now supported for network file transfer (see https://litdev.uk/mybb/forumdisplay.php?fid=3 for more details)
TrevorS-3701,
I changed your code a little just to see what it would do. It did write the file OK and it was able to read it. I'm thinking you might have something wrong for the address to one drive. Maybe, in the address you don't have a folder called folder.
JR
score=2
HighScore = File.ReadLine("C:\Users\jrmrh\OneDrive\HighScore.txt",1)
If score > HighScore Then
GraphicsWindow.ShowMessage( "Game Over. You have beaten the current high score: " + HighScore + ".", "Title" )
File.WriteLine("C:\Users\jrmrh\OneDrive\HighScore.txt",1,score)
Else
GraphicsWindow.ShowMessage( "Game Over.", "Title" )
EndIf
Here's a code snippet that works for a game called "madball"
Result=LDNetwork.HighScore("Madball","TM",6)
TextWindow.WriteLine(Result)
You will have to have the extension loaded and working in small basic.
JR