Jump to content
  • 0

'end expected (to close while at line 1) near <eos>'


uraveragedude

Question

I'm probably making a really dumb mistake, but please help!

Script ended:

Script error: org.luaj.vm2.LuaError: load /storage/emulated/0/Download/gg scripts/demo.lua: org.luaj.vm2.LuaError: /storage/emulated/0/Download/gg scripts/demo.lua:64

`end`

'end' expected (to close 'while' at line 1) near '<eos>'

at org.luaj.vm2.LuaValue.error(LuaValue.java:1076)

at org.luaj.vm2.Globals.loadfile(Globals.java:230)

at android.ext.Script.runScript(Script.java:4492)

at android.ext.Script$ScriptThread.run(Script.java:4326)

Caused by: org.luaj.vm2.LuaError: /storage/emulated/0/Download/gg scripts/demo.lua:64

`end`

'end' expected (to close 'while' at line 1) near '<eos>'

at org.luaj.vm2.compiler.LexState.lexerror(LexState.java:278)

at org.luaj.vm2.compiler.LexState.syntaxerror(LexState.java:282)

at org.luaj.vm2.compiler.LexState.check_match(LexState.java:876)

at org.luaj.vm2.compiler.LexState.whilestat(LexState.java:1789)

at org.luaj.vm2.compiler.LexState.statement(LexState.java:2083)

at org.luaj.vm2.compiler.LexState.statlist(LexState.java:2145)

at org.luaj.vm2.compiler.LexState.mainfunc(LexState.java:2161)

at org.luaj.vm2.compiler.LuaC$CompileState.luaY_parser(LuaC.java:129)

at org.luaj.vm2.compiler.LuaC.compile(LuaC.java:99)

at org.luaj.vm2.Globals.compilePrototype(Globals.java:349)

at org.luaj.vm2.Globals.loadPrototype(Globals.java:328)

at org.luaj.vm2.Globals.load(Globals.java:299)

at org.luaj.vm2.Globals.loadfile(Globals.java:224)

... 2 more

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • Administrators
20 minutes ago, uraveragedude said:

Script error: org.luaj.vm2.LuaError: load /storage/emulated/0/Download/gg scripts/demo.lua: org.luaj.vm2.LuaError: /storage/emulated/0/Download/gg scripts/demo.lua:64

`end`

'end' expected (to close 'while' at line 1) near '<eos>'

Try read message. You forget end in some place for if/for/while/function/etc.

Link to comment
Share on other sites

OK. so i went through my script, and I put an end after the start of my script:

while (true) do

 

  if gg.isVisible(true) then

   menuk = 1

    gg.setVisible(false)

  end

gg.clearResults()

end

but after running, the menu that i scripted does not show up? how come?

Link to comment
Share on other sites

  • Administrators

Instead of inserting random words in random places, and then hoping that it will work, you should check the script from start to finish. Find all the operators for which you need end, and then check that it is there, and in the right place.

Link to comment
Share on other sites

OK... so i triple checked my code and no strings were left untied (figuratively speaking). I even had a friend inspect every line of my code and he said it was written perfectly. Of course, I have been editing it since then, to try and see how I could fix the script, and FINALLY! I found a solution! The menu was loading in, and it seemed like all was going well. Until, oh no, when I press on a hack, it interrupts the script, and it doesn't work. After changing a few more things, such as replacing goto with functions, i get a '<name>' expected near 'function', even though I assigned a name to the function the error is referring to. These errors are very frustrating, so I would really like to know how to fix this. 

Script ended:

Script error: org.luaj.vm2.LuaError: load /storage/emulated/0/Download/gg scripts/demo.lua: org.luaj.vm2.LuaError: /storage/emulated/0/Download/gg scripts/demo.lua:31

`function AB()`

'<name>' expected near 'function'

at org.luaj.vm2.LuaValue.error(LuaValue.java:1076)

at org.luaj.vm2.Globals.loadfile(Globals.java:230)

at android.ext.Script.runScript(Script.java:4492)

at android.ext.Script$ScriptThread.run(Script.java:4326)

Caused by: org.luaj.vm2.LuaError: /storage/emulated/0/Download/gg scripts/demo.lua:31

`function AB()`

'<name>' expected near 'function'

at org.luaj.vm2.compiler.LexState.lexerror(LexState.java:278)

at org.luaj.vm2.compiler.LexState.syntaxerror(LexState.java:282)

at org.luaj.vm2.compiler.LexState.error_expected(LexState.java:844)

