r/ComputerCraft • • Sep 29 '21

I need help stopping a program.

5 Upvotes

Hello, I found this really cool Matrix Rain code for computercraft, pastebin here : https://pastebin.com/bXvr0vuN

When I make the program a startup the startup never ends, was wondering if someone could make it stop after a certain amount of seconds. Thanks!


r/ComputerCraft • • Dec 23 '24

I am making a server with CC tweaked, create and more.

5 Upvotes

r/ComputerCraft • • Apr 24 '25

I need help with key detection jank

2 Upvotes

The code below is a modification my program that prints text instead of it's original function since my focus is specifically the way it detects key presses

function keypress()
  keyevent, key = os.pullEvent("key")
end
function keypressup()
  keyupevent, keyup = os.pullEvent("key_up")
end

function key_a()
keypress()
  if key == keys.a then
    print("A")
  end
end

function keyup_a()
keypressup()
  if keyup == keys.a then
    print("A up")
  end
end

function key_s()
keypress()
  if key == keys.s then
    print("S")
  end
end

function keyup_s()
keypressup()
  if keyup == keys.s then
    print("S up")
  end
end

function key_d()
keypress()
  if key == keys.d then
    print("D")
  end
end

function keyup_d()
keypressup()
  if keyup == keys.d then
    print("D up")
  end
end

while true do
parallel.waitForAll(key_a,keyup_a,key_s,keyup_s,key_d,keyup_d)
end

If I press each key individually it detects them perfectly fine, but when I start combining imputs it starts bugging out.

If I quickly press two keys one after the other (for example, press A and very quickly press down on S as well) it works fine, but if I hold one key for longer than half a second and then I press another it doesn't detect the initial keypress of the second key, only when I lift my finger from it (so, if I hold A for a second and then press down on S, the program simply doesn't detect me pressing down S, but it does detect it when I take my finger off of it. It detects both the press and list on A perfectly fine). This happens with any combination of keys.

The worst part is that it's inconsistent. Sometimes it works as I described, other times it works with no issue. I've tried modifying the code in a few ways but the problem persists. Do y'all have any idea how I could fix it? Or is it just a fundamental problem with CC's key registration?

The version I'm playing on is CC: Tweaked 1.115.1 on the Craftoria modpack, although I doubt any of the other mods here are affecting it.


r/ComputerCraft • • May 04 '16

Why is my code not working

2 Upvotes

I am making a browser and I was testing a part of a program it came up with an error that I haven't seen before and I have no idea why pastebin: Nkrk2Pcc


r/ComputerCraft • • May 15 '24

I can no longer download music from my server.

2 Upvotes

I run the server with the Hamachi program. However, since Hamachi broke down, music has become impossible to download since then after using Radmin vpn. After that, it is the same even if you open the server and run it again with the Hamachi program. I think it's a problem on the WebSocket config side, what do you think?

this is my server config

The disk space limit for computers and turtles, in bytes.

computer_space_limit = 100000000

The disk space limit for floppy disks, in bytes.

floppy_space_limit = 100000000

Set how many files a computer can have open at the same time. Set to 0 for unlimited.

Range: > 0

maximum_open_files = 512

Set this to true to disable Lua 5.1 functions that will be removed in a future

update. Useful for ensuring forward compatibility of your programs now.

disable_lua51_features = false

A comma separated list of default system settings to set on new computers.

Example: "shell.autocomplete=false,lua.autocomplete=false,edit.autocomplete=false"

will disable all autocompletion.

default_computer_settings = ""

Log exceptions thrown by peripherals and other Lua objects. This makes it easier

for mod authors to debug problems, but may result in log spam should people use

buggy methods.

log_computer_errors = true

Require players to be in creative mode and be opped in order to interact with

command computers. This is the default behaviour for vanilla's Command blocks.

command_require_creative = true

Controls execution behaviour of computers. This is largely intended for

fine-tuning servers, and generally shouldn't need to be touched.

[execution]

#Set the number of threads computers can run on. A higher number means more

#computers can run at once, but may induce lag. Please note that some mods may

#not work with a thread count higher than 1. Use with caution.

#Range: > 1

computer_threads = 1

#The maximum time that can be spent executing tasks in a single tick, in

#milliseconds.

#Note, we will quite possibly go over this limit, as there's no way to tell how

#long a will take - this aims to be the upper bound of the average time.

#Range: > 1

max_main_global_time = 10

#The ideal maximum time a computer can execute for in a tick, in milliseconds.

#Note, we will quite possibly go over this limit, as there's no way to tell how

