Jump to content




Weird program error

computer lua

  • You cannot reply to this topic
5 replies to this topic

#1 jag

  • Members
  • 533 posts
  • LocationStockholm, Sweden

Posted 26 September 2012 - 07:39 AM

So I was playing on a server, and I made a computer and tried to make a login program.
This is the code:
Spoiler
Also available on Pastebin.
But I'm keep on getting the error:
bios:206: [string "index"]:34: 'end' expected (to close 'function' at line 9)
(Now is a good time as any to say that the programs name is index)


Image:
Spoiler

EDIT: I tried the code on single player and it worked. So the server must have gotten the problem.
Spoiler


#2 Doyle3694

  • Members
  • 815 posts

Posted 26 September 2012 - 07:59 AM

what if you put another 'end' at the end of your program? also, is there any more code in your program or is this all?

I saw everything having a proper end, but try it

#3 jag

  • Members
  • 533 posts
  • LocationStockholm, Sweden

Posted 26 September 2012 - 08:37 AM

View PostDoyle3694, on 26 September 2012 - 07:59 AM, said:

what if you put another 'end' at the end of your program? also, is there any more code in your program or is this all?

I saw everything having a proper end, but try it
I've tried, but still the same error...
And no, no other code in the program, it's just a start.

#4 Doyle3694

  • Members
  • 815 posts

Posted 26 September 2012 - 09:03 AM

Why is your output before your input? that must be messing stuff up like crazy?

#5 Luanub

    Lua Nub

  • Members
  • 1,135 posts
  • LocationPortland OR

Posted 26 September 2012 - 11:14 AM

The code is fine, it works the way it is.

Do any other programs error?

Try restarting the CC Computer, if that don't work try your computer, if that don't work the server may need to be restarted.

Although I agree with Doyle. You should prompt the user for the login/password before checking for it. The first thing you get on your screen is a message saying you input the wrong user/password.

#6 jag

  • Members
  • 533 posts
  • LocationStockholm, Sweden

Posted 26 September 2012 - 11:38 AM

View Postluanub, on 26 September 2012 - 11:14 AM, said:

The code is fine, it works the way it is.

Do any other programs error?

Try restarting the CC Computer, if that don't work try your computer, if that don't work the server may need to be restarted.

Although I agree with Doyle. You should prompt the user for the login/password before checking for it. The first thing you get on your screen is a message saying you input the wrong user/password.
Yeah well the code should be
if inputUname ~= "" or inputPass ~= "" then
instead of
if inputUname == "" or inputPass == "" then






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users