neumond / python-computer-craft Goto Github PK
View Code? Open in Web Editor NEWPythonization of ComputerCraft Minecraft mod. Write Python instead Lua!
License: MIT License
Pythonization of ComputerCraft Minecraft mod. Write Python instead Lua!
License: MIT License
Is this project compatible with the Advanced Peripherals mod?
in lua, althought doesn't seem to be properly documented on the wiki, you can pass 2 arguments to getItemDetail()
; the slot number and a boolean to determine if the function should return simple or detailed item information.
in python trying to pass 2 arguments will raise "TypeError: getItemDetail() takes 1 positional argument but 2 were given"
I tried to run my own python program with
"py C:\Users\madhu\OneDrive\Desktop\Megafile\Pythonprograms\Python.pyfiles\test.py" command and it returns with the error in the title.
python-computer-craft/computercraft/server.py
Lines 17 to 21 in 55d3035
Here, msg.data
is yielded.
python-computer-craft/computercraft/server.py
Lines 78 to 80 in 55d3035
But this code tries to use the yielded value as a msg
.
This causes an AttributeError to be raised.
is it possible to use this on a server? if so, how. (using CC tweaked)
Hello everybody. I have a problem opening and reading a file using the "Opening a file" code from this repo. When I run the code, an exception is raised (I think it was a TypeError) that says something about indexing a nil value. Any help will be appreciated.
Edit:
The exception raised was computercraft.errors.LuaException, not TypeError.
It says: ['[string "temp["2"].close(); temp["2"] = nil:1: attempt to index field \'2\' (a nil value)']
How do I correct this error?
C:\home>python -m computercraft.server
Traceback (most recent call last):
File "C:\Users\toxal\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\toxal\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\toxal\AppData\Local\Programs\Python\Python310\lib\site-packages\computercraft\server.py", line 8, in <module>
from .sess import CCSession
File "C:\Users\toxal\AppData\Local\Programs\Python\Python310\lib\site-packages\computercraft\sess.py", line 15, in <module>
from greenlet import greenlet, getcurrent as get_current_greenlet
File "C:\Users\toxal\AppData\Local\Programs\Python\Python310\lib\site-packages\greenlet\__init__.py", line 29, in <module>
from ._greenlet import _C_API # pylint:disable=no-name-in-module
ImportError: DLL load failed while importing _greenlet: module was not found.
I picked this library up a month ago and have been using it to great extent for an extensive turtle control framework. It's been quite fun!
I love the library, and I would love to support it. Are there any tasks that need doing, or ways I can donate?
I've been attempting to understand how to I could wait on my own socket connection to another server, before triggering some computercraft command, however I keep running into issues with greenlet. As I understand it, I can't call any computercraft functions form another coroutine listening to a socket, otherwise I'll encounter the error 'Computercraft function was called outside context'.
If I did find some way to wait for the signal in the current greenlet, then I assume I'd be blocking communication with the computercraft computer.
As a proof of concept, I just want to trigger a redstone signal using a websocket connection with a separate server. Is there any simple approach to this?
Cant wrap chest peripheral. I get assertion error. Maybe doing something wrong? Thanks!
Whenever I try to run "py" I get the following error:
py:36: attempt to call field 'unserializeJSON' (a nil value)
Firstly it must be stated that I think this repo is an elegant bit of work.
So it's become a small obsession to try and fix this repos compatibilty with Tweaked, since continued development of Computer Craft has kinda faded, some lovley people have made a fork to faithfully keep the mod updated to later versions of minecraft, currently 1.14.4. Unfortunatly though this repo dosen't work out of the box with it. If anyone could asssit in helping port this repo to it, that would be appreciated, other wise I'll be reporting my progress in the hopes of official changes being made to the repo to fix compatibility.
So far I've identifed that the http.post() function requiers a second parameter, so I've added an empty string as a second parameter to computercraft/back.lua:70.
the url variable also dosen't contain the port of the server, at the moment I just manually change this after downloading the lua script.
from cc import term, peripheral
mon = peripheral.wrap("top")
term.redirect(mon)
term.write("Hello word")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.