Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?
You are not logged in.
Pages: 1
I need a way to store stats such as health and hunger and a person to teach me how to code it. I'll give you the details when you're teaching me.
Any questions? Just ask.
Offline
Are you using an SDK like botbits, or just the player.io client library?
Do you want to save it to a file, or just keep it in memory?
Do you want to do this for every player, and do you want it to persist even after they leave?
Does it make a difference if they're using the smiley instead of the smiley?
After approximately a long time of being idle...
I've finally found the time, energy, and inspiration to begin...
Announcing...
the long-awaited sequal..
with an actual GUI...
event-based system instead of threads...
..nope never mind out of inspiration. I'll be back in another month or two.
It's here: LuaBot 2.0! (Hopefully we fixed that missing DLL problem)
Offline
Best ways. XML, MySQL, JSON. Choose something of that.
I have found some more threads,
http://forums.everybodyedits.com/viewtopic.php?id=35240
http://forums.everybodyedits.com/viewtopic.php?id=35107
http://forums.everybodyedits.com/viewtopic.php?id=35064
Offline
the monthly periodic storing data debate?
To recap further inform yourself, check here, where we discussed the issue at length.
Perhaps the best way is the one you figure out yourself? I mean, everyone has their niche they like, or the ones the experienced programmers have found that have the best functionality. In the long run, if you probably aren't going to use the fancy [insert feature here] the crazy folks love, perhaps the method you understand would be the most constructive.
Offline
Are you using an SDK like botbits, or just the player.io client library?
Do you want to save it to a file, or just keep it in memory?
Do you want to do this for every player, and do you want it to persist even after they leave?
Does it make a difference if they're using the smiley instead of the smiley?
I am using botbits but i'm going to be getting rid of it because it didn't do what i wanted. I want to be able to access the file and edit as needed. I need it for every player and it saves as they leave. It doesn't make a difference at all what smiley they're using.
Best ways. XML, MySQL, JSON. Choose something of that.
I was thinking JSON because I've been recommended it before but I'd need someone to teach me. Will you be my sensei? ^-^ I was also thinking of using a text file, but I'd also need help with that.
Offline
ashtoin wrote:Are you using an SDK like botbits, or just the player.io client library?
Do you want to save it to a file, or just keep it in memory?
Do you want to do this for every player, and do you want it to persist even after they leave?
Does it make a difference if they're using the smiley instead of the smiley?I am using botbits but i'm going to be getting rid of it because it didn't do what i wanted. I want to be able to access the file and edit as needed. I need it for every player and it saves as they leave. It doesn't make a difference at all what smiley they're using.
capasha wrote:Best ways. XML, MySQL, JSON. Choose something of that.
I was thinking JSON because I've been recommended it before but I'd need someone to teach me. Will you be my sensei? ^-^ I was also thinking of using a text file, but I'd also need help with that.
XML and JSON are simply a way of storing data in a text file.
What you are talking about could be achieved by using some of botbit's events (e.g. player joined, i don't remember the exact name) plus botbits ability to store arbitrary data associated with each player.
When a player joins, just load the file, and when they leave, save it, using your language of choice
Then just use the stored data in the player variable for what you want to do.
After approximately a long time of being idle...
I've finally found the time, energy, and inspiration to begin...
Announcing...
the long-awaited sequal..
with an actual GUI...
event-based system instead of threads...
..nope never mind out of inspiration. I'll be back in another month or two.
It's here: LuaBot 2.0! (Hopefully we fixed that missing DLL problem)
Offline
Wait what why is JSON, XML and MySQL vital? I made a bot using a .txt file for saving/loading and it works just as fine, plus its a lot simplier and easier to use.
Here is how you could read data from a player:
Add on top, on the variables:
string data;
On the Form1_Loaded add:
data = System.IO.File.ReadAllText(@Environment.CurrentDirectory + @"\data.txt")
Let's say our division from data is '/'
(plr/data/etc)
Then just add a void or anything to do this:
for (i=0; i<data.Split('\n').Length; i++)
{
string plrLine = data.Split('\n')[i];
for (k=0; k<plrLine.Split('/').Length; k++) // here we use the divisor
{
string data = plrLine.Split('/')[k];
}
// plrLine.Split('/')[0] would return the first item in the divisor order. plrName/etc/etc -> plrName
// to change a value add a void with the code above, and replace data: plrLine with data: newPlrLine
}
Offline
Wait what why is JSON, XML and MySQL vital? I made a bot using a .txt file for saving/loading and it works just as fine, plus its a lot simplier and easier to use.
Here is how you could read data from a player:
Add on top, on the variables:string data;
On the Form1_Loaded add:
data = System.IO.File.ReadAllText(@Environment.CurrentDirectory + @"\data.txt")
Let's say our division from data is '/'
(plr/data/etc)
Then just add a void or anything to do this:for (i=0; i<data.Split('\n').Length; i++) { string plrLine = data.Split('\n')[i]; for (k=0; k<plrLine.Split('/').Length; k++) // here we use the divisor { string data = plrLine.Split('/')[k]; } // plrLine.Split('/')[0] would return the first item in the divisor order. plrName/etc/etc -> plrName // to change a value add a void with the code above, and replace data: plrLine with data: newPlrLine }
This code must be the worst I have ever seen. Please use XML, JSON or MySQL.
Offline
marcoantonimsantos wrote:Wait what why is JSON, XML and MySQL vital? I made a bot using a .txt file for saving/loading and it works just as fine, plus its a lot simplier and easier to use.
Here is how you could read data from a player:
Add on top, on the variables:string data;
On the Form1_Loaded add:
data = System.IO.File.ReadAllText(@Environment.CurrentDirectory + @"\data.txt")
Let's say our division from data is '/'
(plr/data/etc)
Then just add a void or anything to do this:for (i=0; i<data.Split('\n').Length; i++) { string plrLine = data.Split('\n')[i]; for (k=0; k<plrLine.Split('/').Length; k++) // here we use the divisor { string data = plrLine.Split('/')[k]; } // plrLine.Split('/')[0] would return the first item in the divisor order. plrName/etc/etc -> plrName // to change a value add a void with the code above, and replace data: plrLine with data: newPlrLine }
This code must be the worst I have ever seen. Please use XML, JSON or MySQL.
Listen, he is a newbie. He wants to learn
Let him start off easy
Offline
capasha wrote:marcoantonimsantos wrote:Wait what why is JSON, XML and MySQL vital? I made a bot using a .txt file for saving/loading and it works just as fine, plus its a lot simplier and easier to use.
Here is how you could read data from a player:
Add on top, on the variables:string data;
On the Form1_Loaded add:
data = System.IO.File.ReadAllText(@Environment.CurrentDirectory + @"\data.txt")
Let's say our division from data is '/'
(plr/data/etc)
Then just add a void or anything to do this:for (i=0; i<data.Split('\n').Length; i++) { string plrLine = data.Split('\n')[i]; for (k=0; k<plrLine.Split('/').Length; k++) // here we use the divisor { string data = plrLine.Split('/')[k]; } // plrLine.Split('/')[0] would return the first item in the divisor order. plrName/etc/etc -> plrName // to change a value add a void with the code above, and replace data: plrLine with data: newPlrLine }
This code must be the worst I have ever seen. Please use XML, JSON or MySQL.
Listen, he is a newbie. He wants to learn
Let him start off easy
He want someone to "learn" him to code things. If he can't even use a document, then it's really bad.
And I don't think this thread is only for EE. It's for saving data. Which can be found in reading a book about C# or reading tutorials on internet.
And there is some different ways to store data:
Text File
Binary File
INI File
XML
JSON
MySQL Database
I guess it exist even more ways to store data.
Offline
I completely outlined how to save data as JSON and XML with examples you can download and full source : http://forums.everybodyedits.com/viewto … 06#p607706
It is modeled after saving a listbox to file but ignore the listbox stuff and just put data into a class and do the saving and loading.
Thank you eleizibeth ^
I stack my signatures rather than delete them so I don't lose them
Offline
Pages: 1
[ Started around 1732738915.4781 - Generated in 0.215 seconds, 13 queries executed - Memory usage: 1.61 MiB (Peak: 1.8 MiB) ]