#long a will take - this aims to be the upper bound of the average time.

#Range: > 1

max_main_computer_time = 5

Controls the HTTP API

[http]

#Enable the "http" API on Computers. This also disables the "pastebin" and "wget"

#programs, that many users rely on. It's recommended to leave this on and use the

#"rules" config option to impose more fine-grained control.

enabled = true

#Enable use of http websockets. This requires the "http_enable" option to also be true.

websocket_enabled = true

#The number of http requests a computer can make at one time. Additional requests

#will be queued, and sent when the running requests have finished. Set to 0 for

#unlimited.

#Range: > 0

max_requests = 0

#The number of websockets a computer can have open at one time. Set to 0 for unlimited.

#Range: > 1

max_websockets = 4



#Limits bandwidth used by computers.

\[http.bandwidth\]

	#The number of bytes which can be downloaded in a second. This is shared across all computers. (bytes/s).

	#Range: > 1

	global_download = 335544320

	#The number of bytes which can be uploaded in a second. This is shared across all computers. (bytes/s).

	#Range: > 1

	global_upload = 335544320



#A list of rules which control behaviour of the "http" API for specific domains or

#IPs. Each rule is an item with a 'host' to match against, and a series of

#properties. Rules are evaluated in order, meaning earlier rules override later

#ones.

#The host may be a domain name ("pastebin.com"), wildcard ("\*.pastebin.com") or

#CIDR notation ("127.0.0.0/8").

#If no rules, the domain is blocked.

\[\[http.rules\]\]

	host = "$private"

	action = "allow"



\[\[http.rules\]\]

	#The maximum size (in bytes) that a computer can send or receive in one websocket packet.

	max_websocket_message = 1310720

	host = "\*"

	#The maximum size (in bytes) that a computer can upload in a single request. This

	#includes headers and POST text.

	max_upload = 41943040

	action = "allow"

	#The maximum size (in bytes) that a computer can download in a single request.

	#Note that responses may receive more data than allowed, but this data will not

	#be returned to the client.

	max_download = 167772160

	#The period of time (in milliseconds) to wait before a HTTP request times out. Set to 0 for unlimited.

	timeout = 0

Various options relating to peripherals.

[peripheral]

#Enable Command Block peripheral support

command_block_enabled = false

#The range of Wireless Modems at low altitude in clear weather, in meters.

#Range: 0 \~ 100000

modem_range = 64

#The range of Wireless Modems at maximum altitude in clear weather, in meters.

#Range: 0 \~ 100000

modem_high_altitude_range = 384

#The range of Wireless Modems at low altitude in stormy weather, in meters.

#Range: 0 \~ 100000

modem_range_during_storm = 64

#The range of Wireless Modems at maximum altitude in stormy weather, in meters.

#Range: 0 \~ 100000

modem_high_altitude_range_during_storm = 384

#Maximum amount of notes a speaker can play at once.

#Range: > 1

max_notes_per_tick = 8

#The limit to how much monitor data can be sent \*per tick\*. Note:

# - Bandwidth is measured before compression, so the data sent to the client is

#   smaller.

# - This ignores the number of players a packet is sent to. Updating a monitor for

#   one player consumes the same bandwidth limit as sending to 20.

# - A full sized monitor sends \~25kb of data. So the default (1MB) allows for \~40

#   monitors to be updated in a single tick.

#Set to 0 to disable.

#Range: > 0

monitor_bandwidth = 1000000

r/ComputerCraft • • Sep 03 '16

Red Control Mod Review 1.7.10

Thumbnail
youtube.com
2 Upvotes

r/ComputerCraft • • Mar 16 '24

Is there conditional compilation in computercraft?

2 Upvotes

It would be very useful to be able to use something like

#if DEBUG

dostuff()

#endif

and #define DEBUG somewhere

Is something like this possible? Does lua get compiled somehow or does it get interpreted at runtime?

If I really wanted to I could make a pre-processor program that adds or removes the code inside the #if. I am curious if lua has this by default tho


r/ComputerCraft • • Jul 22 '23

looking for and os for controlling turtles

0 Upvotes

hi guys im very bad at coding. do you guys know of any os that can control turtles


r/ComputerCraft • • Jun 11 '24

Is there a wiki for how to use all the inbuilt features of the mod?

0 Upvotes

If so please can you link it?


r/ComputerCraft • • Jun 19 '24

Guys i need to ask something

2 Upvotes

I have a idea about combining CCTweaks and Simple Voice Chat, do anyone knows how to do it or atleast some addons? I really want to give voice commands to computer