at org.luaj.vm2.compiler.LexState.check(LexState.java:857)

at org.luaj.vm2.compiler.LexState.str_checkname(LexState.java:885)

at org.luaj.vm2.compiler.LexState.checkname(LexState.java:896)

at org.luaj.vm2.compiler.LexState.fieldsel(LexState.java:1142)

at org.luaj.vm2.compiler.LexState.suffixedexp(LexState.java:1407)

at org.luaj.vm2.compiler.LexState.exprstat(LexState.java:2028)

at org.luaj.vm2.compiler.LexState.statement(LexState.java:2128)

at org.luaj.vm2.compiler.LexState.statlist(LexState.java:2145)

at org.luaj.vm2.compiler.LexState.body(LexState.java:1304)

at org.luaj.vm2.compiler.LexState.funcstat(LexState.java:2018)

at org.luaj.vm2.compiler.LexState.statement(LexState.java:2101)

at org.luaj.vm2.compiler.LexState.statlist(LexState.java:2145)

at org.luaj.vm2.compiler.LexState.body(LexState.java:1304)

at org.luaj.vm2.compiler.LexState.funcstat(LexState.java:2018)

at org.luaj.vm2.compiler.LexState.statement(LexState.java:2101)

at org.luaj.vm2.compiler.LexState.statlist(LexState.java:2145)

at org.luaj.vm2.compiler.LexState.body(LexState.java:1304)

at org.luaj.vm2.compiler.LexState.simpleexp(LexState.java:1479)

at org.luaj.vm2.compiler.LexState.subexpr(LexState.java:1596)

at org.luaj.vm2.compiler.LexState.expr(LexState.java:1614)

at org.luaj.vm2.compiler.LexState.explist(LexState.java:1314)

at org.luaj.vm2.compiler.LexState.assignment(LexState.java:1709)

at org.luaj.vm2.compiler.LexState.exprstat(LexState.java:2031)

at org.luaj.vm2.compiler.LexState.statement(LexState.java:2128)

at org.luaj.vm2.compiler.LexState.statlist(LexState.java:2145)

at org.luaj.vm2.compiler.LexState.body(LexState.java:1304)

at org.luaj.vm2.compiler.LexState.simpleexp(LexState.java:1479)

at org.luaj.vm2.compiler.LexState.subexpr(LexState.java:1596)

at org.luaj.vm2.compiler.LexState.expr(LexState.java:1614)

at org.luaj.vm2.compiler.LexState.explist(LexState.java:1314)

at org.luaj.vm2.compiler.LexState.assignment(LexState.java:1709)

at org.luaj.vm2.compiler.LexState.exprstat(LexState.java:2031)

at org.luaj.vm2.compiler.LexState.statement(LexState.java:2128)

at org.luaj.vm2.compiler.LexState.statlist(LexState.java:2145)

at org.luaj.vm2.compiler.LexState.body(LexState.java:1304)

at org.luaj.vm2.compiler.LexState.simpleexp(LexState.java:1479)

at org.luaj.vm2.compiler.LexState.subexpr(LexState.java:1596)

at org.luaj.vm2.compiler.LexState.expr(LexState.java:1614)

at org.luaj.vm2.compiler.LexState.explist(LexState.java:1314)

at org.luaj.vm2.compiler.LexState.assignment(LexState.java:1709)

at org.luaj.vm2.compiler.LexState.exprstat(LexState.java:2031)

at org.luaj.vm2.compiler.LexState.statement(LexState.java:2128)

at org.luaj.vm2.compiler.LexState.statlist(LexState.java:2145)

at org.luaj.vm2.compiler.LexState.body(LexState.java:1304)

at org.luaj.vm2.compiler.LexState.simpleexp(LexState.java:1479)

at org.luaj.vm2.compiler.LexState.subexpr(LexState.java:1596)

at org.luaj.vm2.compiler.LexState.expr(LexState.java:1614)

at org.luaj.vm2.compiler.LexState.explist(LexState.java:1314)

at org.luaj.vm2.compiler.LexState.assignment(LexState.java:1709)

at org.luaj.vm2.compiler.LexState.exprstat(LexState.java:2031)

at org.luaj.vm2.compiler.LexState.statement(LexS

Link to comment
Share on other sites

  • Administrators

This is not a guessing game. Or show all the code or wait for help forever.

_______________________________________________
added 1 minute later
3 hours ago, uraveragedude said:

'<name>' expected near 'function'

This errors means - before that line must be something which need <name> after it. But after it present 'function' word.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.