- Sky
- Blueberry
- Slate
- Blackcurrant
- Watermelon
- Strawberry
- Orange
- Banana
- Apple
- Emerald
- Chocolate
- Charcoal
nezd
-
Content Count
18 -
Joined
-
Last visited
Posts posted by nezd
-
-
First, learn some english.
Then, RTFM again.
-
About code compression;
The only way I see to remove spaces from code in places like while, function, etc.
Any other ideas?
-
OctoTapeFS v0.1
Slowest way to store your files
Do you remember this days when your commodore loads software from tape? I don't, i weren't even born when commodore were popular.
Well, now you could bring this days back with OctoTapeFS - The slowest way to store your files!
Possible arguments:
- -h Displays help message
- --save=path Save file from path to tape
- -l Loads file from tape
- --dump=path Save file from tape to path
- -v Toggle verbosity
- -f Disable waiting for user input in load
TODO:
- Code compression(removing spaces)
- Make it faster
- Adding a file structure
-
Oops - my fault
-
Hm. This looks like a bug in OpenOS - cause when i upload this program to EEPROM it works normally
-
After some fast googling, I find that 116 is F5 key
-
Maybe something with hash?
-
Hi!
Here is key button receiver code:
type, _, char, _ = computer.pullSignal() --Receiving input while true do if type = "key_up" then print(char) end end
And here is problem: when I dont touch keyboard it prints 116
-
You forgot to specify the direction in a functions swing() and compare()
Ðnd the robot can not move to the sides 4 and 5, for this it is necessary to turn to left/right.
What do you mean about sides 4 and 5? There is no code thats moves it to this sides.
-
Hi!(again)
My program for robot(flashed in eeprom) dont work and causes error i typed in topic title.
Here is the code:
robot = component.proxy(component.list("robot")()) rs = component.proxy(component.list("redstone")()) function getBatteryPercent () local percent = computer.energy() * 100 / computer.maxEnergy() return percent end function wait(seconds) local begin = os.time() repeat computer.pullSignal(0.05) until os.time() - begin >= seconds end while true do robot.turn(true) robot.turn(true) robot.move(1) while robot.compare() ~= true do robot.move(3) if robot.detect(5) == true then robot.turn(false) robot.swing() robot.turn(true) end if robot.detect(4) == true then robot.turn(true) robot.swing() robot.turn(false) end end robot.turn(true) robot.move(0) robot.turn(true) while true do if redstone.getInput(1) > 0 then if getBatteryPercent() < 20.0 then rs.setOutput(0, 15) else rs.setOutput(0, 0) end wait(60) else robot.move(3) end end end
-
My code crashes with this reason:too long without yielding.
How to fix this?
Here is code:
red = component.proxy(component.list("redstone")()) local bottom = 0 local back = 2 function wait(seconds) local start = os.time() repeat until os.time() > start + seconds end while true do if red.getInput(bottom) > 0 then wait(50) red.setOutput(back, 15) wait(5) else red.setOutput(back, 0) end end
-
What do you type when you are prompted for an address?
print("Type address") adr = io.read()
Adress of PC, which i get using analyzer
-
Receiver works only if i replace send to broadcast.
-
The receiving computer must specify a port to open. It can the get messages over that port.
require("component").modem.open(1)
-
Here is receiver program:
event = require("event") require("component").modem.open(1) function receive () while true do local eventData = { event.pull() } if eventData[1] == "modem_message" then local message = eventData[6] local port = eventData[4] local adress = eventData[3] return message, port, adress end end end while true do local m, p, a = receive() print(p) end
And here is sender program:
m = require("component").modem print("Type address") adr = io.read() print("Type message") msg = io.read() if m.send(adr, 1, msg) == true then print("Message sended succesfully") else print("Error occured") computer.beep(500) os.sleep(0.5) computer.beep(500) end
And the problem: receiver receives only broadcast messages.
I use wireless card on tablet and on PC
-
process.load(path:string[, env:table[, init:function[, name:string]]]):coroutine
Loads a Lua script from the specified absolute path and sets it up as a process.
It will be loaded with a custom environment, to avoid cluttering the callers/global environment. This environment will have access to anything in the specified environment, or the default (top level) environment if none is given.
(since OpenOS 1.6) path can also be a function, in which case env must be nil.
If an init function is specified, that method is called the first time the resulting coroutine is executed, and run before the actual program is started. This allows fine-tuning of the programs environment.
If a name is specified, that is the name the process will specify in process.running. It will be nil otherwise.
-
Hi there. My program exits for no reason when function settingsentrence() is called.
Here is the code:http://pastebin.com/B2czP4aJ
hallo again i fink this not the spot to make like a help me plese post but my computers can't show colors
in Programming
Posted
Also, wrong section. Post questions here