Jump to content




Treasure disk displayed on moniter?


  • You cannot reply to this topic
6 replies to this topic

#1 Me!

  • New Members
  • 1 posts

Posted 01 April 2014 - 06:12 PM

I have an advanced computer connected to a moniter and a disk drive but cannot figure out how to make the treasure disk display on the monitor. The treasure disk is "alongtimeago".

Please help!

Thanks in advance. :)

#2 Lua.is.the.best

  • Members
  • 76 posts

Posted 02 April 2014 - 02:20 AM

The only way I can find out is to run the monitor program using shell.run.
Create a file in root (This has disk. rom, etc.) called monlnch.
Type:
shell.run("cd","disk")
shell.run("monitor","alongtimeago")
Then save and exit
Then type monlnch.
monlnch = what you want the name of the launching program to be
alongtimeago = the program you want to launch
Also, you have to hold Ctrl-T to exit the program.

Edited by Lua.is.the.best, 02 April 2014 - 02:22 AM.


#3 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 02 April 2014 - 02:31 AM

The monitor program requires the monitor side as an argument, for instance:

shell.run("monitor top alongtimeago")


#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 02 April 2014 - 07:09 AM

View PostLua.is.the.best, on 02 April 2014 - 02:20 AM, said:

The only way I can find out is to run the monitor program using shell.run.

:huh:

What's wrong with just typing eg:

cd disk
monitor top alongtimeago

... straight into CraftOS prompt?

#5 Lua.is.the.best

  • Members
  • 76 posts

Posted 02 April 2014 - 07:11 PM

View PostLyqyd, on 02 April 2014 - 02:31 AM, said:

The monitor program requires the monitor side as an argument, for instance:

shell.run("monitor top alongtimeago")
This is what the syntax should be"
shell.run(string program, string parameters)
So:
shell.run("monitor","top","alongtimeago")
EDIT: Wow.. How did I correct a.. admin? :rolleyes: :D :) ;)

Edited by Lua.is.the.best, 02 April 2014 - 07:19 PM.


#6 MKlegoman357

  • Members
  • 1,170 posts
  • LocationKaunas, Lithuania

Posted 02 April 2014 - 07:16 PM

View PostLua.is.the.best, on 02 April 2014 - 07:11 PM, said:

This is what the syntax should be"
shell.run(string program, string parameters)
So:
shell.run("monitor","top","alongtimeago")

You can put all of your arguments in one string using shell.run just like in Lyqyd's example.

#7 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 02 April 2014 - 10:50 PM

View PostLua.is.the.best, on 02 April 2014 - 07:11 PM, said:

View PostLyqyd, on 02 April 2014 - 02:31 AM, said:

The monitor program requires the monitor side as an argument, for instance:

shell.run("monitor top alongtimeago")
This is what the syntax should be"
shell.run(string program, string parameters)
So:
shell.run("monitor","top","alongtimeago")
EDIT: Wow.. How did I correct a.. admin? :rolleyes: :D :) ;)

shell.run concatenates its arguments into a single string before parsing out the command, so it doesn't matter either way. You can have any combination, like shell.run("monitor top", "alongtimeago"), the function doesn't care. Future advice for correcting people: review the ComputerCraft code to be sure you know what you're talking about first. The wiki is not authoritative.

Also, the main point of my post was that you missed the monitor side argument.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users