Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

Archived

This topic is now archived and is closed to further replies.

jhagrid77

Basic Scripts (Maybe More too)

Recommended Posts

Legend:

Bold = What scripts are here

Italics = What it does/short description

Underline = Helpful information

Plain = My preference/other information

 

If you would like any of these in a pre-made script, please comment and I will paste it onto something and provide the link.

 

This is just a place for some scripts that I thought I would throw together so you wouldn't have to go around searching the entire website:

Have you ever wanted to fix your resolution because it is too big (is that even possible) or too small well here are two scripts:

component=require("component")
gpu = component.gpu

gpu.setResolution(#, #)

OR

os.execute("resolution # #")

Where # is put the resolution you would like, the first is width and the second is height, or you can do.

I prefer the first method as it won't clear the screen but it's up to you. Make sure to put it in your autorun.lua file.

 

Have you ever wanted to have your hard drive mounted? Here's how:

local fs = require("filesystem")
local proxy = ...
fs.mount(proxy, "/name")

Where /name is you can put it in a folder like I do, so I would put "/Hard-Drives/Main" or something like that or you can just mount it directly to the root folder. Make sure to put this in your autorun.lua too, if you put this in extra hard drives, make sure to put it first so it will defiantly be mounted.

 

More scripts to come!

 

(I take no credit for these scripts as I didn't make any.)

 

Scripts I have done/worked on:

Computronics, have you wanted to play a tape and automatically stop and rewind it but wanted it all in one program? Well here it is:

print("To stop press Ctrl + Alt + C")
os.execute("tape.lua play")
os.sleep(song length in seconds)
os.execute("tape.lua stop")
os.execute("tape.lua rewind")

Make sure to get tape.lua from the tape drive, then put it in the same place as this file.

Share this post


Link to post
Share on other sites

jhagrid77,

 

Would you have any insight on how to properly use program arguments? An example script would be phenomenal.

 

Cheers

Share this post


Link to post
Share on other sites

jhagrid77,

 

Would you have any insight on how to properly use program arguments? An example script would be phenomenal.

 

Cheers

 

Are you talking about parameters such as "cp -r"?

Share this post


Link to post
Share on other sites

Yes, options as you describe them, as well as input parameters such as numbers or strings that can be used by the program. eg. a farming program might accept the following: "farm 9 9"

 

The provided digits might indicate the dimensions to farm within.

Share this post


Link to post
Share on other sites

Yes, options as you describe them, as well as input parameters such as numbers or strings that can be used by the program. eg. a farming program might accept the following: "farm 9 9"

 

The provided digits might indicate the dimensions to farm within.

 

Well each program is different, but you should always just put the program name "farm" and it should say something like "invalid parameters" and then say which are accepted. If that doesn't work you would need to look for the program and see if it has any instructions.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.