Hello com,
this program doesn't work because it doesn't check the disk slot... why isn't it workingg?
[Turtle] Skipping Some Code...
Started by H4X0RZ, Sep 17 2013 10:54 AM
6 replies to this topic
#1
Posted 17 September 2013 - 10:54 AM
#2
Posted 17 September 2013 - 11:06 AM
Can you please give a description of what it is meant to do? i.e. what task is this code performing?
#3
Posted 17 September 2013 - 11:11 AM
theoriginalbit, on 17 September 2013 - 11:06 AM, said:
Can you please give a description of what it is meant to do? i.e. what task is this code performing?
this program is an early version of my submission and the task of this "snippet" is to just find out were the disk is and where the diskdrive is. But it skips the loop where it should try to find out the disk slot.
#4
Posted 17 September 2013 - 11:18 AM
And is the disk drive in the Turtle, or the world already?
#5
Posted 17 September 2013 - 11:42 AM
theoriginalbit, on 17 September 2013 - 11:18 AM, said:
And is the disk drive in the Turtle, or the world already?
#6
Posted 17 September 2013 - 12:00 PM
Freack100, on 17 September 2013 - 11:42 AM, said:
and tries to place the items it has sucken (is that the right form?)
Ok so now that I know what exactly you're trying to do, I can make some suggestions that are better for you.
Firstly, since any block can be in the chest, and any block can be placed in the world, I suggest that once the block is placed you perform peripheral.getType("front") == "drive" to validate if it is a drive, if not, break it and try again
Secondly, as an added extra you could also call do and not disk.hasAudio("front") on line 20 to make sure that it isn't a music disk which would also return true to the `isPresent` call.
Thirdly, I'm not too sure why you're doing your loops 1-4, can you elaborate some more why you picked 4? Why do you assume that the drive and disk will be in the first 4 slots?
Fourth, your code to find the drive is flawed because it doesn't break the block once placed if it is not the disk drive
Lastly, as for your actual problem, I can only speculate that it is because in the second for loop you're not selecting the slot meaning you're just dropping from the previously selected one (the disk drive one). Oh also lines 15 and 16 are redundant, the drive is already placed down.
#7
Posted 17 September 2013 - 03:23 PM
Thx bit 
i will try it out tomorrow after school (btw, I hate tomorror because I have school from 8:00 AM to 4:00 PM... -.-)
i will try it out tomorrow after school (btw, I hate tomorror because I have school from 8:00 AM to 4:00 PM... -.-)
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











