HDR

Music System 2.4 Infinity Evolved

HDR
Aug 20th, 2017
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.86 KB | None | 0 0
  1. --# Made By HDR - @MartinRefseth #--
  2. --# Version 2.4#--
  3. --# Thanks to Lyqyd for his Button API http://www.computercraft.info/forums2/index.php?/topic/14784-touchpoint-api/ #--
  4. os.loadAPI("touchpoint")
  5. for a,b in pairs(rs.getSides()) do
  6.   if peripheral.getType(b) == 'monitor' then
  7.    page1 = touchpoint.new(b)
  8.    page2 = touchpoint.new(b)
  9.    mainColr = touchpoint.new(b)
  10.    textColr = touchpoint.new(b)
  11.    backColr = touchpoint.new(b)
  12.    local t
  13.    break
  14.   end
  15. end
  16.  
  17. if fs.exists("mainColor") == true then
  18. -- Do Nothing --
  19. else
  20.  setMain = fs.open("mainColor", "w")
  21.   setMain.write("512")
  22.   setMain.close()
  23. end
  24. mainColRead = io.open( "mainColor", "r" )
  25.   mainColSet = mainColRead:read("*a")
  26.   mainColRead:close()
  27.   mainCol = tonumber(mainColSet)
  28.  
  29. if fs.exists("textColor") == true then
  30. -- Do Nothing --
  31. else
  32.  setText = fs.open("textColor", "w")
  33.   setText.write("2")
  34.   setText.close()
  35. end
  36. textColRead = io.open( "textColor", "r" )
  37.   textColSet = textColRead:read("*a")
  38.   textColRead:close()
  39.   textCol = tonumber(textColSet)
  40.  
  41. if fs.exists("backColor") == true then
  42. -- Do Nothing --
  43. else
  44.  setBack = fs.open("backColor", "w")
  45.   setBack.write("128")
  46.   setBack.close()
  47. end
  48. backColRead = io.open( "backColor", "r" )
  49.   backColSet = backColRead:read("*a")
  50.   backColRead:close()
  51.   backCol = tonumber(backColSet)
  52.  
  53.  
  54. --# Functions
  55. function tpoint()
  56.   t = tpage
  57. --#OverWrites Part Of Touchpoint API#--
  58.     t.draw = function(self)
  59.       local function cT(text)
  60.         x,y = term.getSize()
  61.         x1,y1 = term.getCursorPos()
  62.         term.setCursorPos((math.floor(x/2) - (math.floor(#text/2))), y1)
  63.         term.write(text)
  64.      end
  65.                 local old = term.redirect(self.mon)
  66.                 term.setTextColor(colors.white)
  67.                 term.setBackgroundColor(backCol)
  68.                 term.clear()
  69.                 term.setCursorPos(1,1)
  70.                 term.setTextColor(textCol)
  71.                 cT(header)
  72.                 for name, buttonData in pairs(self.buttonList) do
  73.                         if buttonData.active then
  74.                                 term.setBackgroundColor(buttonData.activeColor)
  75.                                 term.setTextColor(buttonData.activeText)
  76.                         else
  77.                                 term.setBackgroundColor(buttonData.inactiveColor)
  78.                                 term.setTextColor(buttonData.inactiveText)
  79.                         end
  80.                         for i = buttonData.yMin, buttonData.yMax do
  81.                                 term.setCursorPos(buttonData.xMin, i)
  82.                                 term.write(buttonData.label[i - buttonData.yMin + 1])
  83.                         end
  84.                 end
  85.                 if old then
  86.                         term.redirect(old)
  87.                 else
  88.                         term.restore()
  89.                 end
  90.         end
  91. end
  92.  
  93. function colWrite()
  94.  setMain = fs.open("mainColor", "w")
  95.   setMain.write(colNum)
  96.   setMain.close()
  97.  os.reboot()
  98. end
  99.  
  100. function tcolWrite()
  101.  setText = fs.open("textColor", "w")
  102.   setText.write(colNum)
  103.   setText.close()
  104.  os.reboot()
  105. end
  106.  
  107. function bcolWrite()
  108.  setBack = fs.open("backColor", "w")
  109.   setBack.write(colNum)
  110.   setBack.close()
  111.  os.reboot()
  112. end
  113.  
  114. function play()
  115.  peripheral.find("drive", disk.stopAudio)
  116.  peripheral.find( "drive", function( name )
  117.   if disk.hasAudio( name ) and disk.getAudioTitle( name ) == title then
  118.     print("Now Playing"," ",( title) )
  119.     disk.playAudio( name )
  120.   end
  121.  end )
  122. end  
  123.  
  124. function Thir()
  125.    t:flash("13")
  126.    title = "C418 - 13"
  127.    play()
  128. end
  129.  
  130. function Cat()
  131.    t:flash("Cat")
  132.    title = "C418 - cat"
  133.    play()
  134. end
  135.  
  136. function Blocks()
  137.    t:flash("Blocks")
  138.    title = "C418 - blocks"
  139.    play()
  140. end  
  141.  
  142. function Chirp()
  143.    t:flash("Chirp")
  144.    title = "C418 - chirp"
  145.    play()
  146. end  
  147.  
  148. function Far()
  149.    t:flash("Far")
  150.    title = "C418 - far"
  151.    play()
  152. end
  153.  
  154. function Mall()
  155.    t:flash("Mall")
  156.    title = "C418 - mall"
  157.    play()
  158. end
  159.  
  160. function Mellohi()
  161.    t:flash("Mellohi")
  162.    title = "C418 - mellohi"
  163.    play()
  164. end
  165.  
  166. function Stal()
  167.    t:flash("Stal")
  168.    title = "C418 - stal"
  169.    play()
  170. end
  171.  
  172. function Strad()
  173.    t:flash("Strad")
  174.    title = "C418 - strad"
  175.    play()
  176. end
  177.    
  178. function Ward()
  179.    t:flash("Ward")
  180.    title = "C418 - ward"
  181.    play()
  182. end
  183.  
  184. function Elev()
  185.    t:flash("11")
  186.    title = "C418 - 11"
  187.    play()
  188. end
  189.  
  190. function Wait()
  191.    t:flash("Wait")
  192.    title = "C418 - wait"
  193.    play()
  194. end
  195.  
  196. function Question()
  197.    t:flash("???")
  198.    title = "corruption"
  199.    play()
  200. end
  201.  
  202. function GaiaOne()
  203.    t:flash("Gaia 1")
  204.    title = "botania:gaia1"
  205.    play()
  206. end
  207.  
  208. function GaiaTwo()
  209.    t:flash("Gaia 2")
  210.    title = "botania:gaia2"
  211.    play()
  212. end
  213.  
  214. function Roop()
  215.    t:flash("R-Loop")
  216.    title = "portalgun:records.radioloop"
  217.    play()
  218. end
  219.  
  220. function Slive()
  221.    t:flash("S-Alive")
  222.    title = "portalgun:records.stillalive"
  223.    play()
  224. end
  225.  
  226. function WYG()
  227.    t:flash("WYG")
  228.    title = "portalgun:records.wantyougone"
  229.    play()
  230. end
  231.  
  232. function WDR()
  233.    t:flash("Wanderer")
  234.    title = "wanderer"
  235.    play()
  236. end
  237.  
  238. --#Stops All Music
  239. function Stop()
  240.    t:flash("Stop")
  241.    print("Stopping Disk")
  242.    peripheral.find("drive", disk.stopAudio)
  243. end
  244. function Reboot()
  245.    t:flash("Reboot")
  246.    print("Rebooting")
  247.    peripheral.find("drive", disk.stopAudio)
  248.    os.reboot()
  249. end
  250.  
  251. -- A list of all possible songs
  252. local Songs = {
  253.     Thir, Cat, Blocks, Chirp, Far, Mall, Mellohi, Stal, Strad, Ward,
  254.     Elev, Wait, Question, GaiaOne, GaiaTwo, Roop, Slive, WYG, Wander
  255. }
  256.  
  257. function Random()
  258.     t:flash("Random")
  259.     peripheral.find("drive", disk.stopAudio)
  260.     local maxSongs = #Songs -- the "#" gets the length of the list
  261.     local randomNumber = math.random( maxSongs )
  262.     Songs[randomNumber]() -- call the choosen song directly out of the list
  263. end
  264.  
  265. function update()
  266.  page2:flash("Update")
  267.  shell.run("rm startup")
  268.  shell.run("rm touchpoint")
  269.  shell.run("pastebin get Az75cPJ6 startup")
  270.  shell.run("pastebin get pFHeia96 touchpoint")
  271.  os.reboot()
  272. end
  273.  
  274. --#Button Color Functions#--
  275. function whiteCol()
  276. colNum = 1
  277.  colWrite()
  278. end
  279.  
  280. function orangeCol()
  281. colNum = 2
  282.  colWrite()
  283. end
  284.  
  285. function magentaCol()
  286. colNum = 4
  287.  colWrite()
  288. end
  289.  
  290. function lblueCol()
  291. colNum = 8
  292.  colWrite()
  293. end
  294.  
  295. function yellowCol()
  296. colNum = 16
  297.  colWrite()
  298. end
  299.  
  300. function limeCol()
  301. colNum = 32
  302.  colWrite()
  303. end
  304.  
  305. function pinkCol()
  306. colNum = 64
  307.  colWrite()
  308. end
  309.  
  310. function grayCol()
  311. colNum = 128
  312.  colWrite()
  313. end
  314.  
  315. function lgrayCol()
  316. colNum = 256
  317.  colWrite()
  318. end
  319.  
  320. function cyanCol()
  321. colNum = 512
  322.  colWrite()
  323. end
  324.  
  325. function purpleCol()
  326. colNum = 1024
  327.  colWrite()
  328. end
  329.  
  330. function blueCol()
  331. colNum = 2048
  332.  colWrite()
  333. end
  334.  
  335. function brownCol()
  336. colNum = 4096
  337.  colWrite()
  338. end
  339.  
  340. function greenCol()
  341. colNum = 8192
  342.  colWrite()
  343. end
  344.  
  345. function redCol()
  346. colNum = 16384
  347.  colWrite()
  348. end
  349.  
  350. function blackCol()
  351. colNum = 32768
  352.  colWrite()
  353. end
  354.  
  355. --#Text Color Functions#--
  356. function twhiteCol()
  357. colNum = 1
  358.  tcolWrite()
  359. end
  360.  
  361. function torangeCol()
  362. colNum = 2
  363.  tcolWrite()
  364. end
  365.  
  366. function tmagentaCol()
  367. colNum = 4
  368.  tcolWrite()
  369. end
  370.  
  371. function tlblueCol()
  372. colNum = 8
  373.  tcolWrite()
  374. end
  375.  
  376. function tyellowCol()
  377. colNum = 16
  378.  tcolWrite()
  379. end
  380.  
  381. function tlimeCol()
  382. colNum = 32
  383.  tcolWrite()
  384. end
  385.  
  386. function tpinkCol()
  387. colNum = 64
  388.  tcolWrite()
  389. end
  390.  
  391. function tgrayCol()
  392. colNum = 128
  393.  tcolWrite()
  394. end
  395.  
  396. function tlgrayCol()
  397. colNum = 256
  398.  tcolWrite()
  399. end
  400.  
  401. function tcyanCol()
  402. colNum = 512
  403.  tcolWrite()
  404. end
  405.  
  406. function tpurpleCol()
  407. colNum = 1024
  408.  tcolWrite()
  409. end
  410.  
  411. function tblueCol()
  412. colNum = 2048
  413.  tcolWrite()
  414. end
  415.  
  416. function tbrownCol()
  417. colNum = 4096
  418.  tcolWrite()
  419. end
  420.  
  421. function tgreenCol()
  422. colNum = 8192
  423.  tcolWrite()
  424. end
  425.  
  426. function tredCol()
  427. colNum = 16384
  428.  tcolWrite()
  429. end
  430.  
  431. --#Background color functions#--
  432. function tblackCol()
  433. colNum = 32768
  434.  tcolWrite()
  435. end
  436.  
  437. function bwhiteCol()
  438. colNum = 1
  439.  bcolWrite()
  440. end
  441.  
  442. function borangeCol()
  443. colNum = 2
  444.  bcolWrite()
  445. end
  446.  
  447. function bmagentaCol()
  448. colNum = 4
  449.  bcolWrite()
  450. end
  451.  
  452. function blblueCol()
  453. colNum = 8
  454.  bcolWrite()
  455. end
  456.  
  457. function byellowCol()
  458. colNum = 16
  459.  bcolWrite()
  460. end
  461.  
  462. function blimeCol()
  463. colNum = 32
  464.  bcolWrite()
  465. end
  466.  
  467. function bpinkCol()
  468. colNum = 64
  469.  bcolWrite()
  470. end
  471.  
  472. function bgrayCol()
  473. colNum = 128
  474.  bcolWrite()
  475. end
  476.  
  477. function blgrayCol()
  478. colNum = 256
  479.  bcolWrite()
  480. end
  481.  
  482. function bcyanCol()
  483. colNum = 512
  484.  bcolWrite()
  485. end
  486.  
  487. function bpurpleCol()
  488. colNum = 1024
  489.  bcolWrite()
  490. end
  491.  
  492. function bblueCol()
  493. colNum = 2048
  494.  bcolWrite()
  495. end
  496.  
  497. function bbrownCol()
  498. colNum = 4096
  499.  bcolWrite()
  500. end
  501.  
  502. function bgreenCol()
  503. colNum = 8192
  504.  bcolWrite()
  505. end
  506.  
  507. function bredCol()
  508. colNum = 16384
  509.  bcolWrite()
  510. end
  511.  
  512. function bblackCol()
  513. colNum = 32768
  514.  bcolWrite()
  515. end
  516.  
  517. function resCol()
  518. t:flash("Reset")
  519.  shell.run("rm mainColor")
  520.  shell.run("rm textColor")
  521.  shell.run("rm backColor")
  522.  os.reboot()
  523. end
  524.  
  525. function main()
  526.  tpage = page1
  527.  header = "HDR's Music System 2.4"
  528.  tpoint()
  529. end
  530.  
  531. function pg2()
  532.  tpage = page2
  533.  header = "HDR's Music System 2.4"
  534.  tpoint()
  535. end
  536.  
  537. function colorSet()
  538.  tpage = mainColr
  539.  header = "Set Button Color"
  540.  tpoint()
  541. end
  542.  
  543. function textSet()
  544.  tpage = textColr
  545.  header = "Set Text Color"
  546.  tpoint()
  547. end
  548.  
  549. function backSet()
  550.  tpage = backColr
  551.  header = "Set Background Color"
  552.  tpoint()
  553. end
  554.  
  555. do
  556. --#Main Page Buttons#--
  557.  page1:add("13", Thir, 2,3,12,5, mainCol, textCol, textCol , mainCol)
  558.  page1:add("Cat", Cat, 14,3,24,5, mainCol, textCol, textCol , mainCol)
  559.  page1:add("Blocks", Blocks, 26,3,36,5, mainCol, textCol, textCol , mainCol)
  560.  page1:add("Chirp", Chirp, 38,3,48,5, mainCol, textCol, textCol , mainCol)
  561.  page1:add("Far", Far, 50,3,60,5, mainCol, textCol, textCol , mainCol)
  562.  page1:add("Mall", Mall, 2,7,12,9, mainCol, textCol, textCol , mainCol)
  563.  page1:add("Mellohi", Mellohi, 14,7,24,9, mainCol, textCol, textCol , mainCol)
  564.  page1:add("Stal", Stal, 26,7,36,9, mainCol, textCol, textCol , mainCol)
  565.  page1:add("Strad", Strad, 38,7,48,9, mainCol, textCol, textCol , mainCol)
  566.  page1:add("Ward", Ward, 50,7,60,9, mainCol, textCol, textCol , mainCol)
  567.  page1:add("11", Elev, 2,11,12,13, mainCol, textCol, textCol , mainCol)
  568.  page1:add("Wait", Wait, 14,11,24,13, mainCol, textCol, textCol , mainCol)
  569.  page1:add("???", Question, 26,11,36,13, mainCol, textCol, textCol , mainCol)
  570.  page1:add("Gaia 1", GaiaOne, 38,11,48,13, mainCol, textCol, textCol , mainCol)
  571.  page1:add("Gaia 2", GaiaTwo, 50,11,60,13, mainCol, textCol, textCol , mainCol)
  572.  page1:add("R-Loop", Roop, 8,15,18,17, mainCol, textCol, textCol , mainCol)
  573.  page1:add("S-Alive", Slive, 20,15,30,17, mainCol, textCol, textCol , mainCol)
  574.  page1:add("WYG", WYG, 32,15,42,17, mainCol, textCol, textCol , mainCol)
  575.  page1:add("Wanderer", WDR, 44,15,54,17, mainCol, textCol, textCol , mainCol)
  576.  page1:add("Random", Random, 14,19,24,19, mainCol, textCol, textCol , mainCol)
  577.  page1:add("Stop", Stop, 26,19,36,19, mainCol, textCol, textCol , mainCol)
  578.  page1:add("Settings", pg2, 38,19,48,19, mainCol, textCol, textCol , mainCol)
  579.  
  580.  --#Settings Page Buttons#--
  581.  page2:add("Update", update, 2,3,12,5, mainCol, textCol, textCol , mainCol)
  582.  page2:add("Reboot", Reboot, 2,7,12,9, mainCol, textCol, textCol , mainCol)
  583.  page2:add("Back", main, 1,19,11,19, mainCol, textCol, textCol , mainCol)
  584.  page2:add("ButtonCol", colorSet, 14,3,24,5, mainCol, textCol, textCol , mainCol)
  585.  page2:add("TextCol", textSet, 26,3,36,5, mainCol, textCol, textCol , mainCol)
  586.  page2:add("BackgrCol", backSet, 38,3,48,5, mainCol, textCol, textCol, mainCol)
  587.  page2:add("Reset", resCol, 50,3,60,5, mainCol, textCol, textCol, mainCol)
  588.  
  589.  
  590. --#Button Color#--
  591.  mainColr:add("White", whiteCol, 2,3,12,5, colors.white, colors.black, colors.black, colors.white)
  592.  mainColr:add("Orange", orangeCol, 14,3,24,5, colors.orange, colors.black, colors.black, colors.orange)
  593.  mainColr:add("Magenta", magentaCol, 26,3,36,5, colors.magenta, colors.black, colors.black, colors.magenta)
  594.  mainColr:add("L-Blue", lblueCol, 38,3,48,5, colors.lightBlue, colors.black, colors.black, colors.lightBlue)
  595.  mainColr:add("Yellow", yellowCol, 50,3,60,5, colors.yellow, colors.black, colors.black, colors.yellow)
  596.  mainColr:add("Lime", limeCol, 2,7,12,9, colors.lime, colors.black, colors.black, colors.lime)
  597.  mainColr:add("Pink", pinkCol, 14,7,24,9, colors.pink, colors.black, colors.black, colors.pink)
  598.  mainColr:add("Gray", grayCol, 26,7,36,9, colors.gray, colors.black, colors.black, colors.gray)
  599.  mainColr:add("L-Gray", lgrayCol, 38,7,48,9, colors.lightGray, colors.black, colors.black, colors.lightGray)
  600.  mainColr:add("Cyan", cyanCol, 50,7,60,9, colors.cyan, colors.black, colors.black, colors.cyan)
  601.  mainColr:add("Purple", purpleCol, 2,11,12,13, colors.purple, colors.black, colors.black, colors.purple)
  602.  mainColr:add("Blue", blueCol, 14,11,24,13, colors.blue, colors.black, colors.black, colors.blue)
  603.  mainColr:add("Brown", brownCol, 26,11,36,13, colors.brown, colors.black, colors.black, colors.brown)
  604.  mainColr:add("Green", greenCol, 38,11,48,13, colors.green, colors.black, colors.black, colors.green)
  605.  mainColr:add("Red", redCol, 50,11,60,13, colors.red, colors.black, colors.black, colors.red)
  606.  mainColr:add("Black", blackCol, 26,15,36,17, colors.black, colors.black, colors.white, colors.white)
  607.  mainColr:add("Back", main, 1,19,11,19, mainCol, colors.lime, colors.orange, colors.orange)
  608.  
  609. --#Text Color#--
  610.  textColr:add("White", twhiteCol, 2,3,12,5, colors.white, colors.black, colors.black, colors.white)
  611.  textColr:add("Orange", torangeCol, 14,3,24,5, colors.orange, colors.black, colors.black, colors.orange)
  612.  textColr:add("Magenta", tmagentaCol, 26,3,36,5, colors.magenta, colors.black, colors.black, colors.magenta)
  613.  textColr:add("L-Blue", tlblueCol, 38,3,48,5, colors.lightBlue, colors.black, colors.black, colors.lightBlue)
  614.  textColr:add("Yellow", tyellowCol, 50,3,60,5, colors.yellow, colors.black, colors.black, colors.yellow)
  615.  textColr:add("Lime", tlimeCol, 2,7,12,9, colors.lime, colors.black, colors.black, colors.lime)
  616.  textColr:add("Pink", tpinkCol, 14,7,24,9, colors.pink, colors.black, colors.black, colors.pink)
  617.  textColr:add("Gray", tgrayCol, 26,7,36,9, colors.gray, colors.black, colors.black, colors.gray)
  618.  textColr:add("L-Gray", tlgrayCol, 38,7,48,9, colors.lightGray, colors.black, colors.black, colors.lightGray)
  619.  textColr:add("Cyan", tcyanCol, 50,7,60,9, colors.cyan, colors.black, colors.black, colors.cyan)
  620.  textColr:add("Purple", tpurpleCol, 2,11,12,13, colors.purple, colors.black, colors.black, colors.purple)
  621.  textColr:add("Blue", tblueCol, 14,11,24,13, colors.blue, colors.black, colors.black, colors.blue)
  622.  textColr:add("Brown", tbrownCol, 26,11,36,13, colors.brown, colors.black, colors.black, colors.brown)
  623.  textColr:add("Green", tgreenCol, 38,11,48,13, colors.green, colors.black, colors.black, colors.green)
  624.  textColr:add("Red", tredCol, 50,11,60,13, colors.red, colors.black, colors.black, colors.red)
  625.  textColr:add("Black", tblackCol, 26,15,36,17, colors.black, colors.black, colors.white, colors.white)
  626.  textColr:add("Back", main, 1,19,11,19, mainCol, textCol, textCol , mainCol)
  627.  
  628. --#Background Color#--
  629.  backColr:add("White", bwhiteCol, 2,3,12,5, colors.white, colors.black, colors.black, colors.white)
  630.  backColr:add("Orange", borangeCol, 14,3,24,5, colors.orange, colors.black, colors.black, colors.orange)
  631.  backColr:add("Magenta", bmagentaCol, 26,3,36,5, colors.magenta, colors.black, colors.black, colors.magenta)
  632.  backColr:add("L-Blue", blblueCol, 38,3,48,5, colors.lightBlue, colors.black, colors.black, colors.lightBlue)
  633.  backColr:add("Yellow", byellowCol, 50,3,60,5, colors.yellow, colors.black, colors.black, colors.yellow)
  634.  backColr:add("Lime", blimeCol, 2,7,12,9, colors.lime, colors.black, colors.black, colors.lime)
  635.  backColr:add("Pink", bpinkCol, 14,7,24,9, colors.pink, colors.black, colors.black, colors.pink)
  636.  backColr:add("Gray", bgrayCol, 26,7,36,9, colors.gray, colors.black, colors.black, colors.gray)
  637.  backColr:add("L-Gray", blgrayCol, 38,7,48,9, colors.lightGray, colors.black, colors.black, colors.lightGray)
  638.  backColr:add("Cyan", bcyanCol, 50,7,60,9, colors.cyan, colors.black, colors.black, colors.cyan)
  639.  backColr:add("Purple", bpurpleCol, 2,11,12,13, colors.purple, colors.black, colors.black, colors.purple)
  640.  backColr:add("Blue", bblueCol, 14,11,24,13, colors.blue, colors.black, colors.black, colors.blue)
  641.  backColr:add("Brown", bbrownCol, 26,11,36,13, colors.brown, colors.black, colors.black, colors.brown)
  642.  backColr:add("Green", bgreenCol, 38,11,48,13, colors.green, colors.black, colors.black, colors.green)
  643.  backColr:add("Red", bredCol, 50,11,60,13, colors.red, colors.black, colors.black, colors.red)
  644.  backColr:add("Black", bblackCol, 26,15,36,17, colors.black, colors.black, colors.white, colors.white)
  645.  backColr:add("Back", main, 1,19,11,19, mainCol, textCol, textCol , mainCol)
  646. end
  647.  
  648. main()
  649. while true do
  650.     t:draw()
  651.     local event, p1 = t:handleEvents(os.pullEvent())
  652.     if event == "button_click" then
  653.         t.buttonList[p1].func()
  654.     end
  655. end
Add Comment
Please, Sign In to add comment