-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartup.lua
3199 lines (3093 loc) · 118 KB
/
startup.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--左侧屏幕名称
local Lscreen = "monitor_8"
--右侧屏幕(至少俩格宽)名称
local Rscreen = "monitor_9"
--左侧屏幕是否透明
local LscreenTransparent = true
if peripheral.isPresent(Lscreen) == false then
print('left screen not connect,please check')
print('computer will shutdown after 10s')
os.sleep(10)
os.shutdown()
end
if peripheral.isPresent(Rscreen) == false then
print('right screen not connect,please check')
print('computer will shutdown after 10s')
os.sleep(10)
os.shutdown()
end
local screen = peripheral.wrap(Rscreen)
local screen1 = peripheral.wrap(Lscreen)
screen.clear()
screen1.clear()
if LscreenTransparent == true then
screen1.setTransparentMode(false)
screen1.setTransparentColor(colors.black)
end
screen1.setBackgroundColour(colors.black)
screen.setBackgroundColour(colors.black)
screen.setTextScale(1)
screen.setCursorPos(2,2)
screen.blit("carOS","000ff","ccc00")
os.sleep(1)
screen.setCursorPos(3,1)
screen.blit("6.0","fff","aaa")
os.sleep(1)
screen.setCursorPos(2,4)
screen.blit("MISAKA","000000","111111")
screen.setCursorPos(3,5)
screen.blit("18848","00000","11111")
os.sleep(1)
screen.setCursorPos(1,3)
screen.blit("booting","0000000","fffffff")
--输入油门刹车方向盘加档信号用的红石接口名称
local RIinput = "redstoneIntegrator_25"
--输入加减档信号用的红石接口名称
local RIinput1 = "redstoneIntegrator_23"
--左轮信号输入(无线红石信号遥控器的A键)在红石接口上的方向
local RIinput_leftwheel = "right"
--右轮信号输入(无线红石信号遥控器的D键)在红石接口上的方向
local RIinput_rightwheel = "left"
--油门信号输入(无线红石信号遥控器的W键)在红石接口上的方向
local RIinput_speedup = "top"
--刹车信号输入(无线红石信号遥控器的S键)在红石接口上的方向
local RIinput_speeddown = "bottom"
--加档信号输入(无线红石信号遥控器的空格键)在红石接口上的方向
local RIinput_upgear = "front"
--降档信号输入(无线红石信号遥控器的shift键)在红石接口上的方向
local RIinput1_downgear = "left"
--输出左轮和左转向灯信号用的红石接口名称
local RILWL = "redstoneIntegrator_24"
--输出右轮和右转向灯信号用的红石接口名称
local RIRWL = "redstoneIntegrator_22"
--转速控制器名称
local da_name = "Create_RotationSpeedController_6"
--转速控制器在数字适配器的哪侧
--local spct = "right"
--电池名称
local battery_name = "modular_accumulator_7"
--音乐扬声器名称
local speaker_name = "speaker_3"
--音效扬声器名称
local speaker1_name = "speaker_4"
--启用汽车音效
local Car_Audio = true
--掌上无线/末影电脑id
local padid = 9
--后侧raycaster名称
local brc_name = "raycaster_4"
--前侧raycaster名称
local frc_name = "raycaster_5"
--软盘驱动器名称
local drivename = "drive_0"
--无线调制解调器装在电脑的哪侧
local wirelessmodem = "left"
--玩家检测器名称
local playerDetector_name = "playerDetector_1"
--锁车距离
local lockrange = 5
--拥有车的玩家名
local ownername = {
"Rudeus_Greyrat",
"GE90",
"klingmir",
"Ananab"
}
--电动马达名称
local motor_name = "electric_motor_12"
--输出左/右轮和左/右转向灯信号在各红石接口上的方向
local RIoutput_leftwheel = "back"
local RIoutput_rightwheel = "back"
local RIoutput_leftfrontlight = "left"
local RIoutput_rightfrontlight = "right"
local RIoutput_leftbacklight = "right"
local RIoutput_rightbacklight = "left"
--车名(15字以内,只能使用ASCII字符,该名也会变成该瓦尔基里的名字)
local carname = "Misaka18848-RV"
--车名文字颜色
local carnamecolor1 = "f"
--车名背景颜色
local carnamecolor2 = "7"
--车名文字随机颜色
local carnameautocolor1 = false
--车名背景随机颜色
local carnameautocolor2 = true
--音乐音量(0-3)
local musicvol = 1.5
--汽车音效音量(0-3)
local carvol = 0.5
--喇叭音量
local hornsvol = 3
local bootcheck = true
local bootcheck2 = true
local screen1width, screen1height =screen1.getSize()
screen1.setTextScale(0.5)
screen1.setCursorPos(1,1)
screen1.setTextColor(colors.white)
screen1.write(os.version())
os.sleep(0.1)
screen1.setCursorPos(1,2)
screen1.write("RScreen")
os.sleep(0.1)
screen1.setCursorPos(1,3)
screen1.write("PD")
os.sleep(0.1)
screen1.setCursorPos(1,4)
screen1.write("RIinput")
os.sleep(0.1)
screen1.setCursorPos(1,5)
screen1.write("RILWL")
os.sleep(0.1)
screen1.setCursorPos(1,6)
screen1.write("RIRWL")
os.sleep(0.1)
screen1.setCursorPos(1,7)
screen1.write("DA")
os.sleep(0.1)
screen1.setCursorPos(1,8)
screen1.write("Battery")
os.sleep(0.1)
screen1.setCursorPos(1,9)
screen1.write("Motor")
os.sleep(0.1)
screen1.setCursorPos(1,10)
screen1.write("check1/2")
os.sleep(0.1)
screen1.setCursorPos(11,2)
if peripheral.isPresent(Rscreen) == false then
screen1.setTextColor(colors.red)
screen1.write('Error')
bootcheck = false
else
screen1.setTextColor(colors.green)
screen1.write('Done')
end
os.sleep(0.1)
screen1.setCursorPos(11,3)
if peripheral.isPresent(playerDetector_name) == false then
screen1.setTextColor(colors.red)
screen1.write('Error')
bootcheck = false
else
screen1.setTextColor(colors.green)
screen1.write('Done')
end
os.sleep(0.1)
screen1.setCursorPos(11,4)
if peripheral.isPresent(RIinput) == false or peripheral.isPresent(RIinput1) == false then
screen1.setTextColor(colors.red)
screen1.write('Error')
bootcheck = false
else
screen1.setTextColor(colors.green)
screen1.write('Done')
end
os.sleep(0.1)
screen1.setCursorPos(11,5)
if peripheral.isPresent(RILWL) == false then
screen1.setTextColor(colors.red)
screen1.write('Error')
bootcheck = false
else
screen1.setTextColor(colors.green)
screen1.write('Done')
end
os.sleep(0.1)
screen1.setCursorPos(11,6)
if peripheral.isPresent(RIRWL) == false then
screen1.setTextColor(colors.red)
screen1.write('Error')
bootcheck = false
else
screen1.setTextColor(colors.green)
screen1.write('Done')
end
os.sleep(0.1)
screen1.setCursorPos(11,7)
if peripheral.isPresent(da_name) == false then
screen1.setTextColor(colors.red)
screen1.write('Error')
bootcheck = false
else
screen1.setTextColor(colors.green)
screen1.write('Done')
end
os.sleep(0.1)
screen1.setCursorPos(11,8)
if peripheral.isPresent(battery_name) == false then
screen1.setTextColor(colors.red)
screen1.write('Error')
bootcheck = false
else
screen1.setTextColor(colors.green)
screen1.write('Done')
end
os.sleep(0.1)
screen1.setCursorPos(11,9)
if peripheral.isPresent(motor_name) == false then
screen1.setTextColor(colors.red)
screen1.write('Error')
bootcheck = false
else
screen1.setTextColor(colors.green)
screen1.write('Done')
end
os.sleep(0.1)
screen1.setCursorPos(12,1)
if bootcheck == false then
screen1.setTextColor(colors.red)
screen1.write('Warn')
os.sleep(5)
os.reboot()
else
screen1.setTextColor(colors.green)
screen1.write('Done')
os.sleep(1)
end
screen1.clear()
screen1.setTextScale(0.5)
screen1.setCursorPos(1,1)
screen1.setTextColor(colors.white)
screen1.write(os.version())
os.sleep(0.1)
screen1.setCursorPos(1,2)
screen1.write("LScreen")
os.sleep(0.1)
screen1.setCursorPos(1,3)
screen1.write("AUSpeaker")
os.sleep(0.1)
screen1.setCursorPos(1,4)
screen1.write("MUSpeaker")
os.sleep(0.1)
screen1.setCursorPos(1,5)
screen1.write("Fraycaster")
os.sleep(0.1)
screen1.setCursorPos(1,6)
screen1.write("Braycaster")
os.sleep(0.1)
screen1.setCursorPos(1,7)
screen1.write("WIFI")
os.sleep(0.1)
screen1.setCursorPos(1,8)
screen1.write("drive")
os.sleep(0.1)
screen1.setCursorPos(1,10)
screen1.write("check2/2")
os.sleep(0.1)
screen1.setCursorPos(11,2)
if peripheral.isPresent(Lscreen) == true and screen1width >=30 then
screen1.setTextColor(colors.green)
screen1.write('Done')
else
screen1.setTextColor(colors.red)
screen1.write('Error')
bootcheck2 = false
end
os.sleep(0.1)
screen1.setCursorPos(11,3)
if peripheral.isPresent(speaker_name) == false then
screen1.setTextColor(colors.red)
screen1.write('Error')
bootcheck2 = false
else
screen1.setTextColor(colors.green)
screen1.write('Done')
end
os.sleep(0.1)
screen1.setCursorPos(11,4)
if peripheral.isPresent(speaker1_name) == false then
screen1.setTextColor(colors.red)
screen1.write('Error')
bootcheck2 = false
else
screen1.setTextColor(colors.green)
screen1.write('Done')
end
os.sleep(0.1)
screen1.setCursorPos(11,5)
if peripheral.isPresent(frc_name) == false then
screen1.setTextColor(colors.red)
screen1.write('Error')
bootcheck2 = false
else
screen1.setTextColor(colors.green)
screen1.write('Done')
end
os.sleep(0.1)
screen1.setCursorPos(11,6)
if peripheral.isPresent(brc_name) == false then
screen1.setTextColor(colors.red)
screen1.write('Error')
bootcheck2 = false
else
screen1.setTextColor(colors.green)
screen1.write('Done')
end
os.sleep(0.1)
screen1.setCursorPos(11,7)
if peripheral.isPresent(wirelessmodem) == true then
if peripheral.wrap(wirelessmodem).isWireless() == true then
screen1.setTextColor(colors.green)
screen1.write('Done')
else
screen1.setTextColor(colors.red)
screen1.write('Error')
bootcheck2 = false
end
else
screen1.setTextColor(colors.red)
screen1.write('Error')
bootcheck2 = false
end
os.sleep(0.1)
screen1.setCursorPos(11,8)
if peripheral.isPresent(drivename) == false then
screen1.setTextColor(colors.red)
screen1.write('Error')
bootcheck2 = false
else
screen1.setTextColor(colors.green)
screen1.write('Done')
end
os.sleep(0.1)
screen1.setCursorPos(12,1)
if bootcheck2 == false then
screen1.setTextColor(colors.red)
screen1.write('Warn')
os.sleep(5)
os.reboot()
else
screen1.setTextColor(colors.green)
screen1.write('Done')
os.sleep(1)
end
local da = peripheral.wrap(da_name)
local battery = peripheral.wrap(battery_name)
local speaker = peripheral.wrap(speaker_name)
local speaker1 = peripheral.wrap(speaker1_name)
local motor = peripheral.wrap(motor_name)
local redstoneintegrator_input = peripheral.wrap(RIinput)
local redstoneintegrator_input1 = peripheral.wrap(RIinput1)
local RIoutputLeftWheelandLight = peripheral.wrap(RILWL)
local RIoutputRightWheelandLight = peripheral.wrap(RIRWL)
local pd = peripheral.wrap(playerDetector_name)
local brc = peripheral.wrap(brc_name)
local frc = peripheral.wrap(frc_name)
local dr = peripheral.wrap(drivename)
da.setTargetSpeed(0)
local padmessage = {}
local carsend = {}
local lock = true
local gear = "0"
local nextgear = "0"
local trygear = "0"
local carbreak = "on"
local disco = "f"
local disbg = "4"
--开车BGM设置
local caraudioplay = true
local diskstat = false
--电动马达各档转速设置
local motorspeedlv1 = 1
local motorspeedlv2 = 50
local motorspeedlv3 = 150
local motorspeedlv4 = 256
--显示方块设置
local data = {
block = {
minecraft = {
gold_block = "4",
torch = "4",
polished_diorite = "8",
stone = "8",
iron_ore = "8",
gravel = "8",
coal_ore = "8",
emerald_ore = "8",
waxed_cut_copper_slab = "1",
spruce_door = "1",
dirt = "1",
oak_planks = "c",
lectern = "c",
oak_log = "c",
acacia_log = "c",
grass_block = "d",
grass = "d",
tall_grass = "d",
oak_leaves = "5",
acacia_leaves = "5",
crimson_planks = "a",
},
create = {
andesite_casing = "c",
industrial_iron_block = "7"
}
}
}
local item = {}
local backitem = {}
local backwebitem = {}
local wpix = ""
local RPM = 0
local ownercheck={}
local TRPM = 0
local percent = 100
local function display3number(number)
return string.format("%03d", number)
end
ship.setName(carname)
rednet.open(wirelessmodem)
local batterylink = "off"
local musicpause = "on"
local dfpwm = require("cc.audio.dfpwm")
local musicdirectory = "music/"
local decoder = dfpwm.make_decoder()
local odiskstat = false
local motorspeed = motorspeedlv1
fs.makeDir('music')
local musicfiles = fs.list("music")
local nowplaymusic = 1
local allmusic = #musicfiles
local nowplayname = "PLAY"
local displaymusicname = {}
local currentIndex = 1
local mindistance = 0
local alldistance = {}
local carpos = ship.getWorldspacePosition()
local lockpos1 = {}
local lockpos2 = {}
lockpos1.x = carpos.x + lockrange
lockpos1.y = carpos.y + lockrange
lockpos1.z = carpos.z + lockrange
lockpos2.x = carpos.x - lockrange
lockpos2.y= carpos.y - lockrange
lockpos2.z = carpos.z - lockrange
local pos = ship.getWorldspacePosition()
local poso = pos
local posx = 0
local posy = 0
local posz = 0
local speed = 0
local displayspeed = "000"
local swheel = 0
local blackcarname = " "
local function intToHexChar(num)
return string.char(48 + num + (num > 9 and 39 or 0))
end
local namecolor1 = carnamecolor1
local namecolor2 = carnamecolor2
local displaycarname = carname
for i = 2, #displaycarname, 1 do
namecolor1 = namecolor1 .. carnamecolor1
namecolor2 = namecolor2 .. carnamecolor2
end
local euler_mode = false
local cache = true
local webcamwidth = 26
local webcamheight = 16
local backcamwidth = 15
local backcamheight = 10
local width_yaw_range = math.rad(45)
local height_pitch_range = math.rad(45)
local max_distance = 30
local vector_fov = 1
local rsinput_left = false
local rsinput_right = false
local rsinput_speedup = false
local rsinput_speeddown = false
local rsinput1_downgear = false
local rsinput_upgear = false
local batterytext = ""
local ottoup = false
local ottodown = false
local buffer = {}
local carbuffer = {}
local pix = {}
local table_insert = table.insert
local file = {}
local musicchunk = ""
local musicchunks = {}
local files = {}
local dfpwmFileFound = false
local function linspace(start, end_, num)
local linspaced = {}
if num == 0 then return linspaced end
if num == 1 then
table_insert(linspaced, start)
return linspaced
end
local delta = (end_ - start) / (num - 1)
for i = 0, num-2 do
table_insert(linspaced, start+delta*i)
end
table_insert(linspaced, end_)
return linspaced
end
local function split(inputstr, sep)
if sep == nil then sep = "%s" end
local t={}
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do table.insert(t, str) end
return t
end
local function get_pixel_normal(item)
if item.is_block then
local res = data
for _, key in ipairs(split(item.block_type, ".")) do
res = res[key]
if res == nil then return {" ", "0", "b"} end
end
if res == nil then return {" ", "0", "b"} end
return {" ", "0", res}
end
return {" ", "0", "e"}
end
local yr = 1
local xr = 1
local y_axis = {}
local x_axis = {}
local time = textutils.formatTime(os.time())
if #time == 7 then
time = 0 .. time
end
local function backrc()
backitem = brc.raycast(max_distance, {yr, -1 * xr, vector_fov}, euler_mode, true, cache, true)
return backitem
end
local basu = true
local bawsu = true
local function caraudio(nowplayaudio)
if Car_Audio == true then
if gear == nextgear and carbreak == "off" and caraudioplay == true then
for chunk in io.lines("caraudio/".. nowplayaudio ..".dfpwm", 16 * 1024) do
if gear ~= nextgear or rsinput_speedup == false or rsinput_speeddown == true or carbreak == "on" and gear ~= "0" then
speaker1.stop()
break
end
carbuffer = decoder(chunk)
while not speaker1.playAudio(carbuffer,carvol) do
os.pullEvent("speaker_audio_empty")
end
if gear ~= nextgear or rsinput_speedup == false or rsinput_speeddown == true or carbreak == "on" and gear ~= "0" then
speaker1.stop()
break
end
caraudioplay = false
end
end
if gear ~= nextgear then
for chunk in io.lines("caraudio/shiftgear.dfpwm", 16 * 1024) do
carbuffer = decoder(chunk)
while not speaker1.playAudio(carbuffer,carvol) do
os.pullEvent("speaker_audio_empty")
end
end
caraudioplay = true
end
if carbreak == "on" and gear == nextgear then
for chunk in io.lines("caraudio/handbreak.dfpwm", 16 * 1024) do
carbuffer = decoder(chunk)
while not speaker1.playAudio(carbuffer,carvol) do
os.pullEvent("speaker_audio_empty")
end
end
end
end
end
da.setTargetSpeed(0)
screen.setCursorPos(1,3)
screen.blit("-Touch-","0000000","fffffff")
local event, monitorside, mousex, mousey = os.pullEvent("monitor_touch")
screen1.clear()
screen1.setBackgroundColor(colors.cyan)
screen1.setTextScale(1)
screen1.setCursorPos(1,1)
screen1.blit("BanG...","0000999","9999999")
screen1.setCursorPos(1,2)
screen1.blit("..Dream","9900000","9999999")
screen1.setCursorPos(1,3)
screen1.blit("IT'S...","0000999","9999999")
screen1.setCursorPos(1,4)
screen1.blit("M.y.G.O","0909090","9999999")
screen1.setCursorPos(1,5)
screen1.blit("..!!!!!","9900000","9999999")
screen.clear()
screen.setCursorPos(1,1)
screen.blit("WELCOME","0000000","6666666")
screen.setCursorPos(1,2)
screen.blit(".......","cc1bbb0","cc1bbb5")
screen.setCursorPos(1,3)
screen.blit(".......","c09bb09","c39bbf9")
screen.setCursorPos(1,4)
screen.blit(".......","c090332","c098332")
screen.setCursorPos(1,5)
screen.blit(".......","b80d309","b80d309")
os.sleep(2)
screen.clear()
screen1.clear()
screen1.setBackgroundColor(colors.black)
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','0f0','f0f')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
screen.setCursorPos(1,4)
screen.blit("BREAK",'00000','eeeee')
screen.setCursorPos(5,1)
screen.blit("RPM","000","fff")
screen.setCursorPos(5,2)
screen.blit("000","000","fff")
screen.setCursorPos(4,1)
screen.blit("o","f","e")
screen.setCursorPos(4,2)
screen.blit("f","f","e")
screen.setCursorPos(4,3)
screen.blit("f","f","e")
screen.setCursorPos(1,5)
screen.blit("<PLAY>R","fffffff","63333a5")
screen.setCursorPos(5,3)
screen.blit("000","fff","999")
screen.setCursorPos(6,4)
screen.blit("KM","99","00")
screen1.setTextScale(0.5)
screen1.setCursorPos(5,3)
screen1.blit(".......","f00000f","f00000f")
screen1.setCursorPos(5,4)
screen1.blit(".......","0fffff0","0fffff0")
screen1.setCursorPos(5,5)
screen1.blit(".......","0000000","0000000")
screen1.setCursorPos(5,6)
screen1.blit(".......","0ff0ff0","0ff0ff0")
screen1.setCursorPos(5,7)
screen1.blit(".......","f00000f","f00000f")
screen1.setCursorPos(4,2)
screen1.blit("POWER",'00000','77777')
screen1.setCursorPos(9,2)
screen1.blit("1234",'0fff','5000')
screen1.setCursorPos(1,7)
screen1.blit("6.0",'fff','aaa')
screen1.setCursorPos(1,8)
screen1.blit("carOS",'000ff','ccc00')
screen1.setCursorPos(1,9)
screen1.blit("By-Misaka18848",'33f33333333333','ffffffffffffff')
screen1.setCursorPos(11,8)
screen1.blit("xLOCK",'effff','0eeee')
screen1.setCursorPos(1,10)
screen1.blit("trunoff",'fffffff','eeeeeee')
screen1.setCursorPos(8,10)
screen1.blit(".reboot.",'80000008','88888888')
screen1.setCursorPos(12,6)
screen1.blit("OTTO",'9999','7777')
screen1.setCursorPos(12,7)
screen1.blit("UPDO",'0000','8888')
local function speedGUI()
while true do
if event == "monitor_touch" and monitorside == Rscreen and lock == false then
if carbreak == "off" then
if mousex == 1 and mousey == 1 then
trygear = 'R'
mousey = -1
end
if mousex == 2 and mousey == 1 then
trygear = '2'
mousey = -1
end
if mousex == 3 and mousey == 1 then
trygear = '4'
mousey = -1
end
if mousex == 1 and mousey == 3 then
trygear = '1'
mousey = -1
end
if mousex == 2 and mousey == 3 then
trygear = '3'
mousey = -1
end
if mousex == 3 and mousey == 3 then
trygear = '5'
mousey = -1
end
end
end
os.sleep(0.01)
if event == "monitor_touch" and monitorside == Lscreen and lock == false then
if mousex <= 7 and mousey == 10 and mousex >= 1 then
screen.clear()
screen1.clear()
if LscreenTransparent == true then
screen1.setTransparentMode(false)
screen1.setTransparentColor(colors.black)
end
os.shutdown()
end
if mousex <= 15 and mousey == 10 and mousex >= 8 then
screen.clear()
screen1.clear()
if LscreenTransparent == true then
screen1.setTransparentMode(false)
screen1.setTransparentColor(colors.black)
end
os.reboot()
end
if mousex <= 11 and mousey <= 7 and mousey >=3 and mousex >= 5 then
mousey = -1
speaker1.playSound("create:whistle_low",hornsvol,2)
end
end
if carbreak =="on" then
if gear ~= nextgear then
caraudio()
if gear == "2" and nextgear == "0" then
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','0f0','f0f')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
gear = nextgear
end
if gear == "4" and nextgear == "0" then
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','00f','ff0')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
os.sleep(0.5)
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','0f0','f0f')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
gear = nextgear
end
if gear == "1" and nextgear == "0" then
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','f00','0ff')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
os.sleep(0.5)
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','0f0','f0f')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
gear = nextgear
end
if gear == "3" and nextgear == "0" then
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','0f0','f0f')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
gear = nextgear
end
if gear == "5" and nextgear == "0" then
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','00f','ff0')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
os.sleep(0.5)
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','0f0','f0f')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
gear = nextgear
end
if gear == "R" and nextgear == "0" then
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','f00','0ff')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
os.sleep(0.5)
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','0f0','f0f')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
gear = nextgear
end
end
end
if carbreak =="off" then
if gear ~= nextgear then
caraudio()
if gear == "0" and nextgear == "R" then
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','f00','0ff')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
os.sleep(0.5)
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","f00","0ff")
screen.setCursorPos(1,2)
screen.blit('|+|','000','fff')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
gear = nextgear
end
if gear == "0" and nextgear == "2" then
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","0f0","f0f")
screen.setCursorPos(1,2)
screen.blit('|+|','000','fff')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
gear = nextgear
end
if gear == "0" and nextgear == "4" then
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','00f','ff0')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
os.sleep(0.5)
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","00f","ff0")
screen.setCursorPos(1,2)
screen.blit('|+|','000','fff')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
gear = nextgear
end
if gear == "0" and nextgear == "1" then
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','f00','0ff')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
os.sleep(0.5)
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','000','fff')
screen.setCursorPos(1,3)
screen.blit('135','f00','0ff')
gear = nextgear
end
if gear == "0" and nextgear == "3" then
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','000','fff')
screen.setCursorPos(1,3)
screen.blit('135','0f0','f0f')
gear = nextgear
end
if gear == "0" and nextgear == "5" then
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','00f','ff0')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
os.sleep(0.5)
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','000','fff')
screen.setCursorPos(1,3)
screen.blit('135','00f','ff0')
gear = nextgear
end
if gear == "R" and nextgear == "2" then
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','f00','0ff')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
os.sleep(0.5)
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','0f0','f0f')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
os.sleep(0.5)
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","0f0","f0f")
screen.setCursorPos(1,2)
screen.blit('|+|','000','fff')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')
gear = nextgear
end
if gear == "R" and nextgear == "4" then
screen.setTextScale(1)
screen.setCursorPos(1,1)
screen.blit("R24","000","fff")
screen.setCursorPos(1,2)
screen.blit('|+|','f00','0ff')
screen.setCursorPos(1,3)
screen.blit('135','000','fff')