Giter Club home page Giter Club logo

python-computer-craft's People

Contributors

neumond avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-computer-craft's Issues

turtle.getItemDetail() not working properly

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.

Screenshot from 2021-08-26 03-55-47
Screenshot from 2021-08-26 03-56-14

in python trying to pass 2 arguments will raise "TypeError: getItemDetail() takes 1 positional argument but 2 were given"
Screenshot from 2021-08-26 03-56-32

Cannot open a file

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)']

Server usage?

is it possible to use this on a server? if so, how. (using CC tweaked)

Supporting Development

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?

_bin_messages yields data, but later code expects the whole message

async def _bin_messages(ws):
async for msg in ws:
if msg.type != WSMsgType.BINARY:
continue
yield msg.data

Here, msg.data is yielded.

async for msg in _bin_messages(ws):
if msg.type != WSMsgType.BINARY:
continue

But this code tries to use the yielded value as a msg.

This causes an AttributeError to be raised.

No work: term.redirect()

from cc import term, peripheral

mon = peripheral.wrap("top")
term.redirect(mon)
term.write("Hello word")

Compatibility with Tweaked

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.

Two way communication between a computer and another server

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?

ImportError: DLL load failed while importing _greenlet: module was not found.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.