Jump to content


crazyguymgd's Content

There have been 139 items by crazyguymgd (Search limited from 30-March 23)


By content type

See this member's


Sort by                Order  

#71430 Check if a modem exists

Posted by crazyguymgd on 09 January 2013 - 04:34 PM in Ask a Pro

looks good



#71803 Stair Building Help w/ Gravel

Posted by crazyguymgd on 10 January 2013 - 08:50 AM in Ask a Pro


local height = 10

function forward()
while not(turtle.forward()) do
turtle.dig()
turtle.attack()
sleep(0.25)
end
end

function up()
while not(turtle.up()) do
turtle.digUp()
turtle.attackUp()
end
end

function digUp()
while turtle.detectUp() do
turtle.digUp()
sleep(0.25)
end
end

for i = 1, height do
turtle.place()
up()
digUp()
forward()
turtle.turnRight()
end

That's my crack at this. Make sure to give him some cobble or something in slot 1 because he'll put it down if he comes across a spot that needs it.



#71808 [ERROR] Having a rough start with my first Computercraft program.

Posted by crazyguymgd on 10 January 2013 - 08:58 AM in Ask a Pro

View PostConlan99, on 10 January 2013 - 08:47 AM, said:

AHA! I found out how to enter the code into this awesome little box. I've been tinkering around with the code; trying to get the redstone portion done, and now I am faced with a whole new error message that I looked up, but didn't understand... Here it is: :21: 'end' expected (to close 'if' at line 18)
term.clear()
term.setCursorPos(1,1)
textutils.slowPrint("Hello, and welcome to Conlan99's automatic miner's\nmining program.")
sleep(1)
print("\nThe automatic miner is starting.\nTo stop the automatic miner, please enter Stop.")
repeat
local input = read()
redstone.setOutput("right",true)
sleep(0.25)
redstone.setOutput("right",false)
sleep(1)
redstone.setOutput("back",true)
sleep(0.25)
redstone.setOutput("back",false)
sleep(0.25)
if input ~= "stop" or input ~= "Stop" or input ~= "exit" or input ~= "Exit" or input ~= "quit" or input ~= "Quit" then
print("Unrecognisable command. Please try again.")
until input == "stop" or input == "Stop" or input == "exit" or input == "Exit" or input == "quit" or input == "Quit" then
textutils.slowPrint("Goodbye.")
sleep(0.25)
os.shutdown()
end

think you just need an end after print("Unrecognisable command. Please try again.")



#71810 Stair Building Help w/ Gravel

Posted by crazyguymgd on 10 January 2013 - 09:02 AM in Ask a Pro

View PostxInDiGo, on 10 January 2013 - 09:00 AM, said:

Quote

That's my crack at this. Make sure to give him some cobble or something in slot 1 because he'll put it down if he comes across a spot that needs it.

so you're saying he'll place cobble if theres none where there should be? thats pretty smart! i'm going to run this through and see what i can do! i was able to tweak the other one and get it to work pretty well! but question how does the turtle know if it needs to place a block? i don't understand that part of the script.

he doesn't really know. he just tries to place it and if there is already a block there he will just fail and move on.



#71818 [ERROR] Having a rough start with my first Computercraft program.

Posted by crazyguymgd on 10 January 2013 - 09:11 AM in Ask a Pro

View PostConlan99, on 10 January 2013 - 09:06 AM, said:

View Postcrazyguymgd, on 10 January 2013 - 08:58 AM, said:

think you just need an end after print("Unrecognisable command. Please try again.")
Aha! Thanks. You fixed the "end expected" error! Still having issues with an "Unrecognisable character" error on the same line as my "until" statement.
change the then to a do will get it to run.



#71843 [ERROR] Having a rough start with my first Computercraft program.

Posted by crazyguymgd on 10 January 2013 - 09:30 AM in Ask a Pro

sorry I should have been more specific. Maybe this will help:


term.clear()
term.setCursorPos(1,1)
textutils.slowPrint("Hello, and welcome to Conlan99's automatic miner's\nmining program.")
sleep(1)
print("\nThe automatic miner is starting.\nTo stop the automatic miner, please enter Stop.")
repeat
local input = read()
redstone.setOutput("right",true)
sleep(0.25)
redstone.setOutput("right",false)
sleep(1)
redstone.setOutput("back",true)
sleep(0.25)
redstone.setOutput("back",false)
sleep(0.25)
if input ~= "stop" and input ~= "Stop" and input ~= "exit" and input ~= "Exit" and input ~= "quit" and input ~= "Quit" then
print("Unrecognisable command. Please try again.")
end
until input == "stop" or input == "Stop" or input == "exit" or input == "Exit" or input == "quit" or input == "Quit" do
textutils.slowPrint("Goodbye.")
sleep(0.25)
os.shutdown()
end

Changes from your code:
end to close if statement.
ors in the if changed to ands
do added at the end of the until condition



#71849 [lua] Need help writing a program

Posted by crazyguymgd on 10 January 2013 - 09:37 AM in Ask a Pro

View Postrobertcarr22, on 10 January 2013 - 09:33 AM, said:

Still cant figure it out :/ can someone please help?

is the code above still the most recent copy? I'd be happy to take a look but what you have above doesn't work and I don't want to debug it all if you've already done some of that.



#71853 Stair Building Help w/ Gravel

Posted by crazyguymgd on 10 January 2013 - 09:38 AM in Ask a Pro

View PostxInDiGo, on 10 January 2013 - 09:37 AM, said:

View Postcrazyguymgd, on 10 January 2013 - 09:02 AM, said:

he doesn't really know. he just tries to place it and if there is already a block there he will just fail and move on.

thats great! this worked perfect! i'm gonna play around with the code and make sure i understand why it works! thanks again for all your help! but believe me, this won't be my last post :P

glad I could help :)



#71859 Player Detector List

Posted by crazyguymgd on 10 January 2013 - 09:46 AM in Ask a Pro

View Postdobbylego, on 09 January 2013 - 02:19 PM, said:

Hello people who read this!

I am trying to add a player detector to my password door so i know who tryed to access it, but what i cant figure out is how to actually make it write to a list on another program. Can anyone help me?

Thanks!
-Will

Save it to a file, then the other program can read in the file and do what it wants with that data?



#71868 Detecting Disk?

Posted by crazyguymgd on 10 January 2013 - 09:59 AM in Ask a Pro

add a break when the password is correct after you reset the cursor position to get out of the while loop



#71889 INPUT NEEDED - Spam

Posted by crazyguymgd on 10 January 2013 - 10:38 AM in Forum Discussion

View PostAfterLifeLochie, on 10 January 2013 - 10:20 AM, said:

View Posttiin57, on 10 January 2013 - 10:14 AM, said:

View PostCranium, on 10 January 2013 - 10:10 AM, said:

Although I think we might have to make it multiple choice for those who cannot spell ANYTHING.
Lol, if they can't spell "dirt", then I say they shouldn't even be in here in the first place :P

Cloudy, dan, Lyqyd, Cruor, Lochie, FuzzyPurp, casper (is he still alive?) and other assorted forum staff; have you thought about adding more moderators? :D

The number of moderators is certainly not the issue, I'll tell you that.

The fact of the matter is, the quantity and the rate of the spam becomes unmanageable. Last night I just sat on the forums, and after I'd delete three spam users, another two would reappear and litter the place with posts. I had to sit here and entirely devote my attention to watching the forums like a hawk and remove stuff straight away - and when I wake up, it's the same thing - go through the list of reports and clear them all out. There is an almost unbroken wall of spam-reports in the Reports Center, stretching back to at least, and if not further than, Page 8 now.

I still really, really suggest we approve new member's (<10) posts. It's much easier to delete content before it appears - and it keeps the Reports system in a manageable state.

I don't know what the number of spam posts really is but I sorted New content by Past 24 hours and found 15 posts on the first page, started by users with < 25 posts. Would approving all these new posts and disapproving all the spam posts be any better than just deleting spam posts?



#71896 Detecting Disk?

Posted by crazyguymgd on 10 January 2013 - 10:45 AM in Ask a Pro

 ViextraProgramming, on 10 January 2013 - 10:41 AM, said:

 crazyguymgd, on 10 January 2013 - 09:59 AM, said:

add a break when the password is correct after you reset the cursor position to get out of the while loop
What is a break... just an empty line?

just the word break. for example:

i = 1
while true do
  i = i + 1
  if i == 5 then
	break
  end
end

will break out of the while loop when the condition i == 5 is true



#71913 [Lua][Error]

Posted by crazyguymgd on 10 January 2013 - 11:09 AM in Ask a Pro

Why is he only turning right if c is false?



#71915 How to update turtles

Posted by crazyguymgd on 10 January 2013 - 11:11 AM in Ask a Pro

If you're in single player you can go to your save folder on your actual computer and put the program you want on each cc computer that way.



#71922 Detecting Disk?

Posted by crazyguymgd on 10 January 2013 - 11:17 AM in Ask a Pro

shell.run("cd disk")

I think that's what you're looking for.



#71924 How to update turtles

Posted by crazyguymgd on 10 January 2013 - 11:18 AM in Ask a Pro

View Postzekesonxx, on 10 January 2013 - 11:12 AM, said:

You could use rednet to send the file to all the turtles.

Wouldn't you still have to go to every turtle and tell it to accept the rednet message and save the file?



#71926 [lua] turtle compare statements not working as expected

Posted by crazyguymgd on 10 January 2013 - 11:20 AM in Ask a Pro

it's turtle.detect() not turtle.detect
hopefully that's your only problem



#71929 Detecting Disk?

Posted by crazyguymgd on 10 January 2013 - 11:21 AM in Ask a Pro

 ViextraProgramming, on 10 January 2013 - 11:20 AM, said:

 crazyguymgd, on 10 January 2013 - 11:17 AM, said:

shell.run("cd disk")

I think that's what you're looking for.
Thanks!

Good thing I'm bored today and like programming problems :P



#71930 [Lua][Question] Storing Functions in a Table

Posted by crazyguymgd on 10 January 2013 - 11:23 AM in Ask a Pro

View PostChunLing, on 10 January 2013 - 11:01 AM, said:

And the actual storing of the functions in a table means that you can call them using variables, which is a bit more difficult if you don't have them in a table.

Like:
funcName = read()
if turtle[funcName] then turtle[funcName]() end
There, now I can use user input to decide which turtle function to call, cause they are all in a table (and indexed by strings).

Well that is incredibly useful for a project I'm working on :)



#71938 How to update turtles

Posted by crazyguymgd on 10 January 2013 - 11:32 AM in Ask a Pro

That still takes 65 commands. 1 per turtle saying rednet.receive() and then another on the host comp saying rednet.broadcast(pastbin blah blah).



#71941 INPUT NEEDED - Spam

Posted by crazyguymgd on 10 January 2013 - 11:34 AM in Forum Discussion

View Postzekesonxx, on 10 January 2013 - 11:31 AM, said:

What about http://areyouahuman.com/? They've worked pretty well in my creations.

Ha that was kind of fun too.



#71949 Could someone help me with RedNet?

Posted by crazyguymgd on 10 January 2013 - 11:40 AM in Ask a Pro

Are you asking someone to write the code for you because it's too much programming for the simple user?



#71955 Could someone help me with RedNet?

Posted by crazyguymgd on 10 January 2013 - 11:50 AM in Ask a Pro

while true do
  message = rednet.receive()
  print(message)
  response = read()
  rednet.broadcast(response)
end

Is a simple get message, send message loop.



#71961 How to update turtles

Posted by crazyguymgd on 10 January 2013 - 12:00 PM in Ask a Pro

There is no way to send a file to all computers built in with no effort on your part. If you only need to do this once, stop being lazy and go around to every turtle and pastbin in the program. If you want to be able to update them all again, either go around to all 64 again or work on some of the suggested solutions above.
Short answer, stop being lazy :)



#71968 [Turtle][Programming] Trouble with a variable

Posted by crazyguymgd on 10 January 2013 - 12:05 PM in Ask a Pro

vx, vy, and vz are only accessible inside the scope they are initialize. An if, end block is it's own scope so you will only be able to access the variable inside that if,end block.