Skip to content

Commit 8b3dd96

Browse files
committed
Added the missing ingame-examples
- Fixed some item descriptions.
1 parent 02ec66d commit 8b3dd96

File tree

7 files changed

+104
-81
lines changed

7 files changed

+104
-81
lines changed

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/TEMP
2-
/Cache
1+
TEMP/
2+
Cache/
33

4-
*.lnk
4+
*.lnk
5+
.thumb/

.thumb/preview.jpg.jpg

-22.1 KB
Binary file not shown.

Gui/IconMap.png

-23 Bytes
Loading

Gui/Language/English/inventoryDescriptions.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,22 @@
2929

3030
"927c6597-36df-4db8-9524-aee9d6794b96" : {
3131
"title" : "#f002a8Creative Smart Controller#eeeeee",
32-
"description" : "NEED TO UPDATE DESCRIPTION. #ffd54cMax velocity: #ffeaa510000\n#ffd54cMax strength: #ffeaa510000\n\n#cfcfcfSmall, but strong! #939393It can be used to create automatic machinery and huge robots.\nIt also makes it possible to rotate the specified bearings and change the length of the specified connected pistons!",
32+
"description" : "#ffd54cMax velocity: #ffeaa510000\n#ffd54cMax strength: #ffeaa510000\n\n#939393It can be used to create entire programs of precise movements by setting custom delays between each movement.\nIt also allows rotating the specified bearings and changing the length of the specified connected pistons, but all according to the program!",
3333
"keywords" : ["scontroller", "s controller", "lua"]
3434
},
3535
"8d671f5a-7ebc-454b-9a9c-b70560ce19c2" : {
3636
"title" : "Smart Controller#eeeeee",
37-
"description" : "NEED TO UPDATE DESCRIPTION. #ffd54cMax velocity: #ffeaa510000\n#ffd54cMax strength: #ffeaa510000\n\n#cfcfcfSmall, but strong! #939393It can be used to create automatic machinery and huge robots.\nIt also makes it possible to rotate the specified bearings and change the length of the specified connected pistons!",
37+
"description" : "#ffd54cMax velocity: #ffeaa575\n#ffd54cMax strength: #ffeaa575\n\n#939393It can be used to create entire programs of precise movements by setting custom delays between each movement.\nIt also allows rotating the specified bearings and changing the length of the specified connected pistons, but all according to the program!",
3838
"keywords" : ["scontroller", "s controller", "lua"]
3939
},
4040
"4747b9dd-1451-4624-85cd-60b169a7ef74" : {
4141
"title" : "#f002a8Creative Mini Smart Controller#eeeeee",
42-
"description" : "NEED TO UPDATE DESCRIPTION. #ffd54cMax velocity: #ffeaa510000\n#ffd54cMax strength: #ffeaa510000\n\n#cfcfcfSmall, but strong! #939393It can be used to create automatic machinery and huge robots.\nIt also makes it possible to rotate the specified bearings and change the length of the specified connected pistons!",
42+
"description" : "#ffd54cMax velocity: #ffeaa510000\n#ffd54cMax strength: #ffeaa510000\n\n#cfcfcfSmall, but strong! #939393It can be used to create entire programs of precise movements by setting custom delays between each movement.\nIt also allows rotating the specified bearings and changing the length of the specified connected pistons, but all according to the program!",
4343
"keywords" : ["scontroller", "s controller", "lua"]
4444
},
4545
"4f28fcf6-5821-47d8-abad-1cfbd55debf9" : {
4646
"title" : "Mini Smart Controller#eeeeee",
47-
"description" : "NEED TO UPDATE DESCRIPTION. #ffd54cMax velocity: #ffeaa510000\n#ffd54cMax strength: #ffeaa510000\n\n#cfcfcfSmall, but strong! #939393It can be used to create automatic machinery and huge robots.\nIt also makes it possible to rotate the specified bearings and change the length of the specified connected pistons!",
47+
"description" : "#ffd54cMax velocity: #ffeaa575\n#ffd54cMax strength: #ffeaa575\n\n#cfcfcfSmall, but strong! #939393It can be used to create entire programs of precise movements by setting custom delays between each movement.\nIt also allows rotating the specified bearings and changing the length of the specified connected pistons, but all according to the program!",
4848
"keywords" : ["scontroller", "s controller", "lua"]
4949
},
5050

Gui/Language/Russian/inventoryDescriptions.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,43 @@
88

