Coder Social home page Coder Social logo

qdtts's Introduction

QDTTS

Quick and Dirty Turtle Task System

A hacked together project to get my feet wet with ComputerCraft, Lua, and to get some ideas for Hive.

Server

server.lua

  • Runs a continuous loop listening for RedNet messages and responding to them
  • Maintains a list of all registered turtles
  • Maintains a list of tasks
  • Assigns pending tasks to idle turtles

Turtle States

  • idle
  • assigned
  • running

Task states

  • pending
  • assigned
  • running
  • incomplete
  • complete

Turtle object

qturtle.lua Encapsulated in qTurtle object that the individual turtles can instantiate

  • Registers with the server
  • Provides move commands that handle fuel level monitoring and refueling
  • Notifies server if out of fuel, if no longer out of fuel

Turtle instance

Instance of a turtle object dean.lua

  • Instantiates qTurtle object
  • Registers with server
  • Demonstrates movement methods

Control Console

client.lua Command line interface between the player and the server. Provides the following facilities:

  • Add a task
  • List tasks and turtles
  • Query the status of a turtle
  • Shutdown the server

qdtts's People

Contributors

cing2 avatar qbfreak avatar

Watchers

 avatar  avatar

qdtts's Issues

Splitting a msg

In server.lua line 119 you have this: `id,msg = rednet.receive("QDTTS")

message = {}
count = 0
for i in string.gmatch(msg, "%S+") do
count = count + 1
message[count] = i
end`
I have used your code to make the inventory server parted or at least i am trying to.
But i find it weird that you have the count+1 before the message[count] so that the first slot will always be empty i don't know how your code handels the rest of it but i just wanted to point this out.

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.