Jump to content


OmegaVest's Content

There have been 236 items by OmegaVest (Search limited from 10-February 22)


By content type

See this member's


Sort by                Order  

#144399 Tank Read And Redstone.setoutput Problem

Posted by OmegaVest on 11 September 2013 - 02:45 PM in Ask a Pro

You initialize tableInfo outside the while loop. So it will always check the same result, instead of getting a new result. Move tableInfo = valve.getTanks("unknown") in to the while loop.



#143475 Using redstone signal to start program

Posted by OmegaVest on 04 September 2013 - 12:24 PM in Ask a Pro

The easiest way would be to include a massive while loop with an event pull that would look for redstone only, then fire the rest of the program.
ie
while true do
  evt, arg1 = os.pullEvent("redstone")
  if rs.getInput(side) then
    -- Program
  end
end

However, I get the sense that you also want this turtle to run other functions as well. Unfortunately, that is not so simple. And the above only works for up to six functions at a time (supposing no peripherals). But, this should give you a starting place, at least.



#140567 Where Should I Find Lists Of Different Api's?

Posted by OmegaVest on 18 August 2013 - 02:09 AM in Ask a Pro

When you are on the computer, you can type "apis" into the command line interface to find a list of all loaded apis. If you use help <api>, you can get some basic information about those apis. And monitor is a peripheral api, which I don't really remember if it can be used that way. . . Otherwise, you can look at the Monitor wiki page for the api.

And, for the wiki api list, it is complete except for the peripheral apis, which are linked to from the peripheral api page.



#140504 Help with Iron Tank Level showing on Monitor

Posted by OmegaVest on 17 August 2013 - 06:19 PM in Ask a Pro

... I wasn't entirely sure that worked. But, supposing it does, you can find out what functions a particular peripheral has by using the following:

m = peripheral.wrap(side or name) -- either the side of the computer, or the name of the remote peripheral, in this case "iron_tank_valve_0"
for k, v in pairs(m) do
  print(k)
end

And that will print out what the peripheral can do (if anything).



#139800 Computer Clock Speed

Posted by OmegaVest on 13 August 2013 - 01:39 PM in Ask a Pro

All of the relevant information and discussion is here, which was asked about. . . four days ago I think.


To shorten: it really depends on tick rate and how many computers you have running in one world.



#139335 Getting Sides On Which Peripherals Are

Posted by OmegaVest on 10 August 2013 - 09:30 PM in Ask a Pro

http://www.computerc...eripheral_(API)

sPeriph = peripheral.getType(side).
print(sPeriph)



#138723 <Solved> Accessing Turtle Functions In _G

Posted by OmegaVest on 07 August 2013 - 03:39 PM in Ask a Pro

...You can do that much more simply just using the turtle API.

runCmd(cmd)  -- Assuming that cmd is a valid function name, not an alias.
  print("rc: ", cmd)
  turtle[cmd]()
end

Should work, really. If you are set on using _G, it should still work this way, I think. I don't really deal with the Global Table directly, though, because, frankly, it's usually called for you anyway. Just typing out a variable name (so far as I know, which isn't all that far) should assume _G.<whatever you are calling>.



#133953 [Help/Questin] API calling a function outside itself

Posted by OmegaVest on 16 July 2013 - 04:46 PM in Ask a Pro

Uh, no. But you can make the API require that function. Just put "update" as a variable, and if it doesn't exist, error. If it does exist, then you can call "update()".

EDIT: At least, I think you can do this. It's been a while since I tried something this. . . complex.



#119832 Get turtle coords

Posted by OmegaVest on 22 May 2013 - 03:43 PM in Suggestions

Or, you could use the included software to make your own GPS system. It won't cover the whole plane, which is probably what you are looking for. But, with enough resources, you can, in fact, cover most of the traversable world with gps terminals. Place them up high (like satellites) to make their ranges bigger, and reach even bedrock with little trouble, and in a fair radius.


EDIT: Damn, just too slow.



#118404 bios:338: [string "wood.txt"]:39: 'end' expected

Posted by OmegaVest on 17 May 2013 - 09:49 AM in Ask a Pro

function func(param)
  while true do
	if not true then
	  -- Comment
	elseif blue then
	  -- New Comment
	else
	  -- Last Comment
	end
  end
end


Make sure you have enough ends for the function, loop and if blocks you open. Presently you have just nested all of the following functions into fixaFuel.



#116923 monitors flashing different colors for teleport

Posted by OmegaVest on 11 May 2013 - 01:01 AM in Ask a Pro

Actually, using monitor_4 is correct for a wired modem connection. Since grabbing "top" would grab the modem(were that the side the wire was on), you have to use its name as the side. Everything else was right in Zoinky's post.



#112815 Command block peripheral & iterator for loop

Posted by OmegaVest on 21 April 2013 - 05:25 PM in Ask a Pro

Hmm. Well, for the first one, I have no idea. Unless you are playing on a server which does not have the option enabled.
The second one, though, is the use of tostring.
This would be slightly better:
   print(event, " " , param1, " " , param2, " ", param3)

Or just put it into writes.



#109499 I need some help, concerning tables.

Posted by OmegaVest on 13 April 2013 - 06:58 AM in Ask a Pro

You could define them whenever you change i. Last time I did something like this, that worked, but I think you probably will have to define them beforehand, just as you have to define saveInfo as a table beforehand.

Although, if you already have the data stored as a table, you can pass the table, whole, to a specific index, and it should work that way as well.



#109493 Wireless communication without modems?

Posted by OmegaVest on 13 April 2013 - 06:25 AM in Ask a Pro

They can't go through portals. It's like piston semi-blocks.

Also, if you are using Misc. Peripherals (and I'm assuming you are, since you appear to be using the DW20 pack), I think the chunk loader turtles actually have modems on them. Wrap the loader peripheral and see what it brings ups when you
for k, v in pairs(peripheral.wrap(side)) do
   print(k)
end

Actually, I know that the Misc. Peripherals chunk loader peripheral DOES work as a modem. It says so in the thread.



#108825 Simple Programs with Turtle

Posted by OmegaVest on 11 April 2013 - 09:02 AM in Ask a Pro

Assuming the program just goes 1 above the maximum height, heig needs to be 1.

Also, though using modulous works, I find that using a boolean sometimes works more reliably, though that may just be too few samples. It might increase your code length, too.



#107194 How do I get my turtle to go right after going left last time

Posted by OmegaVest on 07 April 2013 - 11:29 AM in Ask a Pro

Because what you want is x%2 == 0 or not. %, or modulus, is just an operator like + or *.

As you have it written, it's just always true, therefore it is always left.



#107193 Inverted Redstone signal

Posted by OmegaVest on 07 April 2013 - 11:26 AM in Ask a Pro

local on = false  -- So we'll know whether to fire the pulse or not.'

local function doTime  -- The pulse
  rs.setOutput("right", true)
  sleep(0.2)
  rs.setOutput("right", false)
end

while true do
  local tmr = os.startTimer(2.0)  -- Make a timer for 2 seconds

  local evt, arg1, arg2 = os.pullEvent()  -- Catch-all for our functions
  if evt == "redstone" then
	if rs.getInput("left") then  -- If left is on
	  on = true
	else  -- Or not.
	  on = false
	end
  elseif evt == "timer" and arg1 == tmr and on then
	doTime()
  end
end


And I did that in about a minute, give or take typing speed.



#106368 Graphical printers

Posted by OmegaVest on 05 April 2013 - 09:48 AM in Suggestions

Given how advanced computers are handled, I think it would be a more "in-line" implementation to be able to switch between (or have separate function for) outline and write on printers. Outline would surround the letter in color, so using a space would produce a solid block. Write would work as it does now.

And for color, guess what, my first printer had only one ink cartridge, and to make color my family had to swap out one cartridge for another and print in mattes. This was on a Windows 3.1.1 computer, as well.



#106356 then expected when already have then in the function!?!

Posted by OmegaVest on 05 April 2013 - 09:36 AM in Ask a Pro

EDIT: Wow I type slow. Ignore this.



#106353 Can someone help me out?

Posted by OmegaVest on 05 April 2013 - 09:33 AM in Ask a Pro

Actually, the easiest(or most useful) way to center input is to make your own read function that uses chars or keys and an pullEvent loop. Everything else is either imperfect or destroys whatever GUI you happen to have.

And, for new lines, yeah, setCursorPos is the only alternative. For whatever reason escape characters don't always work with term.write. Or any write, for that matter.



#106349 OpenCCSensors and Tanks

Posted by OmegaVest on 05 April 2013 - 09:27 AM in Ask a Pro

EDIT:
Ignore anything you might have read here before. I'd ask this particular reply removed, but it would be a waste, because I might have some help in a moment.



#100667 1.4.8 how do you set monitor text bigger

Posted by OmegaVest on 23 March 2013 - 02:05 PM in Ask a Pro

I think he means CC1.48 Mr. Literal.



#100555 Creating a Call Elevator Function as part of an ElevatorAPI

Posted by OmegaVest on 23 March 2013 - 07:41 AM in Ask a Pro

Hmm. Well, you could always make it so that the computers send a rednet signal with their floor number when the elevator hits/passes their floor. When you want to call, compare the last received signal with the desired one, and determine how to move.

ie.
thisFloor = 1
atFloor = 1
floorDiff = 4

while true do
  evt, arg1, arg2, arg3 = os.pullEvent()
  if evt == key and arg1 == keys.c then
    if atFloor == thisFloor then
      print("Already at this floor, cannot call.")
    elseif atFloor > thisFloor then
      targer = atFloor - thisFloor
      targer = targer*floorDiff
      for i = 1, targer do
        moveDown()
      end
    elseif atFloor < thisFloor then
      targer = thisFloor - atFloor
      targer = targer*floorDiff
      for i = 1, targer do
        moveUp()
      end
    end
    rednet.broadcast("elev "..tosrting(thisFloor))  -- I think the tostring works here, can't remember.
  end
end

And, of course, you'd have to figure out how to tell if the elevator would know if it reached its floor. a torch would probably work, just make the computer look for the torch's signal to reach it.

Lastly, the above code is only an example. I have no idea if it would work, and I would suggest you only use it as an outline at best.



#100548 1.4.8 how do you set monitor text bigger

Posted by OmegaVest on 23 March 2013 - 07:30 AM in Ask a Pro

mon = peripheral.wrap(side)
mon.setTextScale(number)

number can be anything from 0.5 to 5, where 1 is normal text scale.

From the wiki, btw.



#100142 Turtle Upgrade - Fisher & Ender

Posted by OmegaVest on 22 March 2013 - 08:24 AM in Suggestions

...Do wha-? Ah, I see what you are saying now.

Okay, so the fishing one I could see. I think RichardG's Misc. Peripherals has a fishing turtle. Or was that Aperture Science turtles? I can't remember right now.

As for ender chests: For the original mod version of the chest, it has been stated that will never happen. You can already carry a chest with you and have the turtle place it, drop everything else it's carrying into it, pick the chest back up and move on. As for the Mojang chest, there's no way to link the turtle's chest to any other, because each player has their own ender inventory. Unless the pipe interface in forge ever changes to allow for facading a turtle with a specific player's id, it will never happen. Even then, I don' t think Dan or Cloudy would do something so insecure and cheaty. I think they said they would not, actually, but I don't remember.



So in short, Fishing turtles yes, ender turtles no, because that would be ridiculous to work with, or there is a better way to do it, and a no has been shouted on it before.