{"id":17475240,"url":"https://github.com/treeplate/computer_factory","last_synced_at":"2026-05-18T09:01:47.424Z","repository":{"id":234004815,"uuid":"788153690","full_name":"treeplate/computer_factory","owner":"treeplate","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-07T23:47:18.000Z","size":286,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-12T04:46:17.746Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/treeplate.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-17T22:00:31.000Z","updated_at":"2025-09-07T23:47:21.000Z","dependencies_parsed_at":"2024-04-17T23:23:23.388Z","dependency_job_id":"427007c5-081a-47eb-a696-ba71998b63ab","html_url":"https://github.com/treeplate/computer_factory","commit_stats":null,"previous_names":["treeplate/computer_factory"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/treeplate/computer_factory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treeplate%2Fcomputer_factory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treeplate%2Fcomputer_factory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treeplate%2Fcomputer_factory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treeplate%2Fcomputer_factory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/treeplate","download_url":"https://codeload.github.com/treeplate/computer_factory/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treeplate%2Fcomputer_factory/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010288,"owners_count":26084720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-18T18:43:41.267Z","updated_at":"2025-10-12T04:46:18.670Z","avatar_url":"https://github.com/treeplate.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Box Factory\n## Principle\nThere are several bots with inventories who trade, craft, etc.\nThey can:\n- trade with eachother\n- farm cows or sheep (adds one cow/sheep to inv)\n- chop wood (add one log to inv)\n- mine gold (add one gold ore to inv)\n- craft 1 box for 12 planks\n- craft 4 planks from 1 log\n- craft 1 coin from 1 gold ore\n\nThere is also you, a user, who can do all the same things except trading.\n\n\"farmer\" farms cows and sheep and gives them to \"boxmaker\".\n\"boxmaker\" trades 3 cows 1 sheep to #2 for 1 plank, makes boxes from 12 planks, and sells to #3 for 3 coins.\n\"woodcutter\" chops wood, turns logs into 4 planks, trades 1 plank to #1 for 3 cows 1 sheep.\n\"miner\" mines gold, crafts coins from gold, and buys boxes from #1 for 3 coins.\n\"user\" is you.\n\nSome of these give multiple sets of resources before the first response set is received, e.g. the miner gives a lot of coins before getting any boxes.\n## Protocol\nTuples, starting with a string, are sent from client to server to request a trade/farm/craft/etc.\nServer sends back a tuple starting with a string.\n### Client To Server\n- (\"index\")\n\u003cbr\u003eServer sends index of player (used for trading)\n- (\"farm\", \"cow\"/\"sheep\")\n- (\"chop\")\n- (\"mine\")\n- (\"craft\", \"coin\"/\"planks\"/\"box\")\n- (\"trade\", index, \"cow\"/\"sheep\"/\"coin\"/\"planks\"/\"log\"/\"goldOre\"/\"box\", amount)\n\u003cbr\u003e send \\\u003camount\u003ex\\\u003c$3\u003e to \\\u003cindex\u003e isolate.\n- (\"getInv\", \"cow\"/\"sheep\"/\"coin\"/\"planks\"/\"log\"/\"goldOre\"/\"box\")\n### Server To Client\n- (\"invalid\", \"type\", \"must be record or string\")\n\u003cbr\u003eClient did not send a record or a string (one-argument records are actually strings).\n- (\"invalid\", \"action\")\n\u003cbr\u003eStarting string was not valid action, or record had wrong shape for that action.\n- (\"invalid\", \"index\")\n\u003cbr\u003e`trade` did not send a valid person index\n- (\"invalid\", \"item\")\n\u003cbr\u003eInvalid item / cannot farm/craft this item\n- (\"invalid\", \"amount\")\n\u003cbr\u003eTraded more of an item then the client has, or a negative amount.\n- (\"invalid\", \"craft-attempt\")\n\u003cbr\u003eClient does not have the resources to craft what they attempted to.\n- (\"success\")\n\u003cbr\u003eDid what the client asked.\n- (index)\n\u003cbr\u003eIn response to client's \"index\"\n- (amount)\n\u003cbr\u003eIn response to client's \"getInv\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreeplate%2Fcomputer_factory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftreeplate%2Fcomputer_factory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreeplate%2Fcomputer_factory/lists"}