i have a program that periodicly opens this:
local todofile = fs.open("disk/todo.txt", "r")
local todo = peripheral.wrap("monitor_9")
todo.setCursorPos(1,2)
local towrite = todofile.readAll()
todofile.close()
todo.write(towrite)
[/CODE]
in multishell and i cant get it to close its tab once it is done. there ends up being many of them just saying press any key to end/close
how would i do this?
3
closing a program when finished
Started by DusterTheFirst, Jun 23 2016 11:31 AM
5 replies to this topic
#1
Posted 23 June 2016 - 11:31 AM
#2
Posted 23 June 2016 - 05:34 PM
Not tested, but if it's asking for a key you can give it a fake key press like so:
os.queueEvent("key",42)That way, the next time os.pullEvent is called it will return a key event for key 42
#3
Posted 24 June 2016 - 12:59 PM
Incinirate, on 23 June 2016 - 05:34 PM, said:
Not tested, but if it's asking for a key you can give it a fake key press like so:
os.queueEvent("key",42)That way, the next time os.pullEvent is called it will return a key event for key 42
#4
Posted 24 June 2016 - 01:04 PM
return
Edited by CrazedProgrammer, 24 June 2016 - 01:05 PM.
#5
Posted 24 June 2016 - 01:33 PM
Add this code to the end of your program:
And create another program that will execute the other program:
os.queueEvent( "myProgramIsFinished" ) --Rename this sleep( 0 ) multishell.setFocus( multishell.getCurrent() )
And create another program that will execute the other program:
shell.openTab( "path/to/file" ) os.pullEvent( "myProgramIsFinished" ) --Rename this local currentTab = multishell.getFocus() sleep( 0 ) multishell.setFocus( currentTab )
#6
Posted 26 June 2016 - 01:22 AM
thanks
Edited by DusterTheFirst, 26 June 2016 - 01:25 AM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users