Skip to content

Commit 2ae5b78

Browse files
committed
init
1 parent 6919405 commit 2ae5b78

File tree

3 files changed

+92
-0
lines changed

3 files changed

+92
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,14 @@
11
# MiningClient-prog
2+
23
The Standalone Client for our bigger Mining Project
4+
5+
This is the very simple script required to run the Client without any Server
6+
7+
```lua
8+
miningClientSmall config
9+
```
10+
11+
to setup the Libary in the Console.
12+
Very much VIP.
13+
14+
So far only the Scanning-Radius & Mining-Diameteris are relevant

files.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
miningClientSmall.lua

miningClientSmall.lua

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
--Requirements
2+
local pretty = require "cc.pretty"
3+
4+
---@class scm
5+
local scm = require("scm")
6+
---@class SettingManager
7+
local sM = scm:load("settingsManager")
8+
---@class HelperFunctions
9+
local helper = scm:load("helperFunctions")
10+
---@class miningLib
11+
local miningLib = scm:load("miningClient")
12+
13+
---@class MiningSettings
14+
local miningSettings = { miningDepth = -50, miningHight = 3, miningDiameter = 9, scanRadius = 4 };
15+
16+
--Args
17+
args = { ... }
18+
19+
20+
--Functions
21+
local function facingPostition()
22+
---TODO: GPS
23+
print("Facing: X|Z|-X|-Z?")
24+
25+
return read()
26+
end
27+
--- sets the config for the Miner
28+
local function config()
29+
print('Settings: ')
30+
print('miningDepth miningHight miningDiameter scanRadius')
31+
local input = {}
32+
local r = read()
33+
if #r > 0 then
34+
for w in r:gmatch("%S+") do
35+
table.insert(input, w)
36+
end
37+
miningSettings = {
38+
miningDepth = tonumber(input[1]),
39+
miningHight = tonumber(input[2]),
40+
miningDiameter = tonumber(input[3]),
41+
scanRadius = tonumber(input[4])
42+
};
43+
miningSettings = sM.setget('MiningSettings', miningSettings, miningSettings);
44+
end
45+
pretty.pretty_print(miningSettings)
46+
end
47+
48+
---main script Function
49+
local function main()
50+
--TODO: GPS support
51+
-- term.clear()
52+
53+
--settings
54+
miningSettings = sM.setget('MiningSettings', nil, miningSettings)
55+
if args and (args[1] == "config" or args[1] == "Config") then
56+
config()
57+
return
58+
end
59+
miningLib.permanentFacingPostition = facingPostition()
60+
61+
--Manuell Distance selection
62+
print("How far in Blocks?")
63+
local areas = read()
64+
areas = tonumber(areas)
65+
66+
--calc AreaPoints for mining
67+
---@type ScanDataTable
68+
local points = {}
69+
areas = areas / (miningSettings.miningDiameter)
70+
areas = math.floor(areas)
71+
table.insert(points, { x = 0, y = 0, z = 0 })
72+
for i = 1, areas do
73+
--TODO facing! the createpath does not take absolute points!
74+
table.insert(points, { x = miningSettings.miningDiameter, y = 0, z = 0 })
75+
end
76+
miningLib:main(points);
77+
end
78+
79+
main()

0 commit comments

Comments
 (0)