-
Posts
129 -
Joined
-
Last visited
Everything posted by Spaceshipable
-
So will this return a table like {false,"obstruction",{10,-40,9}} for example? local drive = peripheral.wrap(side) local canMove, whyNot = drive.simulate(0, true) what does this return presently? Just the error string? local drive = peripheral.wrap(side) local canMove, whyNot = pcall(drive.move, 0, true, true)
-
I would suggest 3 commands that give 3 responses. The first would be 'drive.moveable' which would return a boolean. The second would be something like 'drive.nomovereason' which would return a string stating the reason for not moving and the third would be drive.obstructionlocation which would return a table of the coordinates of the obstructive block.
-
I finally bothered to get some multi movement code together. Thus far it can only accept single digit distances and has no check to make sure the number is valid but it works thus far. Though people might be interested. direction = {"d","u","l","r","b","f"} function move() os.sleep(0.5) dir = tonumber(dir) peripheral.call("back","move",dir,false,false) dis = dis-1 h = fs.open("/disk/variables","w") h.write(dis) h.write(dir) h.close() end function start() print("Direction? d,u,l,r,b,f ") dirname = read() for i=1,7 do if i == 7 then print("Invalid") start() elseif dirname == direction[i] then dir = i-1 print("Distance?") dis = read() move() end end end if fs.exists("/disk/variables") then h = fs.open("/disk/variables","r") string = h.readAll() dis = string.sub(string,1,1) dir = string.sub(string,4,4) h.close() if tonumber(dis) == 0 then start() else move() end else start() end Any suggestions welcome. EDIT: just thought that if I change 'dir = string.sub(string,4,4)' to ' dir = string.sub(string,4)' it should work fine
-
1) This is for single moves. The i loop checks if my input matches the any of the entries in the directions array. The go() function is for if I type something wrongly. Just noticed that I have put 'direction' instead of direction(i) though (might be the problem here) will check. 2) Will add when I decided to implement multiple moves on one command.
-
just built this: Unfortunately the terminal glasses bridge (grey block) from open peripherals seems to lose connection with the glasses after the first move. Here is my code: direction = {"down","up","left","right","back","forward"} local event, command = os.pullEvent("chat_command") function go() for i=1,7 do if i == 7 then print("Invalid") go() elseif command == direction then peripheral.call("back","move",(i-1),false,false) end end end go() Would it be possible to make the connection maintain after movement?
-
I meant easier for a player and in terms of security rather than code wise. Why would it be near impossible? Things like tesseracts can be made private can't they? In regards to NightKev's idea, wouldn't both blocks be private to a player anyway if both blocks have to be placed by the same player to connect? Would be no more difficult than MFFS linking cards. Just click one then click the other and they are linked. If anything that's easier than enderchests. Less clicks anyway, and no colour collection hassle.
-
You explained why you would rather do a passwords type thing. You never said anything about it being more secure. There's no way it can be more secure as 1 in 4581298448 is still a higher chance than 1 in infinity. I just thought that if you wanted to have a GUIless system then you were thinking what is the easiest way a player can do this and in my mind simply placing a block and it being automatically private is easier. This is exactly what I had meant. Both source and destination have to be locked to the same player. I think we're all on the same page Finally another idea just popped into my head. Why not have some sort of linking card. You could click the source then click the destination to link them. Maybe even use the screwdriver?