This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Dustmuz's profile picture

os.pullEvent("mouse_click") - Syntax error (solved)

Started by Dustmuz, 24 November 2015 - 10:51 PM
Dustmuz #1
Posted 24 November 2015 - 11:51 PM
Hello fellow ComputerCrafters

i hope this is an easy fix..

im getting a syntax error in this line

local event, button, MouseX, MouseY = os.pullEvent("mouse_click") (Solved)
Is there anything wrong with that line? or should i look elsewhere in my program?


New problem: http://pastebin.com/5DLmVSzP
Window:88: expected number (solved)
a pair of "" had found its way into a setTextColor()
Edited on 25 November 2015 - 06:37 AM
Dragon53535 #2
Posted 24 November 2015 - 11:52 PM
try the line above it
Waitdev_ #3
Posted 25 November 2015 - 06:26 AM
can you post full code and the line number please? that would help us help you. though, try doing

e,b,x,y = os.pullEvent("mouse_click")
Dustmuz #4
Posted 25 November 2015 - 06:57 AM
Dragon was right on this one.. it was the line above it..


But now i ran into a new problem..
window:88: expected number

http://pastebin.com/5DLmVSzP
only problem is.. my code is only 69 lines long..
(updated top post aswell)
Edited on 25 November 2015 - 06:05 AM
H4X0RZ #5
Posted 25 November 2015 - 07:09 AM
If the window API causes an error, it most likely is a malformed term call.

//Edit: on line 28 you are using a string for .setTextColor, but it wants a number.
Edited on 25 November 2015 - 06:11 AM
Dustmuz #6
Posted 25 November 2015 - 07:24 AM
arh.. didnt even notice that one :)/>
thanks for that one.. i'll check if that solved the problem (need to boot my game)
Waitdev_ #7
Posted 25 November 2015 - 10:51 AM
might want to point out, the colours api is your friend. for example you did setTextColor(green), which needs to be setTextColour(colours.green) (or colors.green)
do "help colours" in the shell for more colours
Bomb Bloke #8
Posted 25 November 2015 - 10:57 AM
Line 5 has him covered there.