99
"f8bb0545-213a-46b6-889b-38ee51ef68c5" : {
1010
"title" : "Программируемый контроллер",
11-
"description" : "#ffd54cМакс. скорость: #ffeaa575\n#ffd54cМакс. сила: #ffeaa575\n\n#939393Его можно использовать для создания автоматизированных механизмов и огромных роботов.\nОн также позволяет вращать указанные подшипники и изменять длину указанных поршней, которые к нему подключены!",
11+
"description" : "#ffd54cМакс. скорость: #ffeaa575\n#ffd54cМакс. сила: #ffeaa575\n\n#939393Его можно использовать для создания автоматизированных механизмов и огромных роботов.\nА ещё, он может вращать указанные подшипники и изменять длину поршней, которые к нему подключены!",
1212
"keywords" : ["сконтроллер", "скриптабельный контроллер", "scontroller", "s controller", "lua"]
1313
},
1414
"5442660a-2b67-4ef0-aef0-c4d1aa3fdd84" : {
1515
"title" : "#f002a8Творческий программируемый контроллер#eeeeee",
16-
"description" : "#ffd54cМакс. скорость: #ffeaa510000\n#ffd54cМакс. сила: #ffeaa510000\n\n#939393Его можно использовать для создания автоматизированных механизмов и огромных роботов.\nОн также позволяет вращать указанные подшипники и изменять длину указанных поршней, которые к нему подключены!",
16+
"description" : "#ffd54cМакс. скорость: #ffeaa510000\n#ffd54cМакс. сила: #ffeaa510000\n\n#939393Его можно использовать для создания автоматизированных механизмов и огромных роботов.\nА ещё, он может вращать указанные подшипники и изменять длину поршней, которые к нему подключены!",
1717
"keywords" : ["сконтроллер", "скриптабельный контроллер", "scontroller", "s controller", "lua"]
1818
},
1919
"b163cb0a-ab54-4739-a59f-889a5a3cc694" : {
2020
"title" : "Программируемый мини-контроллер",
21-
"description" : "#ffd54cМакс. скорость: #ffeaa575\n#ffd54cМакс. сила: #ffeaa575\n\n#cfcfcfМал, да удал! #939393Его можно использовать для создания автоматизированных механизмов и огромных роботов.\nОн также позволяет вращать указанные подшипники и изменять длину указанных поршней, которые к нему подключены!",
21+
"description" : "#ffd54cМакс. скорость: #ffeaa575\n#ffd54cМакс. сила: #ffeaa575\n\n#cfcfcfМал, да удал! #939393Его можно использовать для создания автоматизированных механизмов и огромных роботов.\nА ещё, он может вращать указанные подшипники и изменять длину поршней, которые к нему подключены!",
2222
"keywords" : ["сконтроллер", "скриптабельный контроллер", "scontroller", "s controller", "lua"]
2323
},
2424
"769ea2b9-ea8b-4569-a77d-69d9060fcbcf" : {
2525
"title" : "#f002a8Творческий программируемый мини-контроллер#eeeeee",
26-
"description" : "#ffd54cМакс. скорость: #ffeaa510000\n#ffd54cМакс. сила: #ffeaa510000\n\n#cfcfcfМал, да удал! #939393Его можно использовать для создания автоматизированных механизмов и огромных роботов.\nОн также позволяет вращать указанные подшипники и изменять длину указанных поршней, которые к нему подключены!",
26+
"description" : "#ffd54cМакс. скорость: #ffeaa510000\n#ffd54cМакс. сила: #ffeaa510000\n\n#cfcfcfМал, да удал! #939393Его можно использовать для создания автоматизированных механизмов и огромных роботов.\nА ещё, он может вращать указанные подшипники и изменять длину поршней, которые к нему подключены!",
2727
"keywords" : ["сконтроллер", "скриптабельный контроллер", "scontroller", "s controller", "lua"]
2828
},
2929

3030
"927c6597-36df-4db8-9524-aee9d6794b96" : {
3131
"title" : "#f002a8Творческий умный контроллер#eeeeee",
32-
"description" : "NEED TO UPDATE DESCRIPTION.",
32+
"description" : "#ffd54cМакс. скорость: #ffeaa510000\n#ffd54cМакс. сила: #ffeaa510000\n\n#939393Его можно использовать для создания целых программ точных движений, задавая свои задержки между ними.\nА ещё, он может вращать указанные подшипники и изменять длину поршней, которые к нему подключены, но всё, согласно программе!",
3333
"keywords" : ["scontroller", "s controller", "lua"]
3434
},
3535
"8d671f5a-7ebc-454b-9a9c-b70560ce19c2" : {
3636
"title" : "Умный контроллер#eeeeee",
37-
"description" : "NEED TO UPDATE DESCRIPTION.",
37+
"description" : "#ffd54cМакс. скорость: #ffeaa575\n#ffd54cМакс. сила: #ffeaa575\n\n#939393Его можно использовать для создания целых программ точных движений, задавая свои задержки между ними.\nА ещё, он может вращать указанные подшипники и изменять длину поршней, которые к нему подключены, но всё, согласно программе!",
3838
"keywords" : ["scontroller", "s controller", "lua"]
3939
},
4040
"4747b9dd-1451-4624-85cd-60b169a7ef74" : {
4141
"title" : "#f002a8Творческий умный мини-контроллер#eeeeee",
42-
"description" : "NEED TO UPDATE DESCRIPTION.",
42+
"description" : "#ffd54cМакс. скорость: #ffeaa510000\n#ffd54cМакс. сила: #ffeaa510000\n\n#cfcfcfМал, да удал! #939393Его можно использовать для создания целых программ точных движений, задавая свои задержки между ними.\nА ещё, он может вращать указанные подшипники и изменять длину поршней, которые к нему подключены, но всё, согласно программе!",
4343
"keywords" : ["scontroller", "s controller", "lua"]
4444
},
4545
"4f28fcf6-5821-47d8-abad-1cfbd55debf9" : {
4646
"title" : "Умный мини-контроллер#eeeeee",
47-
"description" : "NEED TO UPDATE DESCRIPTION.",
47+
"description" : "#ffd54cМакс. скорость: #ffeaa575\n#ffd54cМакс. сила: #ffeaa575\n\n#cfcfcfМал, да удал! #939393Его можно использовать для создания целых программ точных движений, задавая свои задержки между ними.\nА ещё, он может вращать указанные подшипники и изменять длину поршней, которые к нему подключены, но всё, согласно программе!",
4848
"keywords" : ["scontroller", "s controller", "lua"]
4949
},
5050

Scripts/ServiceTool.lua

Lines changed: 87 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ServiceTool = class()
22

