Jump to content


Inumel's Content

There have been 14 items by Inumel (Search limited from 10-February 22)


By content type

See this member's

Sort by                Order  

#215778 Bit of multi-peripheral addition help.

Posted by Inumel on 29 April 2015 - 03:26 PM in Ask a Pro

View PostBomb Bloke, on 29 April 2015 - 06:50 AM, said:

Your monitor will likely have plenty of columns, so I suppose you could use those to draw a bar chart. Calculate a percentage of how full each batbox is, and draw a line from the bottom of the screen leading up X% of the way to the top.

Either that or just print an average, I suppose. Or even just "(combined energy) / (total storage)".

It was my intention to combine all of the power and show a percentage of total power out of total capacity, but I don't know how to combine the energy readings, not with how they're presented



#215760 Blood Magc LP in Altar HELP

Posted by Inumel on 29 April 2015 - 05:25 AM in Ask a Pro

View PostTormDemoniax, on 29 April 2015 - 12:32 AM, said:

Derpie me, I forgot to add the () after the tankinfo

But now, it returns me a table!

Try this.
for k,v in pairs(altar.getTankInfo()) do
   print(k,v)
end



#215759 Bit of multi-peripheral addition help.

Posted by Inumel on 29 April 2015 - 05:15 AM in Ask a Pro

I am using some delicious peripheral wrapping code provided in another post by Lyqyd
function wrapAll(type)
  local wrapped, names = {}, {}
  for _, name in ipairs(peripheral.getNames()) do
	if peripheral.getType(name) == type then
	  table.insert(names, name)
	end
  end
  for _, fn in ipairs(peripheral.getMethods(names[1])) do
	wrapped[fn] = function(...)
	  local returns = {}
	  for i = 1, #names do
		returns[i] = peripheral.call(names[i], fn, ...)
	  end
	  return returns
	end
  end
  return wrapped
end


which I am using on IC2 batboxes, batbox = wrapAll("batbox") That works all fine and dandy,

I wrote a quick thing to get its energy,
test = batbox.getEUStored()
  for k,v in pairs(test) do
   print(v)
	end
Which outputs the energy of all 24(yes, 24 batboxes) properly. The issue is, that insane amount of info is hard to display on a monitor, so i wanted to coalesce the energy outputs of each batbox, sadly I don't know how to do so in the required for loop.



Any help is of course appreciated, credit for all above code goes to LYQYD



#215356 Hacking Floppy disc

Posted by Inumel on 25 April 2015 - 01:46 AM in Ask a Pro

Malicious scripts are not helped with nor provided. But it is technically possible, yes.



#214547 Wireless Redirect concept

Posted by Inumel on 18 April 2015 - 11:25 PM in Ask a Pro

View PostCreator, on 18 April 2015 - 10:54 PM, said:

It just amused me, that's all ;)

Sorry I've been hard at work in game testing some things, I simply +1'd him because he was the first person to answer the post, is all. Nothing special :P



#214483 Wireless Redirect concept

Posted by Inumel on 18 April 2015 - 06:32 PM in Ask a Pro

Thank you Lyqyd.
And Creator, for giving me some interesting ideas.



#214461 Wireless Redirect concept

Posted by Inumel on 18 April 2015 - 05:15 PM in Ask a Pro

I have no code, I don't even know if this is possible, so hear I ask.

Is it possible to redirect the terminal via a wireless modem?

basically remote access for a computer from a pocket computer
I have not even begun testing as I don't think its possible, but I would like to hear it from the pro's.



#213891 Color-based lock system

Posted by Inumel on 14 April 2015 - 01:46 AM in Ask a Pro

Ah. It's been quite some time since I've messed with files, Thank's for the help and pointing out my derp!



#213884 Color-based lock system

Posted by Inumel on 14 April 2015 - 01:32 AM in Ask a Pro

I'm trying to make a color-based locking system, wherein you use the paint program to mark out a code using colors, which is then read by another program and used as a key.

Applying one of each color, and reading the file outside of the paint progrem i've made the key
white:0
orange:1
magenta:2
lightBlue:3
yellow:4
lightGreen:5
pink:6
grey:7
lightGrey:8
cyan:9
purple:a
blue:b
brown:c
green:d
red:e
black:f

Which is all fine.
this is my attempt at reading a file:
print("please input a file name for testing")
ftc = tostring(read())
io.open(ftc,"r")
comp = ftc:read()
ftc:close()
print(comp)
It fails at line 4: "comp = ftc:read()": attempt to call nill

Now, maybe it simply can't read the file as it was created using paint, or maybe i'm doing something horrifically incorrect, sadly I'm unsure. So here I am, and help is appreciated.



#194797 Print To Server Console

Posted by Inumel on 30 September 2014 - 03:07 PM in Ask a Pro

You can do this if you use the command block API, but it has to be enabled in the CC config, and command blocks must be enabled on the server

Info on the api is here http://computercraft...mand_Block_(API)

using the /say command should do what you want it to



#189792 Why can't I get a variable to equal another variable?

Posted by Inumel on 02 August 2014 - 04:33 AM in Ask a Pro

I know this is a bit late, but you could also do y = tonumber(read()), then just do b == y



#182045 In-game "chatroom"

Posted by Inumel on 03 June 2014 - 05:41 PM in Ask a Pro

View PostWhitecatblack, on 03 June 2014 - 05:34 PM, said:

A monitor is not a computer, it cannot do anything except display something when a computer tells it to,
It has touch screen capabilities..

here is the link to the wiki page



#180316 Program misinterpreting user input

Posted by Inumel on 24 May 2014 - 02:00 AM in Ask a Pro

View Postrealgogogoluke, on 24 May 2014 - 01:47 AM, said:

The following code asks the user a question, then does an action based on the answer. However, the code always defaults to the first choice. Why might that be happening?
os.pullEvent = os.pullEventRaw
print "FactoryOS is loading!"
sleep(3)
print "Worker or boss?"
e = read()
if e == "worker" or "Worker" then
print "Welcome Worker!"
shell.run("chat join Factory Worker"..os.getComputerID())
sleep(3)
os.reboot()
elseif e == "Boss" or e == "boss" then
print "What is the password?"
pass = read("*")
if pass == "password" then
print "Welcome Boss!"
shell.run("chat join Factory Boss"..os.getComputerID())
sleep(3)
os.reboot()
else
print "Rebooting"
sleep(3)
os.reboot()
end
end

EDIT: Found out it does work, it's just the OR command not doing what it should.

You messed up a bit on the first "or"

if e == "worker" or "Worker" then
should be
if e == "worker" or e == "Worker"
Also you can avoid using or conditionals by setting everything set by the read to lower, or upper

e = string.lower(read())
if e == "worker"

ect



#178241 Starwars Treasure Disk

Posted by Inumel on 13 May 2014 - 04:07 AM in Ask a Pro

Unless you cheated it in from NEI, as this has been a problem for people in the past. take it from a dungeon chest or creative menu