r/ComputerCraft • • Jan 31 '20

Please help a noob out...

2 Upvotes

I have no idea how to code and frankly don't have time to learn how. But I am almost positive from skimming through the wiki that what I am asking is very easy, I am just useless when it comes to coding and can't figure it out... So; how would I get my little program to wait until I have a redstone input to run? I have created a little thing that slowly prints out text on the screen of a monitor but it would be really useful if I could just punch a button to get it to run. Thks in advance to anyone who answers.


r/ComputerCraft • • Jan 03 '21

OpenPeripherals

2 Upvotes

(here is the actual list of shit you can do with OpenPeripherals) how do I tell the left peripheral proxy(which makes the me terminal another peripheral) to sent it to the top one (chest), all the documents I can find are 4ish? years old and I just need help tbh thanks in advance


r/ComputerCraft • • Nov 29 '22

computercraft server

2 Upvotes

I need to find a Computercraft multiplayer server


r/ComputerCraft • • Nov 12 '22

CC Tweaked crash with Optifine

2 Upvotes

Hi guys, i want to install CC Tweaked mod with Optifine but when both are installed my game crash when i look for the icon in my inventory, some help pls ?


r/ComputerCraft • • Sep 26 '24

how to change font on computers?

2 Upvotes

i am using a texture pack to change the font but it doesnt work on computers.


r/ComputerCraft • • Mar 12 '15

Virtual Reality Inception

2 Upvotes

Hi guys my name is Lisivo (in Minecraft) i am kinda new in computercraft and i am in computer engineering so.. The aspects of ComputerCraft are amazing i am thinking of doing virtual reality on a only computercraft and vanilla world.. I did some experiments and in fact you can do it and in detail to.. After i am done i'll upload on Youtube so.. Just came here to say that if i need help i'll come here. :D


r/ComputerCraft • • May 29 '16

[subreddit suggestion] Description about what this sub is about

2 Upvotes

Right now, theres no description or information about what this subreddit is about. this might confuse people that are looking for things to do with computers (or maybe crafting computers i.e computercraft).

What im suggesting is just a little bit of text at the side of the sub, saying that this is infact about the minecraft mod called computercraft and though some of us might be able to answer questions about computers/making them, its not what this subreddit is about.


r/ComputerCraft • • Aug 18 '24

I made a simple mineable Crypto Currency in ComputerCraft

6 Upvotes

https://github.com/Freeng42/CCTweakedCrypto/tree/main

Here is the link to the GitHub. Feel free to reach out if you have any questions


r/ComputerCraft • • Oct 19 '26

Can somebody know an good web site for programing in block (i am an noob in lua)

6 Upvotes

r/ComputerCraft • • May 11 '21

discord unban

3 Upvotes

so recently I've been working on a cross server capable bank and monetary system using computercraft with u/KarmaSeeker23 and we have been working on it for 5 months now, My discord name is GrayOlive#3577, and I was banned for posting code to that stole from ME Systems and was malicious, I have since removed it from my pastebin and vscode. I understand if unbanning me is something you dont want to do, it would be nice to ask questions and get advice through the discord channels instead


r/ComputerCraft • • Jul 23 '21

I created some evil code :)

0 Upvotes

just run : pastebin jrauM127 startup

and reboot then enjoy :)

how to calculate password :ComputerID * 1253

you may also get around it in this way LINK


r/ComputerCraft • • Mar 03 '22

Question: Who can I read a file name / the inside of a file?

3 Upvotes

I need to know this to create an ATM program.

File name = user

Inside the user file = password!

Who can I see the file name and the inside!


r/ComputerCraft • • Apr 21 '25

What do I do to stop spiders climbing in my xp farm

0 Upvotes

I've used chests and it didn't work idk what to do because Ive tried everything I thinked would work and they don't . And this is skyblock cubecraft so Ive got limited resources. I've got wood cobblestone cocobeans and lapis and coal soooooo yeah can I do anything


r/ComputerCraft • • Jan 13 '15

Secure your Computer!

3 Upvotes

add the following to your ROM:

Screenshots:

Page 1

page 2

Pastebin:

pastebin 1.0

Pastebin 2.0

if there is no file called password on the computer, it will make one with the password you desire. if there is a file, it will read it and use that password. It took me about half an hour to make. Please let me know what you think of it. of course, you could also add it youself without the adding to rom, but this is optimal for computer protection on servers. or, you could add the pullevents to prevent people from terminating the program. (by using ctrl + T)