minebuild02, on 25 October 2017 - 03:10 PM, said:
Luca_S, on 21 October 2017 - 06:00 PM, said:
Also this fixes the File not found bug.
Pastebin: R9K4JHZN
There have been 9 items by Ilikemlp123 (Search limited from 10-February 22)
Posted by
Ilikemlp123
on 30 October 2017 - 03:08 AM
in
APIs and Utilities
minebuild02, on 25 October 2017 - 03:10 PM, said:
Luca_S, on 21 October 2017 - 06:00 PM, said:
Posted by
Ilikemlp123
on 13 October 2017 - 12:09 AM
in
APIs and Utilities
lsc exampleExample Script:
ls cd .. cd rom ls cd programs ls cd ../.. programsHow to write a script(for dummies):
Luca_S, on 21 October 2017 - 06:00 PM, said:
Posted by
Ilikemlp123
on 12 October 2017 - 02:46 AM
in
Ask a Pro
Posted by
Ilikemlp123
on 12 October 2017 - 02:11 AM
in
Ask a Pro
local tArgs = { ... } --args
if #tArgs == 0 then --args
print('Usage: lsc <path>') --Print Usage
else
local path = tArgs[1] --path
local Scr = fs.open('path','r') --attempted fs access
local loop = true --loop
while loop do --loop begin
local commands = {} --empties commands
local line = Scr.readLine(1) --reads line
if line then --if the line has things
text = nil --nillifies text
for text in line:gmatch('%w+') --attempts to split text
do table.insert(commands,text) --more split
end--end split
for i=1,#commands do shell.run(commands[i]) --executes
end --end
else --else loop
loop = false --ends loop
end
end
end
i am a noob at lua.
Posted by
Ilikemlp123
on 06 September 2017 - 01:40 PM
in
Suggestions
Posted by
Ilikemlp123
on 26 April 2017 - 04:47 PM
in
Tutorials
local port = 1337 //this is very important, it sets the port for the wireless execution, change 1337 to whatever number you want(has to be between 0 and 65535)
local modem = peripheral.find("modem") //this wraps the modem. you'll need this
modem.open(port) //this opens the previously mentioned port
local function read() //this is where we overwrite the read() function
local event,s,r,message,dis = os.pullEvent("modem_message") //this gets messages from the modem
if s == 1337 then //this makes sure you're on the 1337 channel to avoid errors
return message //tells the computer what do do
end //ends the if statement
end //ends the function
save and exit the editor.//start
local send = 1337 //sets the transmit channel, change this to the one in the first program
local rec = 137 //arguably useless
local tArgs = { ... } //grabs args for stuff
local modem = peripheral.find("modem") //looks for the modem, to send things
if #tArgs then print("to use wireless lua prompt, simply type 'wlua' ") //yells at you for arguing with it
else //else
while true do //loops it
local x = read() // sets x to the given input
if x ~= "end()" then //checks x for the end
modem.transmit(send,rec,x) //transmits your variable
else //else
modem.transmit(send,rec,'end()') //transmits the end
break end //breaks the loop and ends the IF statement
end //ends the other IF statement
end //ends the loop
Posted by
Ilikemlp123
on 26 April 2017 - 04:58 AM
in
Suggestions
//send event
C1 = peripheral.find("computer")
C1.sendEvent("remoteEvent","params")
//send program
C1.sendProgram("path","remotepath")
Posted by
Ilikemlp123
on 16 January 2017 - 09:04 PM
in
Suggestions
Posted by
Ilikemlp123
on 16 January 2017 - 08:57 PM
in
Suggestions
