Jump to content


--Kaos--'s Content

There have been 10 items by --Kaos-- (Search limited from 11-December 18)


By content type

See this member's

Sort by                Order  

#275545 1 terminal multiple disks

Posted by --Kaos-- on 28 February 2018 - 06:55 PM in Ask a Pro

im so glad knowledgable people like yourself exist as this is more complicated than i first thought ! haha

honestly, its appreciated like so much!

Startup:13: Expected string Boolean

:S

figured it out

the Boolean was because the part
rs.setOutput(tKeys[key], true)

should be
rs.setOutput(tKeys["basement"], true)

testing more as we speak but so grateful guys



#275533 1 terminal multiple disks

Posted by --Kaos-- on 28 February 2018 - 03:08 PM in Ask a Pro

Hi alll

so i have tried to figurie this out myself and look online for about a week before finally giving in and asking for help.

what i am trying to do is the following

I have 1 terminal computer and 1 disk drive. The disk drive is on the top of the computer
back , front left and right have redstone connected to them

What i want to do is when i insert a disk named "level2" then it activates for example the left side redstone for a time and then turn off , however, if i put in a disk named "basement" then the right redstone is activated

the labels of the names are redundant tbh as i was looking for the computer to read the disk with the following

ie.

disk labeled BASEMENT has data written of
key = "basement"

disk labeled "level2" has data written of
key = "level2"


So instead of having loads of disks i can have 4 disks to 1 computer and 1 drive. I want them to be used as access keys to open up different places per floor so having loads of terminals is something that wouldnt work

can someone pleaaasee help me as this is driving me nuts

thanks

Kaos



#275535 1 terminal multiple disks

Posted by --Kaos-- on 28 February 2018 - 04:43 PM in Ask a Pro

wow thats great thank you

i understand the idea of that but not sure how to put this into context.

i found someone elses code online who wrote
os.pullEvent = os.pullEventRaw
while true do
		if disk.isPresent("top") then
				if fs.exists("disk/.security/key") then
						shell.run("disk/.security/key")
						if key == "lemmein" then
								disk.eject("top")
								rs.setOutput("left", true)
								sleep(3)
								rs.setOutput("left", false)
						else
								disk.eject("top")
						end
				else
						disk.eject("top")
				end
		end
		sleep(0.1)
end
but this only works for one floppy disk

this is actually perfect if this worked for say 4 different floppy disks



#275549 1 terminal multiple disks

Posted by --Kaos-- on 28 February 2018 - 10:19 PM in Ask a Pro

View PostKingofGamesYami, on 28 February 2018 - 10:09 PM, said:

I'm terribly sorry I've been messing this up so much, thought this would be super easy to write. Had a bunch of classes to take but I'm back now :)/>
Spoiler
Don't actually modify the part that was marked as "modify this" with a comment earlier -- that was accedentially left in there from an earlier design. The only part you should need to change is the table at the top.

hehe its okay.

your time on this is very kind of you

i really appreciate it honestly, forever in your debt :)



#275538 1 terminal multiple disks

Posted by --Kaos-- on 28 February 2018 - 05:25 PM in Ask a Pro

omg you are amazing!!!

i cannot thank you enough!!!!

what a legend :)



#275543 1 terminal multiple disks

Posted by --Kaos-- on 28 February 2018 - 06:34 PM in Ask a Pro

am i correct in saying this based on your expert knowledge

local tKeys = {
		["basement"] = "back",
		["level2"] = "left",
}
while true do
		local event, side = os.pullEvent("disk")
		if disk.hasData("top") and fs.exists( "/disk/.security/key", "r") then
				local file = fs.open( "/disk/.security/key" )
				local key = file.readAll()
				file.close()
				if tKeys["basement"] then
						disk.eject("top")
						rs.setOutput(tKeys[key], true)
						sleep(3)
						rs.setOutput(tKeys[key], false)
				elseif
		tKeys["level2"] then
						disk.eject("top")
						rs.setOutput(tKeys[key], true)
						sleep(3)
						rs.setOutput(tKeys[key], false)
	else
						disk.eject("top")
				end
		end
end

currently fails
startup:7: Expected String



#275539 1 terminal multiple disks

Posted by --Kaos-- on 28 February 2018 - 05:48 PM in Ask a Pro

Hi again

for some reason the programme seems to stop

i set the programe as startup
i get "startup:9: expected String, string

i assume the part its point to is line
if tKeys[ key ] then --#modify this to be "basement" or whatever you want"

ive put it in as
[basement]
["basement"]
"basement"
but stil not playing

this stuff is hard man hahahaha



#275546 1 terminal multiple disks

Posted by --Kaos-- on 28 February 2018 - 07:16 PM in Ask a Pro

so update

basement works fine

the code works as it should. the disk ejects, the redstone at the back lights up and then turns off

however, if i do the exact same thing with a floppy disk with level2 it does nothing ,no ejection or redstone

its like its being ignored :s



#275542 1 terminal multiple disks

Posted by --Kaos-- on 28 February 2018 - 06:20 PM in Ask a Pro

you doing this without testing it is better than me with the entire internet and testing it!

your skills are superb



#275550 1 terminal multiple disks

Posted by --Kaos-- on 28 February 2018 - 10:32 PM in Ask a Pro

So the disks eject as per the terms of basement and level2 but the redstone doesnt light up from the direction

im sorry i am not much use of this, im learning stacks of information from what you are giving so im learning as we go along
!

i fixed it!

it was the path in the end that was causing the major issues, i change the path just to /disk/disk/ in the code and now reads like a dream!!!!!

thanks so much!!!!