cadergator10

OpenOS Database

Sep 1st, 2021 (edited)
76
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local cryptKey = {1, 2, 3, 4, 5}
  2. local departments = {"SD","ScD","MD","E&T","O5"}
  3. local modemPort = 199
  4.  
  5. local component = require("component")
  6. local gpu = component.gpu
  7. local gui = require("gui")
  8. local event = require("event")
  9. local ser = require("serialization")
  10. local uuid = require("uuid")
  11. writer = component.os_cardwriter
  12.  
  13. local myGui, cardStatusLabel, userList, userNameText, userLevelLabel, LevelUpButton, LevelDownButton
  14. local cardBlockedYesButton, cardBlockedNoButton, userNewButton, userDeleteButton, userResetUUIDButton, MTFYesButton, MTFNoButton
  15. local GOIYesButton, GOINoButton, SecYesButton, SecNoButton, userArmoryLabel, ArmoryUpButton, ArmoryDownButton
  16. local userDepLabel, DepUpButton, DepDownButton, IntYesButton, IntNoButton, StaffYesButton, StaffNoButton
  17.  
  18. local prgName = "SCP Security System"
  19. local version = "v2.0a"
  20.  
  21. local modem = component.modem
  22.  
  23. local function convert( chars, dist, inv )
  24.   return string.char( ( string.byte( chars ) - 32 + ( inv and -dist or dist ) ) % 95 + 32 )
  25. end
  26.  
  27.  
  28. local function crypt(str,k,inv)
  29.   local enc= "";
  30.   for i=1,#str do
  31.     if(#str-k[5] >= i or not inv)then
  32.       for inc=0,3 do
  33.     if(i%4 == inc)then
  34.       enc = enc .. convert(string.sub(str,i,i),k[inc+1],inv);
  35.       break;
  36.     end
  37.       end
  38.     end
  39.   end
  40.   if(not inv)then
  41.     for i=1,k[5] do
  42.       enc = enc .. string.char(math.random(32,126));
  43.     end
  44.   end
  45.   return enc;
  46. end
  47.  
  48. --// exportstring( string )
  49. --// returns a "Lua" portable version of the string
  50. local function exportstring( s )
  51.     s = string.format( "%q",s )
  52.     -- to replace
  53.     s = string.gsub( s,"\\\n","\\n" )
  54.     s = string.gsub( s,"\r","\\r" )
  55.     s = string.gsub( s,string.char(26),"\"..string.char(26)..\"" )
  56.     return s
  57. end
  58. --// The Save Function
  59. function saveTable(  tbl,filename )
  60.     local charS,charE = "   ","\n"
  61.     local file,err
  62.     -- create a pseudo file that writes to a string and return the string
  63.     if not filename then
  64.         file =  { write = function( self,newstr ) self.str = self.str..newstr end, str = "" }
  65.         charS,charE = "",""
  66.     -- write table to tmpfile
  67.     elseif filename == true or filename == 1 then
  68.         charS,charE,file = "","",io.tmpfile()
  69.     -- write table to file
  70.     -- use io.open here rather than io.output, since in windows when clicking on a file opened with io.output will create an error
  71.     else
  72.         file,err = io.open( filename, "w" )
  73.         if err then return _,err end
  74.     end
  75.     -- initiate variables for save procedure
  76.     local tables,lookup = { tbl },{ [tbl] = 1 }
  77.     file:write( "return {"..charE )
  78.     for idx,t in ipairs( tables ) do
  79.         if filename and filename ~= true and filename ~= 1 then
  80.             file:write( "-- Table: {"..idx.."}"..charE )
  81.         end
  82.         file:write( "{"..charE )
  83.         local thandled = {}
  84.         for i,v in ipairs( t ) do
  85.             thandled[i] = true
  86.             -- escape functions and userdata
  87.             if type( v ) ~= "userdata" then
  88.                 -- only handle value
  89.                 if type( v ) == "table" then
  90.                     if not lookup[v] then
  91.                         table.insert( tables, v )
  92.                         lookup[v] = #tables
  93.                     end
  94.                     file:write( charS.."{"..lookup[v].."},"..charE )
  95.                 elseif type( v ) == "function" then
  96.                     file:write( charS.."loadstring("..exportstring(string.dump( v )).."),"..charE )
  97.                 else
  98.                     local value =  ( type( v ) == "string" and exportstring( v ) ) or tostring( v )
  99.                     file:write(  charS..value..","..charE )
  100.                 end
  101.             end
  102.         end
  103.         for i,v in pairs( t ) do
  104.             -- escape functions and userdata
  105.             if (not thandled[i]) and type( v ) ~= "userdata" then
  106.                 -- handle index
  107.                 if type( i ) == "table" then
  108.                     if not lookup[i] then
  109.                         table.insert( tables,i )
  110.                         lookup[i] = #tables
  111.                     end
  112.                     file:write( charS.."[{"..lookup[i].."}]=" )
  113.                 else
  114.                     local index = ( type( i ) == "string" and "["..exportstring( i ).."]" ) or string.format( "[%d]",i )
  115.                     file:write( charS..index.."=" )
  116.                 end
  117.                 -- handle value
  118.                 if type( v ) == "table" then
  119.                     if not lookup[v] then
  120.                         table.insert( tables,v )
  121.                         lookup[v] = #tables
  122.                     end
  123.                     file:write( "{"..lookup[v].."},"..charE )
  124.                 elseif type( v ) == "function" then
  125.                     file:write( "loadstring("..exportstring(string.dump( v )).."),"..charE )
  126.                 else
  127.                     local value =  ( type( v ) == "string" and exportstring( v ) ) or tostring( v )
  128.                     file:write( value..","..charE )
  129.                 end
  130.             end
  131.         end
  132.         file:write( "},"..charE )
  133.     end
  134.     file:write( "}" )
  135.     -- Return Values
  136.     -- return stringtable from string
  137.     if not filename then
  138.         -- set marker for stringtable
  139.         return file.str.."--|"
  140.     -- return stringttable from file
  141.     elseif filename == true or filename == 1 then
  142.         file:seek ( "set" )
  143.         -- no need to close file, it gets closed and removed automatically
  144.         -- set marker for stringtable
  145.         return file:read( "*a" ).."--|"
  146.     -- close file and return 1
  147.     else
  148.         file:close()
  149.         return 1
  150.     end
  151. end
  152.  
  153. --// The Load Function
  154. function loadTable( sfile )
  155.     local tables, err, _
  156.     -- catch marker for stringtable
  157.     if string.sub( sfile,-3,-1 ) == "--|" then
  158.         tables,err = loadstring( sfile )
  159.     else
  160.         tables,err = loadfile( sfile )
  161.     end
  162.     if err then return _,err
  163.     end
  164.     tables = tables()
  165.     for idx = 1,#tables do
  166.         local tolinkv,tolinki = {},{}
  167.         for i,v in pairs( tables[idx] ) do
  168.             if type( v ) == "table" and tables[v[1]] then
  169.                 table.insert( tolinkv,{ i,tables[v[1]] } )
  170.             end
  171.             if type( i ) == "table" and tables[i[1]] then
  172.                 table.insert( tolinki,{ i,tables[i[1]] } )
  173.             end
  174.         end
  175.         -- link values, first due to possible changes of indices
  176.         for _,v in ipairs( tolinkv ) do
  177.             tables[idx][v[1]] = v[2]
  178.         end
  179.         -- link indices
  180.         for _,v in ipairs( tolinki ) do
  181.             tables[idx][v[2]],tables[idx][v[1]] =  tables[idx][v[1]],nil
  182.         end
  183.     end
  184.     return tables[1]
  185. end
  186.  
  187.  
  188.  
  189. local function convert( chars, dist, inv )
  190.   return string.char( ( string.byte( chars ) - 32 + ( inv and -dist or dist ) ) % 95 + 32 )
  191. end
  192.  
  193.  
  194. local function crypt(str,k,inv)
  195.   local enc= "";
  196.   for i=1,#str do
  197.     if(#str-k[5] >= i or not inv)then
  198.       for inc=0,3 do
  199.     if(i%4 == inc)then
  200.       enc = enc .. convert(string.sub(str,i,i),k[inc+1],inv);
  201.       break;
  202.     end
  203.       end
  204.     end
  205.   end
  206.   if(not inv)then
  207.     for i=1,k[5] do
  208.       enc = enc .. string.char(math.random(32,126));
  209.     end
  210.   end
  211.   return enc;
  212. end
  213.  
  214.  
  215. function buttonCallback(guiID, id)
  216.   local result = gui.getYesNo("", "Do you really want to exit?", "")
  217.   if result == true then
  218.     gui.exit()
  219.   end
  220. end
  221.  
  222. function eventCallback(ev, id)
  223.   if ev == "cardInsert" then
  224.     gui.setText(myGui, cardStatusLabel, "   Card present")
  225.   elseif ev == "cardRemove" then
  226.     gui.setText(myGui, cardStatusLabel, "     No card   ")
  227.   end
  228. end
  229.  
  230. function userListCallback(guiID, listID, selectedID, selectedText)
  231.   gui.setText(myGui, userNameText, userTable[selectedID].name)
  232.   gui.setText(myGui, userLevelLabel, tostring(userTable[selectedID].level))
  233.   gui.setText(myGui, userArmoryLabel, tostring(userTable[selectedID].armory))
  234.   gui.setText(myGui, userDepLabel, departments[userTable[selectedID].department])
  235.   if userTable[selectedID].blocked == true then
  236.     gui.setEnable(myGui, cardBlockedYesButton, false)
  237.     gui.setEnable(myGui, cardBlockedNoButton, true)
  238.   else
  239.     gui.setEnable(myGui, cardBlockedYesButton, true)
  240.     gui.setEnable(myGui, cardBlockedNoButton, false)
  241.   end
  242.   if userTable[selectedID].mtf == true then
  243.     gui.setEnable(myGui, MTFNoButton, true)
  244.     gui.setEnable(myGui, MTFYesButton, false)
  245.   else
  246.     gui.setEnable(myGui, MTFNoButton, false)
  247.     gui.setEnable(myGui, MTFYesButton, true)
  248.   end
  249.   if userTable[selectedID].goi == true then
  250.     gui.setEnable(myGui, GOINoButton, true)
  251.     gui.setEnable(myGui, GOIYesButton, false)
  252.   else
  253.     gui.setEnable(myGui, GOINoButton, false)
  254.     gui.setEnable(myGui, GOIYesButton, true)
  255.   end
  256.   if userTable[selectedID].sec == true then
  257.     gui.setEnable(myGui, SecNoButton, true)
  258.     gui.setEnable(myGui, SecYesButton, false)
  259.   else
  260.     gui.setEnable(myGui, SecNoButton, false)
  261.     gui.setEnable(myGui, SecYesButton, true)
  262.   end
  263.   if userTable[selectedID].int == true then
  264.     gui.setEnable(myGui, IntNoButton, true)
  265.     gui.setEnable(myGui, IntYesButton, false)
  266.   else
  267.     gui.setEnable(myGui, IntNoButton, false)
  268.     gui.setEnable(myGui, IntYesButton, true)
  269.   end
  270.   if userTable[selectedID].staff == true then
  271.     gui.setEnable(myGui, StaffNoButton, true)
  272.     gui.setEnable(myGui, StaffYesButton, false)
  273.   else
  274.     gui.setEnable(myGui, StaffNoButton, false)
  275.     gui.setEnable(myGui, StaffYesButton, true)
  276.   end
  277.   gui.setEnable(myGui, LevelUpButton, true)
  278.   gui.setEnable(myGui, LevelDownButton, true)
  279.   gui.setEnable(myGui, ArmoryUpButton, true)
  280.   gui.setEnable(myGui, ArmoryDownButton, true)
  281.   gui.setEnable(myGui, DepUpButton, true)
  282.   gui.setEnable(myGui, DepDownButton, true)
  283.   gui.setEnable(myGui, userNameText, true)
  284. end
  285.  
  286. function updateServer()
  287.   local data = ser.serialize(userTable)
  288.   local crypted = crypt(data, cryptKey)
  289.   if modem.isOpen(modemPort) == false then
  290.     modem.open(modemPort)
  291.   end
  292.   modem.broadcast(modemPort, "updateuser", crypted)
  293. end
  294.  
  295.  
  296. function updateList()
  297.   gui.clearList(myGui, userList)
  298.   for key,value in pairs(userTable) do
  299.     gui.insertList(myGui, userList, value.name)
  300.   end
  301.   saveTable(userTable, "userlist.txt")
  302.   updateServer()
  303. end
  304.  
  305. function mtfYesUserCallback(guiID, id)
  306.   local selected = gui.getSelected(myGui, userList)
  307.   userTable[selected].mtf = true
  308.   updateList()
  309.   userListCallback(myGui, userList, selected)
  310. end
  311.  
  312. function mtfNoUserCallback(guiID, id)
  313.   local selected = gui.getSelected(myGui, userList)
  314.   userTable[selected].mtf = false
  315.   updateList()
  316.   userListCallback(myGui, userList, selected)
  317. end
  318. function goiYesUserCallback(guiID, id)
  319.   local selected = gui.getSelected(myGui, userList)
  320.   userTable[selected].goi = true
  321.   updateList()
  322.   userListCallback(myGui, userList, selected)
  323. end
  324.  
  325. function goiNoUserCallback(guiID, id)
  326.   local selected = gui.getSelected(myGui, userList)
  327.   userTable[selected].goi = false
  328.   updateList()
  329.   userListCallback(myGui, userList, selected)
  330. end
  331.  
  332. function secYesUserCallback(guiID, id)
  333.   local selected = gui.getSelected(myGui, userList)
  334.   userTable[selected].sec = true
  335.   updateList()
  336.   userListCallback(myGui, userList, selected)
  337. end
  338.  
  339. function secNoUserCallback(guiID, id)
  340.   local selected = gui.getSelected(myGui, userList)
  341.   userTable[selected].sec = false
  342.   updateList()
  343.   userListCallback(myGui, userList, selected)
  344. end
  345.  
  346. function intYesUserCallback(guiID, id)
  347.   local selected = gui.getSelected(myGui, userList)
  348.   userTable[selected].int = true
  349.   updateList()
  350.   userListCallback(myGui, userList, selected)
  351. end
  352.  
  353. function intNoUserCallback(guiID, id)
  354.   local selected = gui.getSelected(myGui, userList)
  355.   userTable[selected].int = false
  356.   updateList()
  357.   userListCallback(myGui, userList, selected)
  358. end
  359. function staffYesUserCallback(guiID, id)
  360.   local selected = gui.getSelected(myGui, userList)
  361.   userTable[selected].staff = true
  362.   updateList()
  363.   userListCallback(myGui, userList, selected)
  364. end
  365.  
  366. function staffNoUserCallback(guiID, id)
  367.   local selected = gui.getSelected(myGui, userList)
  368.   userTable[selected].staff = false
  369.   updateList()
  370.   userListCallback(myGui, userList, selected)
  371. end
  372.  
  373. function blockUserCallback(guiID, id)
  374.   local selected = gui.getSelected(myGui, userList)
  375.   userTable[selected].blocked = true
  376.   updateList()
  377.   userListCallback(myGui, userList, selected)
  378. end
  379.  
  380. function unblockUserCallback(guiID, id)
  381.   local selected = gui.getSelected(myGui, userList)
  382.   userTable[selected].blocked = false
  383.   updateList()
  384.   userListCallback(myGui, userList, selected)
  385. end
  386.  
  387. function newUserCallback(guiID, id)
  388.   local tmpTable = {["name"] = "new", ["blocked"] = false, ["level"] = 1, ["date"] = os.date(), ["armory"] = 0, ["mtf"] = false, ["sec"] = false, ["goi"] = false, ["int"] = false, ["staff"] = false, ["department"] = 1, ["uuid"] = uuid.next()}
  389.   table.insert(userTable, tmpTable)
  390.   updateList()
  391. end
  392.  
  393. function deleteUserCallback(guiID, id)
  394.   local selected = gui.getSelected(myGui, userList)
  395.   userTable[selected] = nil
  396.   updateList()
  397.   gui.setText(myGui, userNameText, "")
  398.   gui.setText(myGui, userLevelLabel, "")
  399.   gui.setEnable(myGui, cardBlockedYesButton, false)
  400.   gui.setEnable(myGui, cardBlockedNoButton, false)
  401.   gui.setEnable(myGui, MTFYesButton, false)
  402.   gui.setEnable(myGui, MTFNoButton, false)
  403.   gui.setEnable(myGui, GOIYesButton, false)
  404.   gui.setEnable(myGui, GOINoButton, false)
  405.   gui.setEnable(myGui, SecYesButton, false)
  406.   gui.setEnable(myGui, SecNoButton, false)
  407.   gui.setEnable(myGui, IntYesButton, false)
  408.   gui.setEnable(myGui, IntNoButton, false)
  409.   gui.setEnable(myGui, StaffYesButton, false)
  410.   gui.setEnable(myGui, StaffNoButton, false)
  411.   gui.setEnable(myGui, LevelUpButton, false)
  412.   gui.setEnable(myGui, LevelDownButton, false)
  413.   gui.setEnable(myGui, ArmoryUpButton, false)
  414.   gui.setEnable(myGui, ArmoryDownButton, false)
  415.   gui.setEnable(myGui, DepUpButton, false)
  416.   gui.setEnable(myGui, DepDownButton, false)
  417.   gui.setEnable(myGui, userNameText, false)
  418. end
  419.  
  420. function changeUUID(guiID, id)
  421.     local selected = gui.getSelected(myGUI, userList)
  422.     userTable[selected].uuid = uuid.next()
  423.     updateList()
  424.     userListCallback(myGui, userList, selected)
  425. end
  426.  
  427. function writeCardCallback(guiID, id)
  428.   local selected = gui.getSelected(myGui, userList)
  429.   local data =  userTable[selected].date .. " " .. userTable[selected].name .. " " .. userTable[selected].uuid
  430.   local crypted = crypt(data, cryptKey)
  431.   writer.write(crypted, userTable[selected].name .. "'s security pass", false, 8)
  432. end
  433.  
  434. function levelUpCallback(guiID, id)
  435.   local selected = gui.getSelected(myGui, userList)
  436.   if userTable[selected].level < 101 then
  437.     userTable[selected].level = userTable[selected].level + 1
  438.   end
  439.   updateList()
  440.   userListCallback(myGui, userList, selected)
  441. end
  442.  
  443. function levelDownCallback(guiID, id)
  444.   local selected = gui.getSelected(myGui, userList)
  445.   if userTable[selected].level > 1 then
  446.     userTable[selected].level = userTable[selected].level - 1
  447.   end
  448.   updateList()
  449.   userListCallback(myGui, userList, selected)
  450. end
  451.  
  452. function armorUpCallback(guiID, id)
  453.   local selected = gui.getSelected(myGui, userList)
  454.   if userTable[selected].armory < 4 then
  455.     userTable[selected].armory = userTable[selected].armory + 1
  456.   end
  457.   updateList()
  458.   userListCallback(myGui, userList, selected)
  459. end
  460.  
  461. function armorDownCallback(guiID, id)
  462.   local selected = gui.getSelected(myGui, userList)
  463.   if userTable[selected].armory > 0 then
  464.     userTable[selected].armory = userTable[selected].armory - 1
  465.   end
  466.   updateList()
  467.   userListCallback(myGui, userList, selected)
  468. end
  469.  
  470. function depUpCallback(guiID, id)
  471.   local selected = gui.getSelected(myGui, userList)
  472.   if userTable[selected].department < 5 then
  473.     userTable[selected].department = userTable[selected].department + 1
  474.   end
  475.   updateList()
  476.   userListCallback(myGui, userList, selected)
  477. end
  478.  
  479. function depDownCallback(guiID, id)
  480.   local selected = gui.getSelected(myGui, userList)
  481.   if userTable[selected].department > 1 then
  482.     userTable[selected].department = userTable[selected].department - 1
  483.   end
  484.   updateList()
  485.   userListCallback(myGui, userList, selected)
  486. end
  487.  
  488. function inputCallback(guiID, textID, text)
  489.   local selected = gui.getSelected(myGui, userList)
  490.   userTable[selected].name = text
  491.   updateList()
  492.   userListCallback(myGui, userList, selected)
  493. end
  494.  
  495. -- main gui setup
  496. myGui = gui.newGui(2, 2, 150, 45, true)
  497. button = gui.newButton(myGui, "center", 42, "exit", buttonCallback)
  498.  
  499. -- frame with user list
  500. gui.newFrame(myGui, 3, 3, 60, 36)
  501. userList = gui.newList(myGui, 4, 4, 58, 34, {}, userListCallback)
  502. userTable = loadTable("userlist.txt")
  503. if userTable == nil then
  504.   userTable = {}
  505. end
  506. updateList()
  507.  
  508. -- user infos
  509. gui.newLabel(myGui, 64, 12, "User name : ")
  510. gui.newLabel(myGui, 64, 14, "Level     : ")
  511. gui.newLabel(myGui, 64, 16, "MTF       : ")
  512. gui.newLabel(myGui, 64, 18, "GOI       : ")
  513. gui.newLabel(myGui, 64, 20, "Security  : ")
  514. gui.newLabel(myGui, 64, 22, "Intercom  : ")
  515. gui.newLabel(myGui, 64, 24, "Staff     : ")
  516. gui.newLabel(myGui, 64, 26, "ArmorLevel: ")
  517. gui.newLabel(myGui, 64, 28, "Department: ")
  518. gui.newLabel(myGui, 64, 30, "Blocked   : [yes] / [no]")
  519. userNameText = gui.newText(myGui, 88, 12, 16, "", inputCallback)
  520. userLevelLabel = gui.newLabel(myGui, 88, 14, "")
  521. LevelUpButton = gui.newButton(myGui, 92, 14, "+", levelUpCallback)
  522. LevelDownButton = gui.newButton(myGui, 96, 14, "-", levelDownCallback)
  523. MTFYesButton = gui.newButton(myGui, 88, 16, "yes", mtfYesUserCallback)
  524. MTFNoButton = gui.newButton(myGui, 96, 16, "no", mtfNoUserCallback)
  525. GOIYesButton = gui.newButton(myGui, 88, 18, "yes", goiYesUserCallback)
  526. GOINoButton = gui.newButton(myGui, 96, 18, "no", goiNoUserCallback)
  527. SecYesButton = gui.newButton(myGui, 88, 20, "yes", secYesUserCallback)
  528. SecNoButton = gui.newButton(myGui, 96, 20, "no", secNoUserCallback)
  529. IntYesButton = gui.newButton(myGui, 88, 22, "yes", intYesUserCallback)
  530. IntNoButton = gui.newButton(myGui, 96, 22, "no", intNoUserCallback)
  531. StaffYesButton = gui.newButton(myGui, 88, 24, "yes", staffYesUserCallback)
  532. StaffNoButton = gui.newButton(myGui, 96, 24, "no", staffNoUserCallback)
  533. userArmoryLabel = gui.newLabel(myGui, 88, 26, "")
  534. ArmoryUpButton = gui.newButton(myGui, 92, 26, "+", armorUpCallback)
  535. ArmoryDownButton = gui.newButton(myGui, 96, 26, "-", armorDownCallback)
  536. userDepLabel = gui.newLabel(myGui, 88, 28, "")
  537. DepUpButton = gui.newButton(myGui, 92, 28, "+", depUpCallback)
  538. DepDownButton = gui.newButton(myGui, 96, 28, "-", depDownCallback)
  539. cardBlockedYesButton = gui.newButton(myGui, 88, 30, "yes", blockUserCallback)
  540. cardBlockedNoButton = gui.newButton(myGui, 96, 30, "no", unblockUserCallback)
  541. gui.setEnable(myGui, cardBlockedYesButton, false)
  542. gui.setEnable(myGui, cardBlockedNoButton, false)
  543. gui.setEnable(myGui, MTFYesButton, false)
  544. gui.setEnable(myGui, MTFNoButton, false)
  545. gui.setEnable(myGui, GOIYesButton, false)
  546. gui.setEnable(myGui, GOINoButton, false)
  547. gui.setEnable(myGui, SecYesButton, false)
  548. gui.setEnable(myGui, SecNoButton, false)
  549. gui.setEnable(myGui, IntYesButton, false)
  550. gui.setEnable(myGui, IntNoButton, false)
  551. gui.setEnable(myGui, StaffYesButton, false)
  552. gui.setEnable(myGui, StaffNoButton, false)
  553. gui.setEnable(myGui, LevelUpButton, false)
  554. gui.setEnable(myGui, LevelDownButton, false)
  555. gui.setEnable(myGui, ArmoryUpButton, false)
  556. gui.setEnable(myGui, ArmoryDownButton, false)
  557. gui.setEnable(myGui, DepUpButton, false)
  558. gui.setEnable(myGui, DepDownButton, false)
  559. gui.setEnable(myGui, userNameText, false)
  560.  
  561. gui.newHLine(myGui, 64, 36, 86)
  562. userNewButton = gui.newButton(myGui, 4, 42, "new", newUserCallback)
  563. userDeleteButton = gui.newButton(myGui, 18, 42, "delete", deleteUserCallback)
  564. userResetUUIDButton = gui.newButton(myGui, 32, 42, "reset uuid", changeUUID)
  565.  
  566. -- frame with status of the writer
  567. gui.newFrame(myGui, 114, 2, 38, 6, "Writer status")
  568. cardStatusLabel = gui.newLabel(myGui, 116, 4, "     No card   ")
  569.  
  570. --updateServerButton = gui.newButton(myGui, 47, 21, "update server", updateServerCallback)
  571.  
  572. cardWriteButton = gui.newButton(myGui, 128, 42, "write card", writeCardCallback)
  573.  
  574.  
  575. gui.clearScreen()
  576. gui.setTop(prgName .. " " .. version)
  577.  
  578. event.listen("cardInsert", eventCallback)
  579. event.listen("cardRemove", eventCallback)
  580. while true do
  581.   gui.runGui(myGui)
  582. end
RAW Paste Data