function derpMode()
local inf = noStop
while inf ~= stop do
way = math.random(1, 6)
if way == 1 then
turtle.forward()
sleep(.1)
print("test")
elseif way == 2 then
turtle.back()
sleep(.1)
print("test")
elseif way == 3 then
turtle.turnLeft()
turtle.forward()
sleep(.1)
print("test")
elseif way == 4 then
turtle.turnLeft()
turtle.forward()
sleep(.1)
print("test")
elseif way == 5 then
turtle.up()
sleep(.1)
print("test")
elseif way == 6 then
turtle.down()
sleep(.1)
print("test")
end
end
end
function content()
print ("Content List")
print ("Name: Usage:")
print ("RandomWalk() sjTurtle.derpMode()")
end
I added a ton of test's to see were it failed. (This is an api) But it wont show anything. It wont do anything either.
[Help] Function wont do nothing [turtles]
Started by sjele, Aug 13 2012 06:44 PM
5 replies to this topic
#1
Posted 13 August 2012 - 06:44 PM
So made this, This is in the cc version witch comes with tekkit, the newset rec build. I don't think it is the newest CC out there.
#2
Posted 13 August 2012 - 06:49 PM
If noStop = nil and stop = nil, then while inf ~= stop do is the same as while nil~=nil do
#3
Posted 13 August 2012 - 06:55 PM
Ermm?
Could you tell me how i should use the while loop in this case?
Could you tell me how i should use the while loop in this case?
#4
Posted 13 August 2012 - 07:14 PM
what about:
function derpMode()
local inf = "noStop"
while inf ~= "stop" do
way = math.random(1, 6)
if way == 1 then
turtle.forward()
sleep(.1)
print("test")
elseif way == 2 then
turtle.back()
sleep(.1)
print("test")
elseif way == 3 then
turtle.turnLeft()
turtle.forward()
sleep(.1)
print("test")
elseif way == 4 then
turtle.turnLeft()
turtle.forward()
sleep(.1)
print("test")
elseif way == 5 then
turtle.up()
sleep(.1)
print("test")
elseif way == 6 then
turtle.down()
sleep(.1)
print("test")
end
end
end
function content()
print ("Content List")
print ("Name: Usage:")
print ("RandomWalk() sjTurtle.derpMode()")
end
But it won't stop because you didn't add any 'inf="stop" ' now
#5
Posted 13 August 2012 - 07:16 PM
My original plan was not to make it stop, sort of a troll mode.
Thanks.
Thanks.
#6
Posted 13 August 2012 - 07:17 PM
np
/>
3 user(s) are reading this topic
0 members, 3 guests, 0 anonymous users











