ID:2412772
 
Alright, so I'm trying to make changes to modular computers for SS13, and I am trying to make it so that you can have multiple user accounts, and for that I have a UID and a username stored in F.Stored_Data, F being the actual file in the modular computer and stored data being the text within. Apon buying the thing from the laptop vendor I made it so that it does,
if(firstboot = 0)
var/datum/computer_file/data/users = new/datum/computer_file/data()
users.filename = "users"
users.hidden = "true"
users.stored_data = "root:0"

Problem is, if I want the code to read users.stored_data again when asking for a username and password I need it to be able to only read everything before the semicolon. any way I can do that?
You could use copytext() and findtext() together.

copytext(some_text, 1, findtext(some_text, delimiter))
And if I wanted to do,
     users.stored_data = "root:0/nadministraitor:1000"

I assume /n will print out a newline.

How do I check the input for both root and administrator.
I assume /n will print out a newline.

I believe you want \n instead.

How do I check the input for both root and administrator.

Well... using the combination of procs I mentioned, an example:

var/information = "username:myusername;password:mypassword"
var/username = copytext(information, 1, findtext(information, ";"))
var/password = copytext(findtext(information, ";"))


I encourage personal experimentation with these procs, as well as checking out the reference for said procs.

Related: