Jump to content


crazyguymgd's Content

There have been 139 items by crazyguymgd (Search limited from 07-December 18)


By content type

See this member's


Sort by                Order  

#125551 Help with using a variable as a table key

Posted by crazyguymgd on 12 June 2013 - 12:33 AM in Ask a Pro

Can we see more of your code? Something must be missing somewhere before line 98.



#125322 [miscPeripherals]help with the smart helmet

Posted by crazyguymgd on 10 June 2013 - 08:04 PM in Peripheral Help and Discussion

Place a Smallnet Sender next to a computer then right click on the sender. This will create a link between you and it. On the computer type:

m = peripheral.wrap("side")
m.send("smartHelmet","message")



#80990 Fs problems...

Posted by crazyguymgd on 27 January 2013 - 05:38 PM in Ask a Pro

View PostSethShadowrider, on 27 January 2013 - 01:18 PM, said:

That was actually an error in rewriting it into the browser i'm playing multiplayer.

Ahh well zoinky was right, use r instead of a. I always look for typos first and then assume that's the problem :)



#80977 Turtle program to assist hollowing out structures (specifically natural struc...

Posted by crazyguymgd on 27 January 2013 - 04:24 PM in Ask a Pro

So to think about this, I broke up the shape of the shell into each possible case, similar to what you were asking about. These cases (without overhangs) should be:

xx
t
y1 == y2
z1 < z2
forward

 x
x
t
y1 < y2
z1 < z2
forward, up

tx
  x
y1 > y2
z1 < z2
down, forward

x
xt
y1 < y2
z1 == z2
up

tx
 x
y1 > y2
z1 == z2
down

If I think of any others, I'll add them and if I think of any mistakes, I'll fix them. But from what you say you've done so far, I think you might be able to figure out how to use these rules to get the turtle to traverse the inside of the shell. If not, I'm working on testing this right now because I think this is a pretty cool problem so I can help you out based on what I discover in my tests.



#80897 Fs problems...

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

View PostSethShadowrider, on 27 January 2013 - 10:48 AM, said:

That worked great but now i'm back at square one. When I attempt to execute this code I get the error attempted to index nil
local sName = fs.open("newAcc", "a")
local spName = sNAme.readLine()
sName.close()
print("Welcome"..spName)
is there any fix for this?

second line you have sNAme instead of sName



#80667 Read Certain File Areas?

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

View PostTheOriginalBIT, on 26 January 2013 - 04:07 PM, said:

View Postcrazyguymgd, on 26 January 2013 - 04:05 PM, said:

Although I would probably use two unique variable names instead of line twice :P
Yeh probs, wrote this when I just woke up and forgot that I did that :P

Scope means it should work, but for readability its better to name them differently.

Haha yeah I just wanted to say something since you pointed out my error in another topic :)



#80665 Read Certain File Areas?

Posted by crazyguymgd on 26 January 2013 - 04:05 PM in Ask a Pro

View PostTheOriginalBIT, on 26 January 2013 - 03:12 PM, said:

If you mean say extracting a particular line then you could do something like this
local function readLine( path, line )
  local handle = fs.open( path, "r" )
  local line
  for i = 1, line do
	line = handle.readLine()
  end
  handle.close()
  return line
end
obviously this could be modified to ignore particular lines too. or you could modify it to read a subset of lines, but they would need to go into a table.

Although I would probably use two unique variable names instead of line twice :P



#80664 Then is there, but it still gives me errors

Posted by crazyguymgd on 26 January 2013 - 04:01 PM in Ask a Pro

View PostTheOriginalBIT, on 26 January 2013 - 03:54 PM, said:

View Postcrazyguymgd, on 26 January 2013 - 03:44 PM, said:

you also probably want to use elseif when you have more than one if statement. Example:

if input == "home" do
  welcomeS()
elseif input == "RA" do
  redstoneAct()
elseif input == "exit" do
  exit()
end

Same thing for all of your if's and the else's with a condition after them in the rest of your code.
You might want to fix your own bugs here

if ... do ? o.O I think you mean if ... then

Dam thanks for the catch. My point still stands though, use ifelse!



#80663 Computer is displaying invalid thing.

Posted by crazyguymgd on 26 January 2013 - 03:59 PM in Ask a Pro

View PostP4isHere., on 26 January 2013 - 03:45 PM, said:

Ok,That will be a little to advanced to me...But how about the missing top line?

It might seem a little too advanced but this is the direction you should be going. Learning to use tables will dramatically increase the quality of your programs.

And the missing top line is a typo, as TheOriginalBIT said



#80661 SelectOS v.1.4.4 Alpha [ Colours ] [ Programs ]

Posted by crazyguymgd on 26 January 2013 - 03:54 PM in Operating Systems

Well I'm not exactly interested in working on developing this project with you, I do always like helping people solve problems. So if you have any specific problems that you come across during development, post them here and I'd be happy to take a look.



#80657 Then is there, but it still gives me errors

Posted by crazyguymgd on 26 January 2013 - 03:44 PM in Ask a Pro

you also probably want to use elseif when you have more than one if statement. Example:

if input == "home" then
  welcomeS()
elseif input == "RA" then
  redstoneAct()
elseif input == "exit" then
  exit()
end

Same thing for all of your if's and the else's with a condition after them in the rest of your code.

--Edit fixed my own dam typos.



#77463 [1.3?][SMP]Turtle - turtle.drop() causes items to duplicate.

Posted by crazyguymgd on 20 January 2013 - 08:54 AM in Bugs

The "latest" version of tekkit does not use the latest version of ComputerCraft. And there is no point in looking into bugs in the old versions if they are not happening in the newest version.



#77461 Selecting problem

Posted by crazyguymgd on 20 January 2013 - 08:48 AM in Ask a Pro

View Postmibac138, on 20 January 2013 - 08:34 AM, said:

So, i think this code (below) is the best ;)

local function blockbelow()
  slot = 1
  while turtle.getItemCount(slot) == 0 do
						slot = slot + 1
						turtle.select(slot)
  end
  turtle.placeDown()
end

@Edit Or no the best code :X

If the inventory is empty, slot will increase until it's 17, then you will try to select slot 17 and cause an error. So before selecting slot, check if it is 17 and call a go back and get items from chest function or something like that.



#77385 Rednet messenger

Posted by crazyguymgd on 20 January 2013 - 06:44 AM in Ask a Pro

Then you have to parse the resulting string at the sender.



#77194 Disks

Posted by crazyguymgd on 19 January 2013 - 11:55 PM in Ask a Pro

well that's interesting because http://computercraft.info/wiki/Fs_(API) doesn't list fs.close() at all.



#77186 Disks

Posted by crazyguymgd on 19 January 2013 - 11:47 PM in Ask a Pro

View PostTheOriginalBIT, on 19 January 2013 - 11:43 PM, said:

View Postcrazyguymgd, on 19 January 2013 - 11:36 PM, said:

The wiki states, in the fs.open page that the supported modes are "w", "r", "a", and "b" so there would be no need to update the wiki...
I meant this page http://computercraft.info/wiki/IO_(API)
Ahhh, well that page definitely needs to have some info (given that there is none on that page), but the wiki page about the fs api is pretty good.



#77180 Disks

Posted by crazyguymgd on 19 January 2013 - 11:36 PM in Ask a Pro

The wiki states, in the fs.open page that the supported modes are "w", "r", "a", and "b" so there would be no need to update the wiki...



#77179 Error for print

Posted by crazyguymgd on 19 January 2013 - 11:31 PM in Ask a Pro

the error you are getting might be from something else. The code you posted works fine. So...

View PostTheOriginalBIT, on 19 January 2013 - 11:25 PM, said:

what is the exact error?



#77172 Disks

Posted by crazyguymgd on 19 January 2013 - 11:20 PM in Ask a Pro

View PostTheOriginalBIT, on 19 January 2013 - 08:27 PM, said:

View Postgrand_mind1, on 19 January 2013 - 08:22 PM, said:

Apparently "w+" is an unsupported mode.
Odd I could have sworn I used it the other day... Just use "w" then and try to keep the file open for as little time as possible ( meaning get a string ready with the data your going to write, then open, write and close ) ;)
Yeah w+ isn't supported in cc. But like TheOriginalBIT said here, store the data that is already in the file, then write whatever information from the original file and what you want to add as quickly as possible so you minimize the probability of losing data due to two computers/turtles accessing the same file at the same time.



#76599 Minesweeper v1.7! (advanced computer/monitor only)

Posted by crazyguymgd on 18 January 2013 - 08:43 PM in Games

Very cool. Add me to the list of people who have now removed "Make minesweeper" from the list of things to do.



#76594 Your preferred server hosting solution (Non-minecraft)

Posted by crazyguymgd on 18 January 2013 - 08:39 PM in General

View Postzekesonxx, on 18 January 2013 - 11:47 AM, said:

Let us know what you ultimately end up with. I'd (personally) love to know.

Should find out tomorrow what my sponsors choose.

View PostTipTricky, on 18 January 2013 - 06:04 PM, said:

Id like to know what your plans for the project are as well.

What would you like to know?



#75801 Your preferred server hosting solution (Non-minecraft)

Posted by crazyguymgd on 17 January 2013 - 12:15 PM in General

Thanks for the responses guys! I will be pitching my suggestions to my project sponsors this week and they will make the final decision. Dissy, I hope you don't mind me showing them your linode review (now a part of a collection of linode fan reviews).
I also added RamNode to the list just a few hours before reading your response zekesonxx so it's nice to know there is support in that direction as well.
Once the decision is made on who we use, I will be doing most of the setup on my own but I'm sure there will be many questions, which I will post in this thread.
Thanks again guys.



#75546 [1.48] YellowSquare Game

Posted by crazyguymgd on 16 January 2013 - 10:40 PM in Programs

View PostRunasSudo, on 16 January 2013 - 09:24 PM, said:

View PostmrSLIMEguy, on 16 January 2013 - 09:11 PM, said:

Well i tried, but i couldnt get it to work.... :P/>/>
table.insert(tableOfOldSquares, {newSquareX, newSquareY})

-- Later (in a generate-square-coordinate fuction)

while true do
  -- Generate newSquareX, newSquareY
  for i = 1, #tableOfOldSquares do
	local oldPos = tableOfOldSquares[i]
	if oldPos[1] ~= newSquareX or oldPos[2] ~= newSquareY
	  return newSquareX, newSquareY
	end
  end
end
It just keeps generating squares until one of them is different. You might run into problems when the board is full though.

Exactly what I wanted. New pastebin to try that part out?



#75523 Your preferred server hosting solution (Non-minecraft)

Posted by crazyguymgd on 16 January 2013 - 08:58 PM in General

So I figured you all would be a good place to get input from on this subject. I'm trying to find a good hosting company for a school project I'm working on. We're going to have multiple MySQL databases and we're using CherryPy for our framework. I was pointed in the direction of linode.com but was wondering if any of you have any input. Thanks in advance.



#74687 Create an OS tutorial

Posted by crazyguymgd on 15 January 2013 - 07:47 AM in Ask a Pro

NitrogenFingers did a pretty good menu tutorial that I thought was quite helpful with my first menus.
It's a two part series, here's the first one.