Jump to content


floppyjack's Content

There have been 19 items by floppyjack (Search limited from 29-March 23)


By content type

See this member's

Sort by                Order  

#142637 Word Association

Posted by floppyjack on 31 August 2013 - 01:32 PM in Forum Games

Music



#143341 Ask A Pro Renewal Project (and How You Can Help!)

Posted by floppyjack on 03 September 2013 - 01:59 PM in Ask a Pro

I think it would be good to mention in a related tutorial that it is possible to use an external editor.



#143346 Mining Turtle to dump cobble, dirt?

Posted by floppyjack on 03 September 2013 - 02:20 PM in Ask a Pro

You actually don't need to compare anything. If you select slot 1, the items will always be put into the first slot that they can go into, just like shift-clicking the item in the turtle's inventory. Before or after digging, you just check if the junk-slots are close to full and drop all the items but one per junk-slot:
turtle.select(1)
turtle.dig()
for slot = 1, 4 do -- junk-slots are slots 1 through 4
  if turtle.getItemSpace(slot) < 5 then
	turtle.select(slot)
	turtle.drop(turtle.getItemCount(slot) - 1)
  end
end
I hope this helps.



#142194 Vi/Vim-like editor for computers.

Posted by floppyjack on 29 August 2013 - 04:34 AM in Ask a Pro

 Last1Here, on 20 August 2013 - 03:57 PM, said:

taco is a pretty good one here, but nothing beats notepad++ and just pastebining it

I think using vim running in a bash terminal on linux and patebining it is better.
(Just what I prefer)



#142522 error mounting lua/rom.

Posted by floppyjack on 31 August 2013 - 06:52 AM in Ask a Pro

Did you unzip the mod before putting it into the mods folder?
If yes, just put the zipped version in there.



#142108 Mining Turtle Persistence (No Gps)

Posted by floppyjack on 28 August 2013 - 02:32 PM in Ask a Pro

A turn always succeeds, just found that there:
http://www.computerc...d-chunk-unload/



#142534 [Solved] Cc1.56 "atm" Accounts "if Statement" Problem

Posted by floppyjack on 31 August 2013 - 07:25 AM in Ask a Pro

 LBPHacker, on 31 August 2013 - 07:19 AM, said:

string.gmatch returns an iterator. You need string.find:
local _, _, first, second = string.find(msg, "^(%w+)&pwd=(%w+)$")

EDIT: Added ^ and $ anchors.

Just for completion:
You can use string.match instead so you don't have to throw away any variables:
local first, second = string.match(msg, "(%w+)&pwd=(%w+)")



#142564 Ignoring Command

Posted by floppyjack on 31 August 2013 - 08:45 AM in Ask a Pro

You forgot the brackets on line 80:
if turtle.detect == false then
Should be:
if turtle.detect() == false then



#142555 Ignoring Command

Posted by floppyjack on 31 August 2013 - 08:17 AM in Ask a Pro

placeright()
placeleft()
if turtle.detectUp() == true then
repback() --line 64
turtle.down()
turtle.down()
turtle.down()
os.shutdown()
end

On line 64, you call a function you didn't define before.



#142529 Too Long Without Yielding On Previously Working Code

Posted by floppyjack on 31 August 2013 - 07:12 AM in Ask a Pro

View PostCCJJSax, on 31 August 2013 - 02:40 AM, said:

I find that sleep(0) is pretty pointless ;) I would up that time and things should work fine

I just did some research & testing and it turns out that the sleep function calls coroutine.yield, so increasing the time should not make any difference.



#142347 Removing Text From A String

Posted by floppyjack on 30 August 2013 - 07:59 AM in Ask a Pro

I suggest you to read the 'String Manipulation' chapter of the Lua 5.1 Reference Manual:
http://www.lua.org/m...manual.html#5.4
Play around with the functions shown there and you should be able to come up with a solution to your problem.



#142720 How Do I Use Http Api Effectively

Posted by floppyjack on 01 September 2013 - 04:04 AM in Ask a Pro

Please also tell us what exactly you want to do.



#142558 Ignoring Conditional

Posted by floppyjack on 31 August 2013 - 08:25 AM in Ask a Pro

I suppose the conditional that doesn't work is this one:
if p == i then
The variable i is nil at this point of the program, it only has a value inside the for-loop.
After that, it has the value it has before the loop, which is nil.



#142740 Detecting A Material

Posted by floppyjack on 01 September 2013 - 06:09 AM in Ask a Pro

You can test if something is smeltable by putting it in the furnace and taking it out again before it has the chance to get consumed. Then you just check if the fuel is still there. (use cheap fuel)



#142611 Hover Mouse

Posted by floppyjack on 31 August 2013 - 11:32 AM in Ask a Pro

As far as I know, it is not possible to find out the position of the mouse without clicking.



#142342 Need help with logic problems, code is for a quarry

Posted by floppyjack on 30 August 2013 - 06:54 AM in Ask a Pro

View PostCCJJSax, on 30 August 2013 - 02:56 AM, said:

Also. one more thing. What if this runs into gravel? When putting turtle.dig() into an automatic mining program, more likely than not you'll want to do this.

In this case, it doesn't make any difference whether it is gravel-safe or not, because the turtle will have dug out every block above the one it is digging out, so there is no gravel above.

But I agree this is useful for tunneling or similar programs.



#142570 Function returns to another function

Posted by floppyjack on 31 August 2013 - 08:53 AM in Ask a Pro

 kreezxil, on 31 August 2013 - 08:18 AM, said:

I think i just learned something new here. Thanks floppyjack!
No problem! :)



#142553 Function returns to another function

Posted by floppyjack on 31 August 2013 - 08:12 AM in Ask a Pro

What you need to do is the following:
newy = 10
tCords = { getCords("x,z") }   -- This puts the return values of getCords("x,z") in a table
table.insert(tCords, newy)	  -- This adds newy to the table
checkCords(unpack(tCords)) -- This unpacks the table and calls checkCords with the result

unpack(table) returns a comma-seperated list of the contents of the table.



#142349 Colors not staying when Computer reboots

Posted by floppyjack on 30 August 2013 - 08:04 AM in Ask a Pro

[Edit: I probably didn't understand your question right, ignore this post.]