2

I'm trying to figure out what im doing wrong, but this is the only thing i got as error. Can you give me some tips what i can look for?

The error happens when Deutsch is selected, it works fine when Englisch is selected.

--Size 51,18
--Zeit: 75

w, h = term.getSize()




--OS.Start
function Haupt(Inhalt)
    paintutils.drawFilledBox(1, 1, w, h, colors.blue)
    paintutils.drawLine(1, 1, 6, 1, colors.white)
    term.setTextColor(colors.gray)
    term.setCursorPos(1,1)
    term.write("MineOS")
    paintutils.drawLine(1, 3, string.len(Inhalt), 3, colors.white)
    term.setTextColor(colors.black)
    term.setCursorPos(1, 3)
    term.write(Inhalt)
    term.setCursorPos(1, 1) --ACHTUNG POS ÄNDERN

end


while true do
    local event, key = os.pullEvent( "key" )
    if key == keys.b then
        Deutsch = 0
        Englisch = 1
        break
    elseif key == keys.c then
        Deutsch = 1
        Englisch = 0
        break
    end
end







if Englisch == 1 then
    Haupt("You've chosen English. The system will start after the Tutorial.")
elseif Deutsch == 1 then
    Haupt("Du hast Deutsch gewählt. Das System wird nachdem Tutorial starten.")
   
end

ComputerCraft tells me window:94:arguments must be the same length.

Nifim
  • 4,758
  • 2
  • 12
  • 31
ReySKR
  • 67
  • 6
  • 1
    You don't get a line number? or any code you have narrowed the error down to? it can be difficult to determine the cause of an error without this context. – Nifim Jun 23 '20 at 21:27
  • Mhmm. i can give you the code, but its pretty long compared to others, idk if its allowed. https://pastebin.com/HNbaVDj2 It fails at the last if clause. – ReySKR Jun 23 '20 at 22:15
  • 1
    do you have more information like the complete error message you can added to the question? that can likely point you too the specific section of the code that is not working – Nifim Jun 23 '20 at 22:18
  • It legit only that, im searching and searching.. – ReySKR Jun 23 '20 at 22:20
  • Sth. i can add is, that if i press b for english it works totally fine, but when i press c and it should go to the elseif it just stops and that error comes up. Probably that helps. – ReySKR Jun 23 '20 at 22:22
  • 1
    Can you minimize your example? (i.e., remove as much code as you can without making the problem go away) – Joseph Sible-Reinstate Monica Jun 23 '20 at 22:24
  • https://pastebin.com/g6a0PF2h That is the shortest it can get. – ReySKR Jun 23 '20 at 22:29
  • 1
    have you tried removing the `ä` from the Deutsch string? just a random thought that it might not beable to display that char for some reason. – Nifim Jun 23 '20 at 22:40
  • 1
    Hehe, that was it. Thanks both of you for your help c: – ReySKR Jun 23 '20 at 22:43
  • 2
    @ReySKR I think I have a workaround where you can keep it. Let me test it and then I'll post it as an answer. – Joseph Sible-Reinstate Monica Jun 23 '20 at 22:44
  • 1
    Wait, when I tried it, it worked fine with the `ä`. Are you using an old version of ComputerCraft? (It's fine if you are and can't update; just let me know and I'll test the workaround there) – Joseph Sible-Reinstate Monica Jun 23 '20 at 22:50
  • Im using the 1.7.10 Version of Computercraft, I use it because of FTB Infnity Evolved :) Edit: Ah and sry for my late answer, im gonna look back again in 15 minutes, after it I have to sleep c: – ReySKR Jun 23 '20 at 23:11
  • Unfortunately, my workaround didn't work on that version. I think you are indeed out of luck with that character. – Joseph Sible-Reinstate Monica Jun 23 '20 at 23:30

1 Answers1

2

ComputerCraft for Minecraft 1.7.10 has a bug where it mishandles the length of non-ASCII Unicode characters, so it chokes on the ä in gewählt. It's fixed in ComputerCraft for Minecraft 1.12.2. I tried to find a workaround by using blit instead of write, but I was unsuccessful.