- ComputerCraft | Programmable Computers for Minecraft
- → Varscott11's Content
Varscott11's Content
There have been 23 items by Varscott11 (Search limited from 10-February 22)
#261331 Test for a sub directory
Posted by
Varscott11
on 02 November 2016 - 07:31 PM
in
Ask a Pro
#261287 Test for a sub directory
Posted by
Varscott11
on 01 November 2016 - 09:16 PM
in
Ask a Pro
("UO_Users/") --Test for any subdir in this folder.
I've tried fs.list, but the table it produces never seems to work like it should
Any help appreciated
#258618 Load a files code and run it in a different program
Posted by
Varscott11
on 29 August 2016 - 03:24 PM
in
Ask a Pro
P.S Thanks for the help so far.
#258570 Load a files code and run it in a different program
Posted by
Varscott11
on 28 August 2016 - 03:49 PM
in
Ask a Pro
#258534 Load a files code and run it in a different program
Posted by
Varscott11
on 28 August 2016 - 02:09 AM
in
Ask a Pro
#258532 Load a files code and run it in a different program
Posted by
Varscott11
on 28 August 2016 - 01:56 AM
in
Ask a Pro
#258527 Load a files code and run it in a different program
Posted by
Varscott11
on 28 August 2016 - 01:02 AM
in
Ask a Pro
file1:"unet"
file2:"unetclientdata/libraries/rnetconfigx12"
I need the unet program to load the entire file, rnetconfigx12, and run it as if the code for file2 was part of file1.
Sorry if this is too much, but I also need them to be compatible with each other. As in file 2 can call functions from file 1 and vise versa.
Any help is appreciated!
#258510 test if modem is activated?
Posted by
Varscott11
on 27 August 2016 - 05:47 PM
in
Ask a Pro
#258504 test if modem is activated?
Posted by
Varscott11
on 27 August 2016 - 04:51 PM
in
Ask a Pro
#255489 for loop is only able to run once?
Posted by
Varscott11
on 04 July 2016 - 06:30 PM
in
Ask a Pro
Thanks for trying to help me. Appreciate it
#255487 for loop is only able to run once?
Posted by
Varscott11
on 04 July 2016 - 06:24 PM
in
Ask a Pro
WOW! I've got to stop posting on the forums to early. I needed to put this:
local list = { [2] = "value1", [6] = "value2"}
local foundvalue = false
local uservalue = io.read()
foundvalue = false
for key,value in pairs(list) do
if value == uservalue then
foundvalue = true
else
--nothing is supposed to go here
end
end
if foundvalue == false then
--blah,blah,blah
it needed to set foundvalue back to false so that if it could run again. Sorry for the trouble.
Also by using [code] tags, does that put it into code form?
#255479 for loop is only able to run once?
Posted by
Varscott11
on 04 July 2016 - 05:20 PM
in
Ask a Pro
local list = { [2] = "value1", [6] = "value2"}
local foundvalue = false
local uservalue = io.read()
for key,value in pairs(list) do
if value == uservalue then
foundvalue = true
else
--nothing is supposed to go here
end
end
if foundvalue == false then--executes code at the end of the for loop if it has not found the value
--blah,blah,blah
the for loop works great, but only once. The next time I try to activate it from a function, it doesn't seem to want to run.
Any ideas?
#255438 test if for loop has ended
Posted by
Varscott11
on 03 July 2016 - 11:18 PM
in
Ask a Pro
#255431 test if for loop has ended
Posted by
Varscott11
on 03 July 2016 - 10:14 PM
in
Ask a Pro
local list={ [1] = "string1", [2] = "string2"}
local string
for key,value in pairs(list) do
if string == value then
--blah,blah,blah
end
end
--part that is supposed to execute code once the for loop is completed
#255426 get the location of a value in a table
Posted by
Varscott11
on 03 July 2016 - 09:18 PM
in
Ask a Pro
for key,value in pairs do
blah, blah, blah.
Is there a way to find the key value that equals the actual value?
kind of like this but in reverse:
local list={ [1] = "hello"}
local value=list[1]
#255413 send a script through rednet to be executed on the other side
Posted by
Varscott11
on 03 July 2016 - 07:44 PM
in
Ask a Pro
#255408 send a script through rednet to be executed on the other side
Posted by
Varscott11
on 03 July 2016 - 06:54 PM
in
Ask a Pro
#255404 send a script through rednet to be executed on the other side
Posted by
Varscott11
on 03 July 2016 - 05:11 PM
in
Ask a Pro
#254872 string.sub question
Posted by
Varscott11
on 26 June 2016 - 04:09 PM
in
Ask a Pro
Why thank you good sir. It works!
#254870 string.sub question
Posted by
Varscott11
on 26 June 2016 - 03:58 PM
in
Ask a Pro
I have set up a string.sub to handle this that looks like this:
id, message = rednet.receive()
messagesub = string.sub(message, pos1, pos2)
I've tried:
local messagelength = #message - 4 --subtract for from the total length
message = string.sub(message, messagelength)
However, its keeps giving me an error, "attempt to get length of nil"
what I was wondering is if there is a way to get the last 4 letters of the string. Any help is appreciated!
#254815 Create a lua interpreter
Posted by
Varscott11
on 26 June 2016 - 01:34 AM
in
Ask a Pro
#254719 Create a lua interpreter
Posted by
Varscott11
on 24 June 2016 - 04:22 PM
in
Ask a Pro
Any help is appreciated
#254528 Create a lua interpreter
Posted by
Varscott11
on 22 June 2016 - 06:17 PM
in
Ask a Pro
- ComputerCraft | Programmable Computers for Minecraft
- → Varscott11's Content


