0
votes

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

2

2 Answers

1
votes

I found out the problem.

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

-1
votes

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