Post Reply 
im a lier
so help me plz (lua)
Author Message
Jomann
Chibi :3

Posts: 558.1177
Threads: 103
Joined: 15th Jul 2007
Reputation: 1.88741
E-Pigs: 25.8968
Offline
Post: #1
im a lier
you don't have to help me... Smokingg

but if you would that would be awesome Aha

I need some help with my code here:

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
--learn japanese
white = Color.new(255,255,255)

menu = Image.load("images/menu.png")
lesson1menu = Image.load("images/lesson1menu.png")
page1 = Image.load("images/lesson1/page1.png")
page2 = Image.load("images/lesson1/page2.png")
page3 = Image.load("images/lesson1/page3.png")
page4 = Image.load("images/lesson1/page4.png")
page5 = Image.load("images/lesson1/page5.png")
page6 = Image.load("images/lesson1/page6.png")
page7 = Image.load("images/lesson1/page7.png")
page8 = Image.load("images/lesson1/page8.png")
page9 = Image.load("images/lesson1/page9.png")
page10 = Image.load("images/lesson1/page10.png")
lessoncomplete = Image.load("images/lessoncompletedefault.png ")

menuon = true
page1 = false
page2 = false
page3 = false
page4 = false
page5 = false
page6 = false
page7 = false
page8 = false
page9 = false
page10 = false
lessondone = false

while true do
screen:clear(white)
pad = Controls.read()

if pad:cross() and menuon = true then
screen:clear(white)
page1 = true
end

--page1
if pad:r() and page1 = true then
screen:clear(white)
page1 = false
page2 = true
end

if pad:l() and page1 = true then
screen:clear(white)
page1 = true
page2 = false
end
--images
if page1 = true then
screen:blit(0,0,page1)
end

if page2 = true then
screen:blit(0,0,page2)
end

if pad:cross() and lessondone = "true" then dofile quiz1.lua() end
if pad:circle() and lessondone = "true" then dofile menu.lua() end

screen:blit(0,0,menu)
screen:blit(183,88,lesson 1menu)

screen.waitVblankStart()
screen.flip()
end


i keep getting the error line 35: 'then' expected near '=' help?

what my code says is, im at the menu, and if "X" is pressed show me page 1, and while im on page one if "R" is press show me page 2 but if "L" is pressed then send me back to page 1

haha, someone 'borrow' it, you don't know japanese!!! Ahaa j/k


[Image: Endless_paradigm_01.png]
(This post was last modified: 02/04/2008 11:33 PM by ZiNgA BuRgA.)
02/04/2008 01:22 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA
Smart Alternative

Posts: 17,023.4213
Threads: 1,174
Joined: 19th Jan 2007
Reputation: -1.71391
E-Pigs: 446.0333
Offline
Post: #2
RE: im a lier
This LUA or something?  Has some VB look-alike things...

Line 35:

Code:
if pad:cross() and menuon = true then

is that it?

Regardless, the message is saying a syntax error, so you might want to double check that your syntax is right.


---
Scanning over a LUA tutorial, it seems that it uses C style comparison operators - in other words, change the line to

Code:
if pad:cross() and menuon == true then

or

Code:
if pad:cross() and menuon then

02/04/2008 11:39 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

 Quick Theme: