Anuncios Google

Ayuda coders.[CODIGO LUA] [RESUELTO].

Buenos dias,necesito ayuda en un codigo de un nuevo homebrew por que cuando lo inicio me sale: An error has occured.System/Menu.lua:51: 'then' expected near 'menu2'

Do you wish to enable the usb?

 

y este es el codigo,talves este mal todo o solo una parte pero porfas ayudenme a resolverlo.

--Menu--
menu1 = Image.load("images/pspmenu1.png")
menu2 = Image.load("images/pspmenu2.png")
menu3 = Image.load("images/pspmenu3.png")

--Amarillo--
amarillo=Color.new(255,255,0,255)
System.setcpuspeed(333)
System.memclean()

--Variables--
while true do
opcion = 1
oldpad = Controls.read()

while true do
pad = Controls.read()

--Variables del menu--
if opcion == 1 then
screen.startDraw()
screen.clear(0)
Image.blit (0,0, menu1)
screen.endDraw()
end

if opcion == 2 then
screen.startDraw()
screen.clear(0)
Image.blit (0,0, menu2)
screen.endDraw()
end

if opcion == 3 then
screen.startDraw()
screen.clear(0)
Image.blit (0,0, menu3)
screen.endDraw()
end

----Movimiento-----

if pad:down() then
current= menu2
end

if pad:up() then
current= menu1
end

if pad:down() and current  menu2 then
current= menu3
end

--Pulsaciones----

if pad:cross() and opcion == 1 then
dofile("System/infomenu.lua")
end

if pad:cross() and opcion == 2 then
dofile("System/creditos.lua")
end

if pad:cross() and opcion == 3 then
System.message("Este Homebrew fue creado por PSPPRECIZO,Visita PSP.SCENEBETA.", 0)
System.Quit()
end

screen.flipscreen()
screen.waitVblankStart()
oldpad = pad
end
end

Saludos y espero puedan ayudarme.

Resuelto.Gracias.


simpson
mgs

v10.0


Anuncios Google

Opciones de visualización de comentarios

Seleccione la forma que prefiera para mostrar los comentarios y haga clic en «Guardar las opciones» para activar los cambios.

Creo que lo que te has

Creo que lo que te has olvidao es un = donde pone

if pad:down() and current  menu2 then
current= menu3
end

 

  es porque no has puesto

 

es porque no has puesto ==

if pad:down() and current  menu2 then

prueba asi:

 

if pad:down() and current  == menu2 then

Imagen de Galx-2

el error es muy sencillo

--Menu--
menu1 = Image.load("images/pspmenu1.png")
menu2 = Image.load("images/pspmenu2.png")
menu3 = Image.load("images/pspmenu3.png")
 
--Amarillo--
amarillo = Color.new(255,255,0,255)
System.setcpuspeed(333)
System.memclean()
 
--Variables--
while true do
opcion = 1
oldpad = Controls.read()
 
while true do
pad = Controls.read()
 
--Variables del menu--
if opcion == 1 then
screen.startDraw()
screen.clear(0)
Image.blit (0,0, menu1)
screen.endDraw()
end
 
if opcion == 2 then
screen.startDraw()
screen.clear(0)
Image.blit (0,0, menu2)
screen.endDraw()
end
 
if opcion == 3 then
screen.startDraw()
screen.clear(0)
Image.blit (0,0, menu3)
screen.endDraw()
end
 
----Movimiento-----
 
if pad:down() then
current = menu2
end
 
if pad:up() then
current = menu1
end
 
if pad:down() and current == menu2 then
current = menu3
end
 
--Pulsaciones----
 
if pad:cross() and opcion == 1 then
dofile("System/infomenu.lua")
end
 
if pad:cross() and opcion == 2 then
dofile("System/creditos.lua")
end
 
if pad:cross() and opcion == 3 then
System.message("Este Homebrew fue creado por PSPPRECIZO,Visita PSP.SCENEBETA.", 0)
System.Quit()
end
 
screen.flipscreen()
screen.waitVblankStart()
oldpad = pad
end
end

en la linea 51 te faltaba "==" entre la variable y "then"


Doy invitaciones para Lockerz a diario. Simplemente, mandame un mensaje privado con tu correo.

Imagen de PSPPRECIZO

O

que fallo,gracias les agradesco su ayuda,creo que frecuentemente les voe a pedir ayuda jeje XD,bueno Saludos alos 2 y como les decia talves me ayuden mas de 1 ves.


simpson
mgs

v10.0

Imagen de Kevinkl3

El error

Es que te has comido un 'then' en la linea 51 o es que puede que este pegada a otra palabra como true asi: truethen, y debe de ir separado..


Chat No Oficial SceneBeta

PSP && Wii

 

Imagen de PSPPRECIZO

Perdona

mi ingnorancia pero en donde es eso ya se que en la linea 51 pero ¿que me hace falta?.Gracias

Saludos.

Imagen de Kevinkl3

Mmm

Mira cada linea cuenta en el codigo asta los espacios, debes de saber que linea es la 51 para encontrar el problema, te aconsejo que utilices algun editor para programar que te cuente las lineas, en elcodigo que has puesto no puedo contar las lineas porque ando desde mi movil pero en la pc lo podria analizar..


Chat No Oficial SceneBeta

PSP && Wii

 

Imagen de PSPPRECIZO

Ok pero

yo utilizo el notepad y si en la linea 51 sale:

51:if pad:down() and current  menu2 then
52:current= menu3
53:end

Espero asi puedas ayudarme.

 


simpson
mgs

v10.0

Imagen de Kevinkl3

Yaa

Ah te falto el == como te han dicho..
Saludos!

Opciones de visualización de comentarios

Seleccione la forma que prefiera para mostrar los comentarios y haga clic en «Guardar las opciones» para activar los cambios.