Jump to content


OczkoSX's Content

There have been 26 items by OczkoSX (Search limited from 10-February 22)


By content type

See this member's


Sort by                Order  

#180417 [MC 1.7.10 | CC 1.65] OpenCCSensors

Posted by OczkoSX on 24 May 2014 - 05:50 PM in Peripherals and Turtle Upgrades

Hi, im getting this error: http://pastebin.com/Bq9gbfxC
I'm using newest OpenCCSensors and ComputerCraft(1.63). On 1.57 version of CC i'm getting different crash log.
Can you help me?



#176581 OS windows and Multitasking

Posted by OczkoSX on 04 May 2014 - 07:29 AM in Ask a Pro

If you want to run multiple functions in one time, you can use parallel API



#176510 Restart a count after reaching a certain value?

Posted by OczkoSX on 03 May 2014 - 10:31 PM in Ask a Pro

View PostSir_Mr_Bman, on 03 May 2014 - 10:18 PM, said:

Unless I'm thinking about it wrong, couldn't you just...

for i = 1, 8 do
  -- Your code here.
  if i == 8 then
	i = 1
  end
end

No, because it will repeat 8 times, var's value is unnecessary



#176509 Saving variables for the next time the computer runs the same program?

Posted by OczkoSX on 03 May 2014 - 10:30 PM in Ask a Pro

You have to create a file, and save a variable value to it. Read about file streams (fs)



#176421 Restart a count after reaching a certain value?

Posted by OczkoSX on 03 May 2014 - 08:00 AM in Ask a Pro

You can use use:
for i=1,8 do
  -- what you want to do
end



#176253 I need help about turtle program

Posted by OczkoSX on 02 May 2014 - 11:02 AM in Ask a Pro

Hmmm, so i had not standard api :D Sry for troubles..



#176239 I need help about turtle program

Posted by OczkoSX on 02 May 2014 - 07:47 AM in Ask a Pro

If you want dig left, you have to rotate turtle. turtle.rotate(270). (I hope this function takes parametres D:)



#176238 Check if variable exists and edit problems

Posted by OczkoSX on 02 May 2014 - 07:44 AM in Ask a Pro

I said I know, just have to use
if not var then



#176148 ComputerCraft Control System with Touchpad

Posted by OczkoSX on 01 May 2014 - 07:45 PM in Ask a Pro

ComputerCraft doesn't like ProjectRed's bundled cables, only red alloy wire :<



#176089 sending rednet commands

Posted by OczkoSX on 01 May 2014 - 01:57 PM in Ask a Pro

Maybe seperate programs on turtle? One program will receive rednet signals, second will digging and third will coming back. And in receive program you can do something like this:
id, msg = rednet.receive(10)
shell.run(msg)
and from computer you can send message "dig"



#176068 Check if variable exists and edit problems

Posted by OczkoSX on 01 May 2014 - 11:29 AM in Ask a Pro

Ok, i've got it, just use not var :D



#176067 Check if variable exists and edit problems

Posted by OczkoSX on 01 May 2014 - 11:20 AM in Ask a Pro

Thank you! Is it possible to do:

if variable then
--nil
end

?

i tried ~variable but it doesnt work



#176059 Check if variable exists and edit problems

Posted by OczkoSX on 01 May 2014 - 10:41 AM in Ask a Pro

Hi! I'm doing little spam on foum, sry for that :D

How can I check if variable isnt nil ?

Here is my code: http://pastebin.com/07szXe0i

I'm saying about Tank() function.
I tried if variable == nil but it doesnt work

The second problem is terminating program
When i am in tank mode ($$tank show) and i terminate program, i cant edit it. It says: edit:60: attempt to call nil
I have to reboot PC then.

EDIT: I need checking var because i saw, when tank is empty, his liquid amount is nil, so table[1].amount is nil and program crashes



#176055 OpenPeripherals - Railcraft Tanks API

Posted by OczkoSX on 01 May 2014 - 09:33 AM in Ask a Pro

Ah my bad. I just had to do something like this:
local valve = peripheral.wrap("right")
local tableInfo = valve.getTanks("unknown")
for k, v in pairs(tableInfo) do
  for x, y in pairs(v) do
			    print(x .. ": " .. y)
  end

(code copied from other thread). I'm new on tables ;)



#176054 OpenPeripherals - Railcraft Tanks API

Posted by OczkoSX on 01 May 2014 - 09:25 AM in Ask a Pro

