The Undefeated Posted September 2, 2017 Posted September 2, 2017 I have a list of items with their buy limits. My question is, what's the "best" way to store this data for scripts? I can think of options myself, but not sure if those are the best / simplest.
H0rn Posted September 2, 2017 Posted September 2, 2017 if it was myself, probably MySQL then you could grab it from anywhere with a PHP script? I'm not advanced though.
Explv Posted September 2, 2017 Posted September 2, 2017 4 minutes ago, The Undefeated said: I have a list of items with their buy limits. My question is, what's the "best" way to store this data for scripts? I can think of options myself, but not sure if those are the best / simplest. Just store it in a .txt file, with item_name:buy_limit on each line. If you need more data than just buy limit for each item, then store as JSON or something. 3
Polymorphism Posted September 2, 2017 Posted September 2, 2017 5 minutes ago, Explv said: Just store it in a .txt file, with item_name:buy_limit on each line. If you need more data than just buy limit for each item, then store as JSON or something. json for days bruh! especially if intermixing with a webserver
dreameo Posted September 2, 2017 Posted September 2, 2017 Use a hashmap. Heres how to serialize: https://beginnersbook.com/2013/12/how-to-serialize-hashmap-in-java/
Google Posted September 2, 2017 Posted September 2, 2017 3 minutes ago, dcl1998 said: .. how would u not know this lol 6 minutes ago, Qubit said: how are you scripter 2 and don't know this.. how are you a human if you don't know how to read you un-educated prat , read what he said. 1
The Undefeated Posted September 2, 2017 Author Posted September 2, 2017 6 minutes ago, Qubit said: how are you scripter 2 and don't know this.. 6 minutes ago, dcl1998 said: .. how would u not know this lol Can you read? I can think of options myself, but not sure if those are the best / simplest. 25 minutes ago, Explv said: Just store it in a .txt file, with item_name:buy_limit on each line. If you need more data than just buy limit for each item, then store as JSON or something. This sounded like the most viable option for me too. JSON is kinda unnecessary for now. (And still have get some better JSON knowledge )
k9thebeast Posted September 2, 2017 Posted September 2, 2017 Load from a CSV for plebs, or a database if you like to fuck
Qubit Posted September 2, 2017 Posted September 2, 2017 3 hours ago, PulseImpulse said: how are you a human if you don't know how to read you un-educated prat , read what he said. wow im uneducated didn't know that. He didn't list any of the options he was thinking of, thus leading me to assume he doesn't know any. He also just said above he doesn't know json, say less.
The Undefeated Posted September 2, 2017 Author Posted September 2, 2017 4 minutes ago, Qubit said: wow im uneducated didn't know that. He didn't list any of the options he was thinking of, thus leading me to assume he doesn't know any. He also just said above he doesn't know json, say less. You again interpret things wrong. I didn't say I don't know JSON, I say I should get more knowledge of it, that doesn't mean I don't know any of it which is not the case.
dreameo Posted September 3, 2017 Posted September 3, 2017 Yes, JSON takes minutes to pick up. Plus, you would need to download a library to make good use of it in Java I believe. Not sure why you would want to parse through a string and do string operations to get value from x item. Serialize hash map would be a one time thing to save the file. Read it each time and instantly get the value from key.
liverare Posted September 3, 2017 Posted September 3, 2017 Make life easy for yourself and store them in a HashMap or something. Unless we're talking +20 values, then look into alternative options.
Explv Posted September 3, 2017 Posted September 3, 2017 18 hours ago, dreameo said: Yes, JSON takes minutes to pick up. Plus, you would need to download a library to make good use of it in Java I believe. Not sure why you would want to parse through a string and do string operations to get value from x item. Serialize hash map would be a one time thing to save the file. Read it each time and instantly get the value from key. This is a weird suggestion