Advertisement
9551

button backup

Jul 1st, 2021
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.66 KB | None | 0 0
  1. ----------------------MENU/PANEL API-------------------
  2. --------------------by elektrobom1!--------------------
  3. ---Copyright (c) 2021-2022 9551------------9551#0001---
  4. ---using this code in your project is fine!------------
  5. ---as long as you dont claim you made it---------------
  6. ---im cool with it, feel free to include---------------
  7. ---in your projects! discord: 9551#0001--------------
  8. ---you dont have to but giving credits is nice :)------
  9. -------------------------------------------------------
  10. -------------------------------------------------------
  11. --*! pastebin get LTDZZZEJ button
  12.  
  13. --*functions usages
  14. --*API(ins, cord1, cord2, length, height)
  15. --*timetouch(timeout,monitor)
  16. --*touch()
  17. --*button(monitor, ins, cord1, cord2, text)
  18. --*counter(monitor, ins, cc, cord1, cord2, cv, max, min, col)
  19. --*fill(monitor, pos1, pos2, length, height)
  20. --*switch(monitor, ccins, pos1, pos2, col1, col2, col3, text)
  21. --*switchn(monitor, cc, ins, pos1, pos2, col1, col2, col3, text, text2)
  22. --*bundle(side, color, state)
  23. --*signal(side, ins, col)
  24. --*sliderVer/Hor(monitor, ins, cc, pos1, pos2, length, color1, textCol)
  25. --*local function menu(monitor, ins, cc, x, y, textcol, switchcol, text, returns1, more, returns2) (returns menuout)
  26. --*bar(monitor, pos1, pos2, length, height, ins, max, color1, color2, color3, printval, hor, text, format, rect, thicc)
  27. --*timeswitch(monitor, ins, cc, pos1, pos2, change, start, col1, col2, col3, repeats)
  28. --*render(monitor,text,x,y,textcol,backCol)
  29. --*menudata()
  30. --*frame(monitor, pos1, pos2, length, height, color3, color1, thicc)
  31. --*db allows you to get stored data from all functions that use stored data!
  32. --*how to use db: in your function for example switch you do b.switch("db",<data>) data is the storing position you want to get data of
  33.  
  34.  
  35. --base API this API is made for detecting clicks in an area
  36. local function API(ins, cord1, cord2, length, height)
  37. if ins == true then
  38. ins = {os.pullEvent("monitor_touch")}
  39. end
  40. if ins[3] >= cord1 and ins[3] <= cord1 + length-1 then
  41. if ins[4] >= cord2 and ins[4] <= cord2 + height-1 then
  42. return true
  43. else
  44. return false
  45. end
  46. end
  47. end
  48.  
  49.  
  50. local function touch()
  51. local dats = {os.pullEvent("monitor_touch")}
  52. return dats
  53. end
  54.  
  55. local function timetouch(timeout, monitor)
  56. local timer = os.startTimer(timeout)
  57. while true do
  58. local event = {os.pullEvent()}
  59. if (event[1] == "timer") and (event[2] == timer) then
  60. if monitor == nil then
  61. local monitor = "timeout"
  62. end
  63. return {"timeout", monitor, 1000, 1000}
  64. elseif (event[1] == "monitor_touch") and (event[2] == monitor) then
  65. return {event[1], event[2], event[3], event[4]}
  66. end
  67. end
  68. end
  69.  
  70. -------------------------------------------------------------------------------------------------
  71.  
  72. local function button(monitor, ins, cord1, cord2, text)
  73. if ins[2] == monitor then
  74. if ins ~= nil then
  75. m = peripheral.wrap(monitor)
  76. x = API(ins, cord1, cord2, string.len(text), 1)
  77. m.setCursorPos(cord1, cord2)
  78. m.write(text)
  79. return x
  80. end
  81. end
  82. end
  83.  
  84. local function counter(monitor, ins, cc, cord1, cord2, cv, max, min, col)
  85. if monitor == "db" then
  86. if data == nil then
  87. return nil
  88. else
  89. return data[ins]
  90. end
  91. end
  92. if monitor == "setdb" then
  93. if data == nil then
  94. return "no data to edit"
  95. else
  96. data[ins] = cc
  97. return("value changed too "..type(cc))
  98. end
  99. end
  100. if ins[2] == monitor then
  101. if ins ~= nil then
  102. local m = peripheral.wrap(monitor)
  103. if data == nil then
  104. data = {}
  105. for is = 0, 1000 do
  106. data[is] = 0
  107. end
  108. end
  109. m.setCursorPos(cord1, cord2)
  110. m.write("\24" .. " " .. data[cc])
  111. m.setCursorPos(cord1, cord2 + 1)
  112. m.write("\25")
  113. if API(ins, cord1, cord2, 1, 1) == true then
  114. if data[cc] < max then
  115. data[cc] = data[cc] + cv
  116. m.setCursorPos(cord1, cord2)
  117. m.setTextColor(colors.green)
  118. m.write("\24" .. " " .. data[cc] .. " ")
  119. m.setCursorPos(cord1, cord2 + 1)
  120. m.setTextColor(colors.red)
  121. m.write("\25")
  122. m.setTextColor(colors[col])
  123. return data[cc]
  124. end
  125. end
  126. end
  127. if API(ins, cord1, cord2 + 1, 1, 1) == true then
  128. if data[cc] > min then
  129. data[cc] = data[cc] - cv
  130. m.setCursorPos(cord1, cord2)
  131. m.setTextColor(colors.green)
  132. m.write("\24" .. " " .. data[cc] .. " ")
  133. m.setCursorPos(cord1, cord2 + 1)
  134. m.setTextColor(colors.red)
  135. m.write("\25")
  136. m.setTextColor(colors[col])
  137. return data[cc]
  138. end
  139. end
  140. end
  141. end
  142.  
  143. local function fill(monitor, pos1, pos2, length, height)
  144. local m = peripheral.wrap(monitor)
  145. for x = 0, height - 1 do
  146. m.setCursorPos(pos1, pos2 + x)
  147. m.write(string.rep(" ", length))
  148. end
  149. end
  150.  
  151. local function switch(monitor, cc, ins, pos1, pos2, col1, col2, col3, text)
  152. if monitor == "db" then
  153. if data1 == nil then
  154. return nil
  155. else
  156. return data1[cc]
  157. end
  158. end
  159. if monitor == "setdb" then
  160. if data1 == nil then
  161. return "no data to edit"
  162. else
  163. data1[cc] = ins
  164. return("value changed too "..type(ins))
  165. end
  166. end
  167. if ins[2] == monitor then
  168. if ins ~= nil then
  169. local re = string.len(text)
  170. local m = peripheral.wrap(monitor)
  171. if data1 == nil then
  172. data1 = {}
  173. for is = 0, 1000 do
  174. data1[is] = false
  175. end
  176. end
  177. local function ff()
  178. data1[cc] = not data1[cc]
  179. end
  180. if API(ins, pos1, pos2, string.len(text), 1) == true then
  181. ff()
  182. end
  183. local oldcol1 = m.getTextColor()
  184. local oldcol2 = m.getBackgroundColor()
  185. if data1[cc] == true then
  186. m.setBackgroundColor(colors[col2])
  187. else
  188. m.setBackgroundColor(colors[col1])
  189. end
  190. m.setCursorPos(pos1, pos2)
  191. m.setTextColor(colors[col3])
  192. m.write(text)
  193. m.setTextColor(oldcol1)
  194. m.setBackgroundColor(oldcol2)
  195. return (data1[cc])
  196. end
  197. end
  198. end
  199.  
  200. local function switchn(monitor, cc, ins, pos1, pos2, col1, col2, col3, text, text2)
  201. if monitor == "db" then
  202. if data2 == nil then
  203. return nil
  204. else
  205. return data2[cc]
  206. end
  207. end
  208. if monitor == "setdb" then
  209. if data2 == nil then
  210. return "no data to edit"
  211. else
  212. data2[cc] = ins
  213. return("value changed too "..type(ins))
  214. end
  215. end
  216.  
  217. if ins[2] == monitor then
  218. if ins ~= nil then
  219. local re = string.len(text)
  220. if string.len(text) ~= string.len(text2) then
  221. if string.len(text) > string.len(text2) then
  222. re = string.len(text)
  223. else
  224. re = string.len(text2)
  225. end
  226. end
  227. local m = peripheral.wrap(monitor)
  228. if data2 == nil then
  229. data2 = {}
  230. for is = 0, 1000 do
  231. data2[is] = false
  232. end
  233. end
  234. local function ff()
  235. data2[cc] = not data2[cc]
  236. end
  237. if API(ins, pos1, pos2, re, 1) == true then
  238. ff()
  239. end
  240. local oldcol1 = m.getTextColor()
  241. local oldcol2 = m.getBackgroundColor()
  242. if data2[cc] == true then
  243. m.setCursorPos(pos1, pos2)
  244. if string.len(text) ~= string.len(text2) then
  245. m.write(string.rep(" ", re))
  246. end
  247. m.setBackgroundColor(colors[col2])
  248. m.setCursorPos(pos1, pos2)
  249. m.setTextColor(colors[col3])
  250. m.write(text2)
  251. else
  252. m.setCursorPos(pos1, pos2)
  253. if string.len(text) ~= string.len(text2) then
  254. m.write(string.rep(" ", re))
  255. end
  256. m.setBackgroundColor(colors[col1])
  257. m.setCursorPos(pos1, pos2)
  258. m.setTextColor(colors[col3])
  259. m.write(text)
  260. end
  261. m.setTextColor(oldcol1)
  262. m.setBackgroundColor(oldcol2)
  263. return (data2[cc])
  264. end
  265. end
  266. end
  267. -- bundle cable APIs for using main API with bundled cables
  268. local function bundle(side, color, state)
  269. if (type(side) == "string") and (type(color) == "number") and (type(state) == "boolean") then
  270. if state == true then
  271. rs.setBundledOutput(side, colors.combine(rs.getBundledOutput(side), color))
  272. elseif state == false then
  273. rs.setBundledOutput(side, colors.subtract(rs.getBundledOutput(side), color))
  274. end
  275. else
  276. error("please use like this:\nbundle(side:string,colors.(color),state:boolean)")
  277. end
  278. end
  279.  
  280. local function signal(side, ins, col, func)
  281. if ins == "clear" then
  282. rs.setBundledOutput(side, 0)
  283. else
  284. if func == true then
  285. if ins == "on" then
  286. ins = true
  287. end
  288. if ins == "nil" then
  289. ins = false
  290. end
  291. end
  292. if ins ~= nil then
  293. if ins == true then
  294. bundle(side, col, true)
  295. elseif ins == false then
  296. bundle(side, col, false)
  297. end
  298. end
  299. end
  300. end
  301. -------------------------------------------------------------------------------------------------
  302.  
  303. local function sliderHor(monitor, ins, cc, pos1, pos2, length, color1, textCol)
  304. if monitor == "db" then
  305. if data3 == nil then
  306. return nil
  307. else
  308. return data3[ins]
  309. end
  310. end
  311. if monitor == "setdb" then
  312. if data3 == nil then
  313. return "no data to edit"
  314. else
  315. data3[ins] = cc
  316. return("value changed too "..type(cc))
  317. end
  318. end
  319. if ins[2] == monitor then
  320. if ins ~= nil then
  321. m = peripheral.wrap(monitor)
  322. local oldcol1 = m.getBackgroundColor()
  323. local oldcol2 = m.getTextColor()
  324. m.setBackgroundColor(colors[color1])
  325. m.setTextColor(colors[textCol])
  326. m.setCursorPos(pos1, pos2)
  327. for i = 0, length do
  328. m.write("-")
  329. m.setCursorPos(pos1 + i, pos2)
  330. end
  331. if data3 == nil then
  332. data3 = {}
  333. for is = 0, 1000 do
  334. data3[is] = 0
  335. end
  336. end
  337. local cp = (ins[3])
  338. if (ins[4] == pos2) and (ins[3] >= pos1) and (ins[3] <= (pos1 + length) - 1) then
  339. m.setCursorPos(cp, pos2)
  340. data3[cc] = cp
  341. m.write("|")
  342. else
  343. m.setCursorPos(data3[cc], pos2)
  344. m.write("|")
  345. end
  346. m.setBackgroundColor(oldcol1)
  347. m.setTextColor(oldcol2)
  348. if data3[cc] - pos1 >= 0 then
  349. return (data3[cc] - pos1)
  350. elseif data3[cc] - pos1 < 0 then
  351. return 0
  352. end
  353. end
  354. end
  355. end
  356.  
  357. local function sliderVer(monitor, ins, cc, pos1, pos2, length, color1, textCol)
  358. if monitor == "db" then
  359. if data10 == nil then
  360. return nil
  361. else
  362. return data10[ins]
  363. end
  364. end
  365. if monitor == "setdb" then
  366. if data10 == nil then
  367. return "no data to edit"
  368. else
  369. data10[ins] = cc
  370. return("value changed too "..type(cc))
  371. end
  372. end
  373. if ins[2] == monitor then
  374. if ins ~= nil then
  375. m = peripheral.wrap(monitor)
  376. local oldcol1 = m.getBackgroundColor()
  377. local oldcol2 = m.getTextColor()
  378. m.setBackgroundColor(colors[color1])
  379. m.setTextColor(colors[textCol])
  380. m.setCursorPos(pos1, pos2)
  381. for i = 0, length do
  382. m.write("\124")
  383. m.setCursorPos(pos1, pos2 - i)
  384. end
  385. if data10 == nil then
  386. data10 = {}
  387. for is = 0, 1000 do
  388. data10[is] = 0
  389. end
  390. end
  391. local cp = ins[4]
  392. if (ins[3] == pos1) and (ins[4] <= pos2) and (ins[4] >= (pos2 - length) + 1) then
  393. m.setCursorPos(pos1, cp)
  394. data10[cc] = cp
  395. m.write("\xad")
  396. else
  397. m.setCursorPos(pos1, data10[cc])
  398. m.write("\xad")
  399. end
  400. m.setBackgroundColor(oldcol1)
  401. m.setTextColor(oldcol2)
  402. if data10[cc] - pos1 >= 0 then
  403. return (data10[cc] - pos1)
  404. elseif data10[cc] - pos1 < 0 then
  405. return 0
  406. end
  407. end
  408. end
  409. end
  410.  
  411. local function render(monitor, text, x, y, textcol, backCol)
  412. local m = peripheral.wrap(monitor)
  413. local oldcol1 = m.getBackgroundColor()
  414. local oldcol2 = m.getTextColor()
  415. local cur = {m.getCursorPos()}
  416. m.setTextColor(colors[textcol])
  417. if type(backCol) == "string" then
  418. m.setBackgroundColor(colors[backCol])
  419. elseif type(backCol) == "number" then
  420. m.setBackgroundColor(backCol)
  421. end
  422. m.setCursorPos(x, y)
  423. m.write(text)
  424. m.setBackgroundColor(oldcol1)
  425. m.setTextColor(oldcol2)
  426. m.setCursorPos(cur[1], cur[2])
  427. end
  428.  
  429. local function menu(monitor, ins, cc, x, y, textcol, switchcol, text, returns1, more, returns2)
  430. if ins[2] == monitor then
  431. if thisIsUseless == nil then
  432. for i = 0, 1000 do
  433. thisIsUseless = {}
  434. thisIsUseless[i] = false
  435. end
  436. end
  437. if not thisIsUseless[cc] then
  438. render(monitor, text, x, y, textcol, oldcol2)
  439. end
  440. if ins ~= nil then
  441. local m = peripheral.wrap(monitor)
  442. local oldcol1 = m.getTextColor()
  443. local oldcol2 = m.getBackgroundColor()
  444. local l = string.len(text)
  445. if ins[1] ~= "timeout" then
  446. if data4 == nil then
  447. data4 = {}
  448. for is = 0, 1000 do
  449. data4[is] = false
  450. end
  451. end
  452. if data5 == nil then
  453. data5 = {}
  454. for is = 0, 1000 do
  455. data5[is] = false
  456. end
  457. end
  458. if data6 == nil then
  459. data6 = {}
  460. for is = 0, 1000 do
  461. data6[is] = false
  462. end
  463. end
  464. if API(ins, x, y, l, 1) == true then
  465. data4[cc] = text
  466. data5[cc] = x
  467. data6[cc] = y
  468. local function menus()
  469. for i = 1, 500 do
  470. if data4[i] ~= false then
  471. m.setBackgroundColor(oldcol2)
  472. m.setCursorPos(data5[i], data6[i])
  473. m.setTextColor(colors[textcol])
  474. m.write(data4[i])
  475. end
  476. end
  477. local i = 0
  478. end
  479. menus()
  480. m.setCursorPos(data5[cc], data6[cc])
  481. m.setBackgroundColor(colors[switchcol])
  482. m.setTextColor(colors[textcol])
  483. m.write(text)
  484. m.setTextColor(oldcol1)
  485. m.setBackgroundColor(oldcol2)
  486. menuout = text
  487. if returns1 == nil then
  488. return menuout
  489. else
  490. if (more == nil) or (more == false) then
  491. menuout = returns1
  492. return menuout
  493. else
  494. menuout = {
  495. returns1,
  496. returns2
  497. }
  498. if menuout == nil then
  499. return 0
  500. end
  501. return menuout
  502. end
  503. end
  504. end
  505. end
  506. end
  507. end
  508. thisIsUseless[cc] = true
  509. if more == true then
  510. if menuout == nil then
  511. menuout = {returns1, "nil"}
  512. end
  513. end
  514. end
  515.  
  516. local function menudata()
  517. if menuout ~= nil then
  518. return menuout
  519. else
  520. return "no output"
  521. end
  522. end
  523.  
  524. local function timeswitch(monitor, ins, cc, pos1, pos2, change, start, col1, col2, col3, repeats)
  525. if monitor == "db" then
  526. if data7 == nil then
  527. return nil
  528. else
  529. return data7[ins]
  530. end
  531. end
  532. if monitor == "setdb" then
  533. if data7 == nil then
  534. return "no data to edit"
  535. else
  536. data7[ins] = cc
  537. return("value changed too "..type(cc))
  538. end
  539. end
  540. if ins[2] == monitor then
  541. if ins ~= nil then
  542. local m = peripheral.wrap(monitor)
  543. local oldcol1 = m.getTextColor()
  544. local oldcol2 = m.getBackgroundColor()
  545. m.setBackgroundColor(colors[col2])
  546. m.setTextColor(colors[col1])
  547. if data7 == nil then
  548. data7 = {}
  549. for is = 0, 1000 do
  550. data7[is] = false
  551. end
  552. end
  553. if data8 == nil then
  554. data8 = {}
  555. for is = 0, 1000 do
  556. data8[is] = false
  557. end
  558. end
  559. if data8[cc] == false then
  560. data8[cc] = start
  561. m.setCursorPos(pos1 + 6, pos2)
  562. m.write(data8[cc])
  563. end
  564. m.setCursorPos(pos1, pos2)
  565. m.write("start")
  566. if API(ins, pos1, pos2, 4, 1) == true then
  567. data7[cc] = true
  568. end
  569. if data7[cc] == true then
  570. if data8[cc] > 0 then
  571. repeat
  572. timeOut = data8[cc]
  573. m.setBackgroundColor(colors[col3])
  574. data8[cc] = data8[cc] - change
  575. m.setCursorPos(pos1 + 6, pos2)
  576. sleep(1)
  577. m.write(data8[cc])
  578. until data8[cc] == 0
  579. return "ended"
  580. end
  581. end
  582. if repeats == true then
  583. data8[cc] = start
  584. end
  585. m.setBackgroundColor(colors[col2])
  586. m.setCursorPos(pos1 + 6, pos2)
  587. m.write(data8[cc])
  588. m.setTextColor(oldcol1)
  589. m.setBackgroundColor(oldcol2)
  590. end
  591. end
  592. end
  593.  
  594. local function bar(
  595. monitor,
  596. pos1,
  597. pos2,
  598. length,
  599. height,
  600. ins,
  601. max,
  602. color1,
  603. color2,
  604. color3,
  605. printval,
  606. hor,
  607. text,
  608. format,
  609. rect,
  610. thicc)
  611. if (ins == nil) or (ins < 0) then
  612. ins = 0
  613. end
  614. if format == nil then
  615. local format = false
  616. end
  617. if ins ~= nil then
  618. local m = peripheral.wrap(monitor)
  619. oldcol = m.getBackgroundColor()
  620. oldcol1 = m.getTextColor()
  621. m.setTextColor(colors[color3])
  622. local function reprint()
  623. m.setBackgroundColor(colors[color1])
  624. fill(monitor, pos1 - 1, pos2 - height, length, height * 2)
  625. m.setBackgroundColor(oldcol)
  626. xm = m.getBackgroundColor()
  627. xb = m.getTextColor()
  628. m.setTextColor(xm)
  629. m.setBackgroundColor(xb)
  630. m.setCursorPos(pos1 - 1, pos2 - height)
  631. if thicc then
  632. m.setBackgroundColor(colors[color3])
  633. end
  634. if thicc then
  635. m.write(string.rep("\x83", length + 1)) --\143
  636. m.setTextColor(xb)
  637. m.setBackgroundColor(xm)
  638. else
  639. m.write("\159" .. string.rep("\143", length - 1)) --\x83
  640. m.setTextColor(xb)
  641. m.setBackgroundColor(xm)
  642. m.write("\144")
  643. end
  644. if thicc then
  645. m.setBackgroundColor(colors[color3])
  646. end
  647. m.setCursorPos(pos1 - 1, pos2 + height)
  648. if thicc then
  649. m.write(string.rep("\x8c", length + 1)) --\131
  650. else
  651. m.write("\130" .. string.rep("\131", length - 1) .. "\129") --\x8c
  652. end
  653. for i = 0, (height * 2) - 2 do
  654. if not thicc then
  655. m.setTextColor(xm)
  656. m.setBackgroundColor(xb)
  657. end
  658. m.setCursorPos(pos1 - 1, (pos2 + i) - (height) + 1)
  659. if thicc then
  660. m.setBackgroundColor(colors[color3])
  661. end
  662. m.write("\x95")
  663. m.setCursorPos((pos1 - 2) + (length + 1), (pos2 + i) - (height) + 1)
  664. if not thicc then
  665. m.setTextColor(xb)
  666. m.setBackgroundColor(xm)
  667. end
  668. m.write("\x95")
  669. end
  670. end
  671. if rect ~= false then
  672. reprint()
  673. else
  674. fill(monitor, pos1 - 1, pos2 - height, length, height * 2)
  675. end
  676. local drawLength = ins / max * length
  677. local drawHeights = ins / max * height
  678. local drawHeight = math.ceil(drawHeights)
  679. local moveval = (drawHeight * 2) - 2
  680. local z = pos2 + height
  681. m.setBackgroundColor(colors[color2])
  682. if (hor == false) or (hor == nil) then
  683. fill(monitor, pos1, (pos2 - height) + 1, drawLength - 1, (height * 2) - 1)
  684. else
  685. fill(monitor, pos1, (z - 1) - moveval, length - 1, moveval + 1)
  686. end
  687. if printval == true then
  688. m.setCursorPos(pos1, pos2)
  689. m.setTextColor(colors[color3])
  690. if hor == true then
  691. if format then
  692. if ins >= max / 2 then
  693. m.setBackgroundColor(colors[color2])
  694. else
  695. m.setBackgroundColor(colors[color1])
  696. end
  697. else
  698. if ins >= (max / 2) - (max / height) then
  699. m.setBackgroundColor(colors[color2])
  700. else
  701. m.setBackgroundColor(colors[color1])
  702. end
  703. end
  704. elseif hor == false then
  705. m.setCursorPos(pos1, pos2)
  706. m.setTextColor(colors[color3])
  707. if hor == true then
  708. if ins >= 1 then
  709. m.setBackgroundColor(colors[color2])
  710. else
  711. m.setBackgroundColor(colors[color1])
  712. end
  713. end
  714. end
  715. if format then
  716. m.write(ins .. "/" .. max)
  717. m.setCursorPos(pos1, pos2 + 1)
  718. m.write(text)
  719. else
  720. m.write(ins .. "/" .. max .. " " .. text)
  721. end
  722. m.setBackgroundColor(oldcol)
  723. m.setTextColor(oldcol1)
  724. end
  725. m.setTextColor(oldcol1)
  726. m.setBackgroundColor(oldcol)
  727. end
  728. end
  729.  
  730. local function frame(monitor, pos1, pos2, length, height, color3, color1, thicc)
  731. local m = peripheral.wrap(monitor)
  732. local oldcol = m.getBackgroundColor()
  733. local oldcol1 = m.getTextColor()
  734. m.setBackgroundColor(colors[color1])
  735. fill(monitor, pos1 - 1, pos2 - height, length, height * 2)
  736. m.setBackgroundColor(oldcol)
  737. xm = m.getBackgroundColor()
  738. xb = m.getTextColor()
  739. m.setTextColor(xm)
  740. m.setBackgroundColor(xb)
  741. m.setCursorPos(pos1 - 1, pos2 - height)
  742. if thicc then
  743. m.setBackgroundColor(colors[color3])
  744. m.setTextColor(oldcol)
  745. m.write(string.rep("\x83", length + 1)) --\143
  746. m.setTextColor(xb)
  747. m.setBackgroundColor(xm)
  748. else
  749. m.setTextColor(oldcol)
  750. m.setBackgroundColor(colors[color3])
  751. m.write("\159" .. string.rep("\143", length - 1)) --\x83
  752. m.setTextColor(colors[color3])
  753. m.setBackgroundColor(oldcol)
  754. m.write("\144")
  755. end
  756. m.setCursorPos(pos1 - 1, pos2 + height)
  757. if thicc then
  758. m.setBackgroundColor(oldcol)
  759. m.setTextColor(colors[color3])
  760. m.write(string.rep("\x8f", length + 1)) --\131
  761. m.setBackgroundColor(colors[color1])
  762. m.setTextColor(colors[color3])
  763. else
  764. m.write("\130" .. string.rep("\131", length - 1) .. "\129") --\x8c
  765. end
  766. for i = 0, (height * 2) - 2 do
  767. if not thicc then
  768. m.setTextColor(xm)
  769. m.setBackgroundColor(xb)
  770. end
  771. m.setCursorPos(pos1 - 1, (pos2 + i) - (height) + 1)
  772. if thicc then
  773. m.setBackgroundColor(colors[color3])
  774. end
  775. m.setBackgroundColor(colors[color3])
  776. m.write("\x95")
  777. m.setCursorPos((pos1 - 2) + (length + 1), (pos2 + i) - (height) + 1)
  778. if not thicc then
  779. m.setTextColor(xb)
  780. m.setBackgroundColor(xm)
  781. end
  782. m.setTextColor(colors[color3])
  783. m.write("\x95")
  784. end
  785. m.setBackgroundColor(oldcol)
  786. m.setTextColor(oldcol1)
  787. end
  788.  
  789. return {
  790. bundle = bundle,
  791. API = API,
  792. counter = counter,
  793. switch = switch,
  794. button = button,
  795. switchn = switchn,
  796. signal = signal,
  797. sliderVer = sliderVer,
  798. timeswitch = timeswitch,
  799. menu = menu,
  800. bar = bar,
  801. fill = fill,
  802. touch = touch,
  803. timetouch = timetouch,
  804. sliderHor = sliderHor,
  805. render = render,
  806. menudata = menudata,
  807. frame = frame
  808. }
  809.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement