Try putting the location, stack, name, damage into a table then textutils.serialize(table) then send that, so:
local rawTable = {location, stack, name, damage}
local sendTable = textutils.serialize(rawTable)
rednetFunction(sendTable)
There have been 80 items by Kryptanyte (Search limited from 10-February 22)
Posted by
Kryptanyte
on 22 November 2013 - 06:40 AM
in
Ask a Pro
local rawTable = {location, stack, name, damage}
local sendTable = textutils.serialize(rawTable)
rednetFunction(sendTable)
Posted by
Kryptanyte
on 22 November 2013 - 06:26 AM
in
Programs
Posted by
Kryptanyte
on 22 November 2013 - 06:23 AM
in
Programs
Posted by
Kryptanyte
on 22 November 2013 - 12:52 AM
in
Programs
ClearC file1 file2 -- This will clear file1 of comments and place the cleared file in file2 OR ClearC file1 -- This will clear file1 of comments and replace it in the same file
function this()
print("Some text here") -- Comment Here
-- And Another Comment
end
Will turn into this:
function this()
print("Some text here")
end
Posted by
Kryptanyte
on 23 April 2013 - 12:13 PM
in
General
Posted by
Kryptanyte
on 21 March 2013 - 05:54 PM
in
Forum Games
Posted by
Kryptanyte
on 21 March 2013 - 01:13 AM
in
Forum Games
Posted by
Kryptanyte
on 20 March 2013 - 10:17 PM
in
Forum Games
Posted by
Kryptanyte
on 15 March 2013 - 06:14 PM
in
General
Posted by
Kryptanyte
on 15 March 2013 - 12:16 AM
in
General
Posted by
Kryptanyte
on 15 March 2013 - 12:07 AM
in
Ask a Pro
Posted by
Kryptanyte
on 14 March 2013 - 11:59 PM
in
Ask a Pro
Posted by
Kryptanyte
on 14 March 2013 - 11:58 PM
in
Ask a Pro
function writeVar(saveTable)
save = textutils.serialize(saveTable)
file = fs.open("variables", "w")
file.write(save)
file.close()
end
function getVar()
file = fs.open("variables", "r")
vars = file.readAll()
file.close()
returnVars = textutils.unserialize(vars)
return returnVars
end
Posted by
Kryptanyte
on 14 March 2013 - 08:17 PM
in
Ask a Pro
function clear()
term.clear()
term.setCursorPos(1,1)
end
function checkNum(checkNum, usedTable)
for i = 1, #usedTable do
if checkNum == usedTable[i] then
return "used"
end
end
return "valid"
end
function checkNumV(checkNum, colTable, line)
if checkNum == colTable[line] then
return "used"
end
return "valid"
end
function genNumber()
number = math.floor(math.random(1,9))
return number
end
function genBox(line1, line2, line3)
usedTable = {}
usedTable[0] = {}
usedTable[1] = {}
usedTable[2] = {}
usedTable[3] = {}
for i = 1, 3 do
repeat
col1 = genNumber()
validity = checkNum(col1, usedTable[0])
until validity == "valid"
if validity == "valid" then
table.insert(usedTable[i], col1)
table.insert(usedTable[0], col1)
end
repeat
col2 = genNumber()
validity = checkNum(col2, usedTable[0])
until validity == "valid"
if validity == "valid" then
table.insert(usedTable[i], col2)
table.insert(usedTable[0], col2)
end
repeat
col3 = genNumber()
validity = checkNum(col3, usedTable[0])
until validity == "valid"
if validity == "valid" then
table.insert(usedTable[i], col3)
table.insert(usedTable[0], col3)
end
end
return usedTable[1], usedTable[2], usedTable[3]
end
function genLine()
usedLine = {}
usedLine[1] = {}
usedLine[2] = {}
usedLine[3] = {}
usedLine[4] = {}
usedLine[5] = {}
usedLine[6] = {}
usedLine[7] = {}
usedLine[8] = {}
usedLine[9] = {}
usedCol = {}
usedCol[1] = {}
usedCol[2] = {}
usedCol[3] = {}
usedCol[4] = {}
usedCol[5] = {}
usedCol[6] = {}
usedCol[7] = {}
usedCol[8] = {}
usedCol[9] = {}
for i = 1, 9 do
usedTable = {}
repeat
line = genNumber()
validity = checkNum(line, usedTable)
until validity == "valid"
if validity == "valid" then
table.insert(usedLine[i], line)
table.insert(usedTable, line)
table.insert(usedCol[i], line)
end
for v = 2, 9 do
repeat
line = genNumber()
validity = checkNumV(line, usedCol[v], i)
until validity == "valid"
if validity == "valid" then
table.insert(usedLine[i], line)
table.insert(usedCol[v], line)
table.insert(usedTable, line)
end
end
end
return usedLine, usedCol
end
table1, table2 = genLine()
clear()
for i = 1, 9 do
printthis = table.concat(table1[i], ",")
print(printthis)
end
Posted by
Kryptanyte
on 13 March 2013 - 10:57 PM
in
Turtle Programs
Posted by
Kryptanyte
on 13 March 2013 - 10:34 PM
in
Turtle Programs
Posted by
Kryptanyte
on 13 March 2013 - 04:37 PM
in
Programs
Posted by
Kryptanyte
on 13 March 2013 - 07:41 AM
in
General
Posted by
Kryptanyte
on 13 March 2013 - 01:08 AM
in
General
Posted by
Kryptanyte
on 11 March 2013 - 11:41 PM
in
Ask a Pro
Posted by
Kryptanyte
on 11 March 2013 - 11:33 PM
in
Ask a Pro
Posted by
Kryptanyte
on 11 March 2013 - 11:32 PM
in
Ask a Pro
Posted by
Kryptanyte
on 11 March 2013 - 11:16 PM
in
Ask a Pro
Posted by
Kryptanyte
on 11 March 2013 - 11:15 PM
in
Ask a Pro
tableToJoin = {1,2,3,4,5,6,7}
joined = table.concat(tableToJoin, ",")
Posted by
Kryptanyte
on 11 March 2013 - 10:29 PM
in
Ask a Pro
