Jump to content


1337patchy's Content

There have been 15 items by 1337patchy (Search limited from 19-September 20)


By content type

See this member's

Sort by                Order  

#95476 OpenCCSensors programming help

Posted by 1337patchy on 10 March 2013 - 11:34 AM in Ask a Pro

Thanks all, I am no Pro at this. Will take a look at it now, Appreciate everyone's help, will report soon.



#94465 OpenCCSensors programming help

Posted by 1337patchy on 08 March 2013 - 12:28 PM in Ask a Pro

Title: OpenCCSensors programming help

Hello everyone.
Unfortunately I cannot find documentation about this.
I would like to have a code which would retrieve info from the world sensor, such as the weather and the time of the day. Also light level if possible.
But I just can not find documents which tell us how to code in order to operate the sensors, I have no idea how to start, or what to write in the code.
A little help or a heads up please, thank you in advance! ;)



#24364 [LUA] Time check

Posted by 1337patchy on 07 August 2012 - 07:42 PM in Ask a Pro

You good sir, are a genius may i say!



#24141 [LUA] Time check

Posted by 1337patchy on 06 August 2012 - 10:58 PM in Ask a Pro

local function setAlarm()
  local time = os.time()
  if time >= 8 and time < 17 then
	rs.setOutput(side, false)
	alarm = os.setAlarm(17)
	print("Alarm set for 17")
  else
repeat
	rs.setOutput(side, true)
	sleep(2)
	rs.setOutput(side, false)
	sleep(2)
	alarm = os.setAlarm(8)
	print("Alarm set for 8")
until time == 8
  end
end

Alright, this is an edited code of the above posted by MysticT, and it works partially, when its night it executes the night command, it sends redstone signal, stops for 2 seconds, sends again, all ok, but it doesnt get out of that loop once its day, ive tried every kind of things in the until, and i cant get it to stop pulsing when its day...
any help?



#23576 [HELP] Monitor connection..

Posted by 1337patchy on 04 August 2012 - 10:03 PM in Ask a Pro

Thanks once again mate :P/>
Works as a charm!



#23567 [HELP] Monitor connection..

Posted by 1337patchy on 04 August 2012 - 09:29 PM in Ask a Pro

Hey :P/> I have a program that runs on startup, to display some info as follows
repeat
print("yada")
sleep(0.3)
print("lol")
x=3
until x==10

for example ;)/> i can use monitor front startup, but i would like the program to display into the monitor directly when the pc starts, so that i dont have to manually run the monitor after the server is restarted, so the connection to the monitor has to be inbuilt in the startup program..but why
i have this at top (before the repeat line):
local mon = peripheral.wrap("front")
if not mon then
print("error")
else
mon.clear()
end
and i tried replacing the print("yada") lines, to mon.write("yada") for example, but it only writes the first line, only executes what is before the sleep(0.3) :(/> Anyone can help me at this?



#18139 [LUA] Time check

Posted by 1337patchy on 07 July 2012 - 12:11 AM in Ask a Pro

Thanks a lot Mystic :)/>
This worked, pretty much appreciated. Hope one day il know half of what you know lua related :P/>



#18127 [LUA] Time check

Posted by 1337patchy on 06 July 2012 - 11:36 PM in Ask a Pro

Oh lol didnt even notice, was just too soaked up on the code., but i have now tried your code and it doesnt work :s i mean the program does not time out but it does not power the redstone :/
The final part on your code, which you have commented, i inserted into the code btw.



#18116 [LUA] Time check

Posted by 1337patchy on 06 July 2012 - 11:17 PM in Ask a Pro

Thanks archit and luagod :P/>
Really mind clearing! THanks you guys, nice to know people help :)/>



#18109 [LUA] Time check

Posted by 1337patchy on 06 July 2012 - 10:37 PM in Ask a Pro

Thank you Lua god.
Allow me to ask, what exactly is os.pullEvent, never got that one correctly, what is its function and utility. So alarms are like..uhm..a.wait for it! As in when this value kicks in..do something?
I have another doubt. what is the local evt, arg ? You define alarm as os.setAlarm, so i guess this local evt, arg line is to cross check the time and alarm values, but i dont really see how that happens
Would you mind helping me dissipate those doubts? thanks :P/>



#18099 [LUA] Time check

Posted by 1337patchy on 06 July 2012 - 09:57 PM in Ask a Pro

Hey there people, how can i make a code that,
while os.time() >= 17 or os.time() <= 8 do
 rs.setOutput("back", true)
else
 rs.setOutput("back", false)
end
That keeps looping, instead of ending, so that i run the program once, and it will always check the time, and each day, at 17, it will trigger redstone power, and at 8 it will stop emitting redstone power
Thanks in advance!



#17959 [LUA] Need help, and operator!

Posted by 1337patchy on 05 July 2012 - 10:29 PM in Ask a Pro

Hello, thank you for your reply. I continued trying even after posting, and i did try that, but i got an error, trying to compare string and number, got string or so. Then i put the 8 and 17 in quotes, and it considered it was night.. I removed the quotes and the "time = textutils.formatTime(time, true)" line..
Now it works :P/>
Thanks though!


EDIT: Posted too late, as mentioned above, thats right :)/> Thanks all but thankfully i managed to get there on my own, i keep on trying even after asking for help. Thanks a lot!



#17956 [LUA] Need help, and operator!

Posted by 1337patchy on 05 July 2012 - 10:19 PM in Ask a Pro

local time = os.time()
time = textutils.formatTime(time, true)
local side = "left"
term.clear()
term.setCursorPos(1,1)
print("Time: "..time)
if time >=8 and <=17 then
rs.setOutput(side, true)
print("Livestock acess granted")
sleep(2)
os.shutdown()
else
print("Unsafe at night!, return later!")
os.shutdown()
end

Hello :P/> I get a problem on the line "if time >=8 and <=17 then" saying i get an unepexted symbol :s
I really dont know how to get rid of the error and make the program work, any help please?



#17580 [LUA][Question] How to make Floppy startup check hdd startup

Posted by 1337patchy on 03 July 2012 - 06:54 PM in Ask a Pro

Thank you everyone for the help, appreciate it much.
I ended up finding a way to do it myself, I made the floppy check os.computerID()
as in
local a = os.computerID()
if a == 5 then
(code to open door)
else
(code to say invalid blabla)
end

:P/> thats how i did it hehehe
thanks for everyone's help though!



#17532 [LUA][Question] How to make Floppy startup check hdd startup

Posted by 1337patchy on 02 July 2012 - 09:29 PM in Ask a Pro

Hello guys, i have followed the wiki tutorial on the password door, and i have the local password variable set with the password i want, everything is great, it works if i boot the computer.
But i want to use a floppy as a key, so, this is the code i have on the floppy's startup
if password == "my password" then
rs.SetOutput("back", true)
sleep(3)
rs.SetOutput("back", false)
else
end

How do i, however, make it so that the floppy's code (one above), can check the hdd's startup code
and get the value of its password variable, and if it matches with the one in the floppy,
the door opens. So i can unlock either with floppy, or without it, using password.
I know i need something above if password == "my password" then, so that it knows where local password is defined..but i dont know how to make it so that it checks the startup on the hdd
I would appreciate help on the subject
thank you in advance :P/>