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

Problem whit gps bassed ap

Started by Anora, 19 February 2013 - 05:45 AM
Anora #1
Posted 19 February 2013 - 06:45 AM
Ok so I made this app for a world eater no turtal it was working fine we updated computercraft on the server and now it will just dig down.
here is the script for it.


function Dig()
	rednet.open("right")
	local x, y, z = gps.locate(4)
	term.setCursorPos(1,1)
	term.clear()
	print("Diging to bedrock")
	Num = y
	local TimesDone = 1
	while TimesDone <= Num do
			redstone.setBundledOutput(bundle,dig)
			sleep(1)
			redstone.setBundledOutput(bundle,0)
			redstone.setBundledOutput(bundle,down)
			sleep(1)
			redstone.setBundledOutput(bundle,0)
			sleep(6)
			TimesDone = TimesDone + 1
	end
	Num = y
	local TimesDone = 1
	while TimesDone <= Num do
			redstone.setBundledOutput(bundle,down)
			sleep(1)
			redstone.setBundledOutput(bundle,0)
			sleep(6)
			TimesDone = TimesDone + 1
	end
	os.reboot()
end

now this script is just a fuction whiten the larger program all other fuctiosn work.

now it dose pull the GPS data and passes the Y cordenit to be ussed in its diging fuction, it moves all the way down to bedrock and just keeps going evendought its reatched it(it didn't do this before i updated it would actualy stop and move back up) becaus of this it wont go up becaus it thinks its still needs to go down.
Edited by
Lyqyd #2
Posted 19 February 2013 - 06:57 AM
If I recall correctly, you need to specify the value for the debug boolean. Try changing the GPS call to gps.locate(4, false).
Anora #3
Posted 19 February 2013 - 07:00 AM
Il give that a shot just odd that it was working and no it dos note
Anora #4
Posted 19 February 2013 - 09:00 AM
no change, just dose not go back up, omg cant beleav I missed that….
Lyqyd #5
Posted 19 February 2013 - 09:20 AM
Make it print Num before it starts digging down so that you can verify that it is in fact getting a GPS response.