Hi! How can i check all methods for rc's tanks ? I did p = peipheral.wrap("bottom"), p.listMethods(), but it just print listMethods(), getAdvancedMethodsData() and TankInfo(direction). When i use these methods it prints: table: <some signs here>

Can you help me?



#175945 Events, Key & Char, can I have them at the same time?

Posted by OczkoSX on 30 April 2014 - 04:19 PM in Ask a Pro

View PostOczkoSX, on 29 April 2014 - 08:31 PM, said:

if char == '/n' then
firstly, newline characters are \n not /n
secondly, pressing enter does not queue a char event, it only queues a key event with the keys.enter key code


I said im not sure ;) And yea, i meant \n ;)



#175851 Events, Key & Char, can I have them at the same time?

Posted by OczkoSX on 29 April 2014 - 08:31 PM in Ask a Pro

I didn't understand you well, but i think you can make in loop something like this:
while true do
char = os.pullEvent("char")
if char == '/n' then
-- ENTER
else
-- ADD CHAR TO STRING WHAT INCLUDE YOUR TEXT
end

Up was first...
I don't know if you can compare char with enter sign. CometWolf's way is better then my D:

All events types you can check here: http://computercraft...ki/Os.pullEvent



#175844 Touch Monitor Problem, If is always false...

Posted by OczkoSX on 29 April 2014 - 07:31 PM in Ask a Pro

Okay, thank you all. I split this program to my previous one. You can check it here: http://pastebin.com/fhjFnBWU
One monitor is showing general infos about reactor, second is a config monitor. I'm pretty sure you don't understand it but i hope it will help somebody ;)
Please change thread title to: OczkoSX's Big Reactors troubles, and a ready Control Panel. Thanks fo all, See you :)



#175834 Touch Monitor Problem, If is always false...

Posted by OczkoSX on 29 April 2014 - 06:25 PM in Ask a Pro

Never mind, there weren't braces... getEnergyStorage()

And sorry about the threads :) I thought it will be better to seperate them. See you ;)



#175827 Touch Monitor Problem, If is always false...

Posted by OczkoSX on 29 April 2014 - 05:44 PM in Ask a Pro

View PostCometWolf, on 29 April 2014 - 05:36 PM, said:

It's because your reaktor function dosen't yield. Essentially it needs to use coroutine.yield somewhere. The most common way is to add a sleep at the top of the loop. Also note that parallel functions do not run simoultaneously, like you seem to believe.

I know it doesn't. As you can see i add a while true do loop at the beginning of these functions ;) I'm going to check reaktor function as you write. See you, and thanks for help :D

THX! It works ;)



#175821 Help with Math...

Posted by OczkoSX on 29 April 2014 - 05:11 PM in Ask a Pro

View PostLyqyd, on 29 April 2014 - 04:53 PM, said:

print(-5 / 2) -> -2.5
print(math.floor(-5 / 2 + 0.5)) -> -2

Close, but not quite.

I meant positive numbers ;) for negative you have to minus i think



#175820 Touch Monitor Problem, If is always false...

Posted by OczkoSX on 29 April 2014 - 05:09 PM in Ask a Pro

Huh -.-, i forget about it :D I upload it to pastebin but not wrote here :D Pastebin: mGEvdWs7 pP208Jqi <- little changes ;)



#175813 Help with Math...

Posted by OczkoSX on 29 April 2014 - 04:17 PM in Ask a Pro

If you want to round numbers, from 0-4 down and 5-9 up you have to just add 0.5, like:

print( 5 / 2 ) -> 2.5
print( math.floor( 5 / 2 ) ) -> 2
print( math.floor( 5 / 2 + 0.5 ) ) -> 3



#175812 Touch Monitor Problem, If is always false...

Posted by OczkoSX on 29 April 2014 - 04:14 PM in Ask a Pro

Hi, it's me again ;) I've got lilttle problems with my code. I created some functions, one of them have to check monitor, draw text, and allow to change options, second have to apply settings to the reactor IN THE SAME TIME. And that is my problem. I add on the end of code line with parallel, but when i run a program it says: parallel :22: peripheral :62: Too long without yealding. Pls help!



#175720 Touch Monitor Problem, If is always false...

Posted by OczkoSX on 28 April 2014 - 07:52 PM in Ask a Pro

Oh... Little mistake in variables' names... Thanks for your help ;)