This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Luke9978's profile picture

Nether hub portal permission computer

Started by Luke9978, 23 May 2013 - 08:58 PM
Luke9978 #1
Posted 23 May 2013 - 10:58 PM
A good friend and I have been working on a Nether hub portal hub which has been so far so good but we have gotten to the user check and allows them through by clicking on a name in the four green boxes which needs to be very dynamic when a change to the pages occurs to display the new available portals to go to and we have been running into so many errors and the way i have been approaching it is more then likely wrong cause i have never had to tackle this problem. We have been using arrays and it just turned arrays into arrays and it was a mess but ill be pastebin a code that works to show you how it works and ect. Help would be greatly appreciated cause i'm just so confused. Basicly we want a code that takes the current logged in user and compares it to and line a file going "listed warp here-allowed people,ect,ect" and i just need someone to push me in the right direction and show me how to over come this problem. ill add your name in a startup ;)/> haha
pastebin current working (example what you're dealing with) http://pastebin.com/31SXxu06 image of the program at work sorta http://postimg.org/image/g6e9ynlgr/
Lyqyd #2
Posted 24 May 2013 - 01:35 PM
Split into new topic.
Engineer #3
Posted 24 May 2013 - 05:04 PM
If I understand it correctly, you want to store all the players name from a file in a table? Oh,just remember this loop:

local handle = fs.open("list","r")
local players = {}
for line in handle.readLine do
	 players[#players + 1] = line
end
handle.close()
This will put every line from the file into the table, I think this is what you were looking for. :)/>