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

Please help!

Started by SanderUlset, 31 August 2012 - 11:37 AM
SanderUlset #1
Posted 31 August 2012 - 01:37 PM
Ive tried to make my monitor run a program,
its simply is
monitor left husk
and the program husk is simply
print ("Remember to log off!")
and i get this error

bios:206: [string "test"]:1: "=" expected

Anyone knows what to do?
Kingdaro #2
Posted 31 August 2012 - 02:52 PM
This problem is usually caused by trying to call a function without parentheses, or simply stating a word without doing anything else with it.

var
^will cause an error.
SanderUlset #3
Posted 31 August 2012 - 05:38 PM
Clueless what do you mean? Im a real noob..
Tiin57 #4
Posted 31 August 2012 - 08:53 PM
Clueless is a title; Kingdaro is his name, as tiin57 is mine.
Cozzimoto #5
Posted 31 August 2012 - 09:26 PM
try this. i have a variable declared before the program runs and an array of all the sides of the computer. this will scan for a monitor and if one is found it wraps it and prints on the screen "Remember to log off"

the reason this scans for a monitor is so that all you need to do is run your program instead of typing 'monitor right test' you just type 'test' and it does everything you need for you

hope this solves your problem! =)




MON = ""
Csides = {"left", "right", "top", "bottom", "back"}

for i = 1, 5 do
  if peripheral.isPresent(Csides[i]) then
    if peripheral.getType(Csides[i]) == "monitor" then
      MON = peripheral.wrap(Csides[i])
      MON.write("Remember to Log off!!")
    end
  end
end
Imgoodisher #6
Posted 31 August 2012 - 09:58 PM
I think you have a space between your print and the (). you don't want a space.