GLaDOS446

Basic emulator

Jun 23rd, 2026
21
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.34 KB | None | 0 0
  1. -- BASIC-Emulator "RetroOS"
  2. local program = {}
  3. local vars = {}
  4. local loop_stack = {}
  5. local PIN = "1234" -- Dein PIN für LOGOUT
  6.  
  7. local themes = {
  8. {name = "C64 Style", bg = colors.blue, fg = colors.white},
  9. {name = "CBM PET", bg = colors.black, fg = colors.lime},
  10. {name = "Apple II", bg = colors.black, fg = colors.green},
  11. {name = "Spectrum", bg = colors.white, fg = colors.black},
  12. {name = "DOS Mode", bg = colors.black, fg = colors.lightGray}
  13. }
  14.  
  15. local currentTheme = themes[1]
  16.  
  17. -- Grafische Hilfsfunktionen
  18. local function drawBox(w, h, title)
  19. term.clear()
  20. local tw, th = term.getSize()
  21. local x, y = math.floor((tw-w)/2), math.floor((th-h)/2)
  22. term.setBackgroundColor(colors.gray)
  23. term.setCursorPos(x, y)
  24. for i=1, h do
  25. term.setCursorPos(x, y + i - 1)
  26. term.write(string.rep(" ", w))
  27. end
  28. term.setCursorPos(x+1, y)
  29. term.write(title)
  30. end
  31.  
  32. local function promptPin()
  33. drawBox(20, 5, " SYSTEM SPERRE ")
  34. term.setCursorPos(5, 3)
  35. term.write("PIN eingeben:")
  36. term.setCursorPos(5, 4)
  37. local input = read("*")
  38. if input == PIN then return true end
  39. return false
  40. end
  41.  
  42. local function selectTheme()
  43. local selection = 1
  44. while true do
  45. term.setBackgroundColor(colors.black)
  46. term.clear()
  47. term.setCursorPos(1, 1)
  48. print("--- Waehle dein Retro-System ---")
  49. for i, t in ipairs(themes) do
  50. print((i == selection and "> " or " ") .. t.name)
  51. end
  52. local _, key = os.pullEvent("key")
  53. if key == keys.up then selection = math.max(1, selection - 1)
  54. elseif key == keys.down then selection = math.min(#themes, selection + 1)
  55. elseif key == keys.enter then
  56. currentTheme = themes[selection]
  57. break
  58. end
  59. end
  60. end
  61.  
  62. -- Parser Funktionen
  63. local function execute()
  64. local lines = {}
  65. for k in pairs(program) do table.insert(lines, k) end
  66. table.sort(lines)
  67.  
  68. local ip = 1
  69. while ip <= #lines do
  70. local cmd = program[lines[ip]]:upper()
  71. local tokens = {}
  72. for token in cmd:gmatch("%S+") do table.insert(tokens, token) end
  73.  
  74. -- Befehlsverarbeitung
  75. if tokens[1] == "PRINT" then
  76. local text = cmd:sub(7)
  77. if vars[text] then print(vars[text])
  78. elseif text:sub(1,1) == "\"" then print(text:sub(2, -2))
  79. else print(text) end
  80.  
  81. elseif tokens[1] == "LET" or tokens[2] == "=" then
  82. local var, val = cmd:match("(%a+)%s*=%s*(%d+)")
  83. vars[var] = tonumber(val)
  84.  
  85. elseif tokens[1] == "IF" then
  86. local var, op, val, thenLine = cmd:match("IF%s+(%a+)%s*([<>=]+)%s*(%d+)%s+THEN%s+(%d+)")
  87. local condition = false
  88. if op == "=" and vars[var] == tonumber(val) then condition = true
  89. elseif op == ">" and vars[var] > tonumber(val) then condition = true
  90. elseif op == "<" and vars[var] < tonumber(val) then condition = true end
  91.  
  92. if condition then
  93. for i, l in ipairs(lines) do if l == tonumber(thenLine) then ip = i - 1 end end
  94. end
  95.  
  96. elseif tokens[1] == "GOTO" then
  97. local target = tonumber(tokens[2])
  98. for i, l in ipairs(lines) do if l == target then ip = i - 1 end end
  99.  
  100. elseif tokens[1] == "CLS" then term.clear(); term.setCursorPos(1,1)
  101. elseif tokens[1] == "REM" then -- Kommentar (ignoriert)
  102. elseif tokens[1] == "END" then break
  103. end
  104.  
  105. ip = ip + 1
  106. sleep(0.05)
  107. end
  108. end
  109.  
  110. -- Hauptprogramm
  111. selectTheme()
  112. term.setBackgroundColor(currentTheme.bg)
  113. term.setTextColor(currentTheme.fg)
  114. term.clear()
  115. term.setCursorPos(1, 1)
  116.  
  117. print("RetroOS v1.0 - BASIC Emulation")
  118. while true do
  119. write("> ")
  120. local input = read()
  121. if input:upper() == "RUN" then execute()
  122. elseif input:upper() == "LOGOUT" then
  123. if promptPin() then break
  124. else print("Falscher PIN!") end
  125. elseif input:upper() == "LIST" then
  126. for _, n in ipairs((function() local l={}; for k in pairs(program) do table.insert(l,k) end; table.sort(l); return l end)()) do
  127. print(n .. " " .. program[n])
  128. end
  129. else
  130. local lineNum = tonumber(input:match("^(%d+)"))
  131. if lineNum then program[lineNum] = input:match("^%d+%s+(.*)")
  132. else print("SYNTAX ERROR") end
  133. end
  134. end
  135. term.clear()
  136.  
Advertisement
Comments
  • User was banned
  • MauMorello
    3 days
    # CSS 0.83 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://drive.google.com/file/d/1cvQPOZ7JecI0L6lqdIzIHJbHQBiDRT4U/view?usp=sharing
    4.  
    5. This made me $13,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    8. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    9.  
    10. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
Add Comment
Please, Sign In to add comment