0

Okay so here is my function:

function button1()
    mon.clear()
    sleep(.25)
    shell.run("movie")
end

Says: "attempt to index ? (a nil value)" for the shell.run("movie") line

greatwolf
  • 20,287
  • 13
  • 71
  • 105
cj89898
  • 67
  • 5

2 Answers2

1

I found out the problem.

You can't call shell.run() from another program using os.loadAPI()

cj89898
  • 67
  • 5
  • 2
    This seems like a really weird restriction. Are you sure this is correct? – Colonel Thirty Two Dec 23 '14 at 22:59
  • Yes, that's totally correct. The usecase of `os.loadAPI()` is not to load aditional **active** parts for a program. It is used to load librarys which contain shared functions – Mischa Dec 04 '15 at 12:40
-1

so you have declared the mon variable and the function() there are two choices

  1. switch the this command to shell.run("monitor side movie")

  2. rewrite the program and in the function replace mon.setCursorPos(1.1) to term.setCursorPos(1,1) then when you run the program type "monitor side program" ok

ADEPrime
  • 1
  • 2