33
function ServiceTool:client_onFixedUpdate()
44
if sm.scomputers and not _G_EXAMPLES_BINDED then
5-
sm.scomputers.addExample("Smart Controller - Simple", [[controller = getComponents("smartController")[1]
5+
sm.scomputers.addExample("Smart Controller - Simple", [[controller = getComponents("smartController")[1]
66
if controller == nil then return end
77
88
-- Configuring
@@ -14,40 +14,40 @@ controller.setActive(true)
1414
function onStart()
1515
-- Execute the program (direct order)
1616
controller.start({
17-
-- Stages (step-by-step)
18-
[1] = { -- Synchronized actions
19-
["pistons"] = {
17+
-- Stages (step-by-step)
18+
[1] = { -- Synchronized actions
19+
["pistons"] = {
2020
-- [pistonIndex] = {lengthBefore, lengthAfter}
21-
[{1,25}] = {1, 4} -- Short notation (1-25 indexes pistons)
22-
},
23-
["bearings"] = {
21+
[{1,25}] = {1, 4} -- Short notation (1-25 indexes pistons)
22+
},
23+
["bearings"] = {
2424
-- [bearingIndex] = {degreeBefore, degreeAfter}
25-
[1] = {0, 90}
26-
}
27-
},
28-
[2] = {
29-
["pistons"] = {
30-
[{1,25}] = {4, 1}
31-
},
32-
["bearings"] = {
33-
[1] = {90, 0},
34-
},
35-
36-
-- Delays when [onDirectDelay, onReverseDelay] (start/stop delays)
37-
-- If a stage in the program does not include a ["delays"] field, the default delay of {1, 1} is applied.
38-
["delays"] = {2, 2}
39-
}
25+
[1] = {0, 90}
26+
}
27+
},
28+
[2] = {
29+
["pistons"] = {
30+
[{1,25}] = {4, 1}
31+
},
32+
["bearings"] = {
33+
[1] = {90, 0},
34+
},
35+
36+
-- Delays when [onDirectDelay, onReverseDelay] (start/stop delays)
37+
-- If a stage in the program does not include a ["delays"] field, the default delay of {1, 1} is applied.
38+
["delays"] = {2, 2}
39+
}
4040
})
4141
end
4242
4343
function onStop()
44-
-- Execute the program (reversed order)
44+
-- Execute the program (reversed order)
4545
controller.stop()
4646
end
4747
4848
_enableCallbacks = true]])
4949

50-
sm.scomputers.addExample("Smart Controller - Various", [[controller = getComponents("smartController")[1]
50+
sm.scomputers.addExample("Smart Controller - Various", [[controller = getComponents("smartController")[1]
5151
if controller == nil then return end
5252
5353
-- Configuring
@@ -57,52 +57,74 @@ controller.setSoundType(0)
5757
controller.setActive(true)
5858
5959
function onStart()
60-
-- Execute the program (direct order)
60+
-- Execute the program (direct order)
6161
controller.start({
62-
-- Stages (step-by-step)
63-
[1] = { -- Synchronized actions
64-
["pistons"] = {
65-
-- [pistonIndex] = {lengthBefore, lengthAfter}
66-
[3] = {1, 7}, -- Maybe we should change it to a short notation? The example is below :D
67-
[4] = {1, 7}
68-
},
69-
["bearings"] = {
70-
-- [bearingIndex] = {degreeBefore, degreeAfter}
71-
[{1,2}] = {90, 90} -- Short notation (1-2 indexes bearings)
72-
-- [1] = {90, 90}, -- Long notation
73-
-- [2] = {90, 90} -- Loooong
74-
}
75-
},
76-
[2] = {
77-
["pistons"] = {
78-
[{1,2}] = {1, 4}
79-
},
80-
["bearings"] = {
81-
[{1,2}] = {180, 180}
82-
},
83-
84-
-- Delays when [onDirectDelay, onReverseDelay] (start/stop delays)
85-
-- If a stage in the program does not include a ["delays"] field, the default delay of {1, 1} is applied.
86-
["delays"] = {2, 2}
87-
},
88-
[3] = {
89-
-- Pistons are not affected (saved state from stage 2)
90-
["bearings"] = {
91-
[1] = {45, 45},
92-
[2] = {45, 45}
93-
},
94-
95-
["delays"] = {2, 2}
96-
}
97-
})
62+
-- Stages (step-by-step)
63+
[1] = { -- Synchronized actions
64+
["pistons"] = {
65+
-- [pistonIndex] = {lengthBefore, lengthAfter}
66+
[3] = {1, 7}, -- Maybe we should change it to a short notation? The example is below :D
67+
[4] = {1, 7}
68+
},
69+
["bearings"] = {
70+
-- [bearingIndex] = {degreeBefore, degreeAfter}
71+
[{1,2}] = {90, 90} -- Short notation (1-2 indexes bearings)
72+
-- [1] = {90, 90}, -- Long notation
73+
-- [2] = {90, 90} -- Loooong
74+
}
75+
},
76+
[2] = {
77+
["pistons"] = {
78+
[{1,2}] = {1, 4}
79+
},
80+
["bearings"] = {
81+
[{1,2}] = {180, 180}
82+
},
83+
84+
-- Delays when [onDirectDelay, onReverseDelay] (start/stop delays)
85+
-- If a stage in the program does not include a
86+
-- ["delays"] field, the default delay of {1, 1} is applied.
87+
["delays"] = {2, 2}
88+
},
89+
[3] = {
90+
-- Pistons are not affected (saved state from stage 2)
91+
["bearings"] = {
92+
[1] = {45, 45},
93+
[2] = {45, 45}
94+
},
95+
96+
["delays"] = {2, 2}
97+
}
98+
})
9899
end
99100
100101
function onStop()
101-
-- Execute the program (reversed order)
102+
-- Execute the program (reversed order)
102103
controller.stop()
103104
end
104105
105106
_enableCallbacks = true]])
106-
_G_EXAMPLES_BINDED = true
107-
end
108-
end
107+
108+
sm.scomputers.addExample("Scriptable Controller", [[controller = getComponents("scriptableController")[1]
109+
if controller == nil then return end
110+
111+
-- Configuring
112+
controller.setVelocity(30)
113+
controller.setStrength(30)
114+
controller.setActive(true)
115+
116+
-- Bearings
117+
controller.setBearingAngle(1, math.rad(math.random(140, 160)))
118+
controller.setBearingAngle(2, math.rad(220))
119+
120+
-- Pistons
121+
controller.setPistonLength(1, 4)
122+
controller.setPistonLength(2, 10)
123+
124+
print()
125+
print("Bearing index 1 angle in degrees: " .. math.deg(controller.getBearingAngle(1)))
126+
print("Bearings count: " .. controller.getBearingsCount() .. "; Pistons count: " .. controller.getPistonsCount())]])
127+
128+
_G_EXAMPLES_BINDED = true
129+
end
130+
end

0 commit comments

Comments
 (0)