... please give more information.
Do you mean by saving data, that when the player leaves the world and comes back, some data is stored? (like ModPE.readData/ModPE.saveData)
Are you referring to getting the sd card directories, creating a txt file and then saving things into that file. Do you want to save a chatlog or something.
Are you referring to getting the sd card directories, creating a txt file and then saving things into that file. Do you want to save a chatlog or something.
Yes, I know that is possible with Android programming language (that is similar to JAVA) to save data e.g. in a .txt file
If you mean how to read and write mods here.
To write mods, get an app called DroidEdit. Then write your code, and save the file like this. NameOfFile.js. End the filename with a .js <-- this part. It means JavaScript.
To read mods:
Open up the mod with DroidEdit. Read it. Edit if you want. Save it if you want (recommended if you editted it). and then close the file.
+1 if i helped.
... he wants too create a file with a txt extension, and he wants too store data and read data from that file. Is it really that hard to understand?
Anyway, I'm not sure if this is possible. It probably is in Java, not in JavaScript. Why not use ModPE.saveData()? And if you really need this, try making a PocketMine plugin and creating a plugin with a YAML config (or json)
//my example of a write file.
var File = {
writeFile:function(dir, name, content)
{
var file = new java.io.File(dir, name);
var suc = new java.io.File(dir).mkdirs();
if(suc){
file.createNewFile();
var writerParams = new java.io.FileOutputStream(file);
var writer = new java.io.OutputStreamWriter(writerParams);
writer.append("" + content);
writer.close();
}
}
}
/**
use like this
var internal = android.os.Environment.getExternalStorageDirectory();
var folder = internal + "/myFolder";
var content = "abc123";
File.writeFile(folder, "myFile.txt", content);
*/
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThanks to everyone!
Do you mean by saving data, that when the player leaves the world and comes back, some data is stored? (like ModPE.readData/ModPE.saveData)
Want GUI Templates? Done!
https://github.com/BeATz-UnKNoWN/ModPE_Scripts/wiki/ModPE-Script-Templates
P.S. Feel free to follow me so you know when I post "awesome" content and make the MCForums a brighter place (totally).
If you need to contact me you can either shoot a Kik message to beatz_unknown or send an email to [email protected]
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYes, I know that is possible with Android programming language (that is similar to JAVA) to save data e.g. in a .txt file
-
View User Profile
-
View Posts
-
Send Message
Curse Premium-
View User Profile
-
View Posts
-
Send Message
Curse PremiumAnyway, I'm not sure if this is possible. It probably is in Java, not in JavaScript. Why not use ModPE.saveData()? And if you really need this, try making a PocketMine plugin and creating a plugin with a YAML config (or json)
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThanks you very much!
//my example of a write file. var File = { writeFile:function(dir, name, content) { var file = new java.io.File(dir, name); var suc = new java.io.File(dir).mkdirs(); if(suc){ file.createNewFile(); var writerParams = new java.io.FileOutputStream(file); var writer = new java.io.OutputStreamWriter(writerParams); writer.append("" + content); writer.close(); } } } /** use like this var internal = android.os.Environment.getExternalStorageDirectory(); var folder = internal + "/myFolder"; var content = "abc123"; File.writeFile(folder, "myFile.txt", content); */