Scoptile, on 22 July 2015 - 07:15 PM, said:
Gotta have that "Poof!" in there
There have been 49 items by Zenon (Search limited from 10-February 22)
Posted by
Zenon
on 04 August 2015 - 01:46 AM
in
Programs
Wait_, on 03 August 2015 - 08:15 AM, said:
nitrogenfingers, on 24 July 2015 - 03:25 AM, said:
Atenefyr, on 25 July 2015 - 03:12 PM, said:



Posted by
Zenon
on 22 July 2015 - 08:28 PM
in
Ask a Pro
Dragon53535, on 22 July 2015 - 08:17 PM, said:
theMCcm, on 22 July 2015 - 07:53 PM, said:
hi cake whatchuwant2do Here are some numbers 25723598275982759Example read file:
local file = fs.open('text','r')
local line = file.readLine()
repeat
print(line)
line = file.readLine()
until not line
file.close()
Boom.print("Hi")
Becuase that would show up weird
MKlegoman357, on 22 July 2015 - 08:18 PM, said:
theMCcm, on 22 July 2015 - 07:53 PM, said:
file = fs.open("text")
fileText = file.readAll()
monitor.print(fileText)
Though doing that could make the text not fit, you could also read individual lines with "fs.readLine()" then print that on a new line each time. Hope that helped! ^.^local file = fs.open( "file.txt", "r" ) --# open the file 'file.txt' in read mode local contents = file.readAll() --# get all of the text inside the file file.close() --# close the file handle. THIS IS VERY IMPORTANT. ALWAYS CLOSE THE FILE HANDLE. --# after reading the file the 'contents' variable will hold the contents of the file print( contents ) --# print the contents of the file
Posted by
Zenon
on 22 July 2015 - 07:53 PM
in
Ask a Pro
AppleManYT, on 22 July 2015 - 11:44 AM, said:
file = fs.open("text")
fileText = file.readAll()
monitor.print(fileText)
Though doing that could make the text not fit, you could also read individual lines with "fs.readLine()" then print that on a new line each time. Hope that helped! ^.^
Posted by
Zenon
on 21 July 2015 - 09:30 PM
in
Ask a Pro
MKlegoman357, on 21 July 2015 - 08:43 PM, said:
local name = {...}
program = name[1]
# through the code:
shell.run("updater", "my_super_program")
#or through the shell:
> updater my_super_program
print(tostring(program[1]))
shell.run("pastebin", "get", program[2], "updatetest")
Posted by
Zenon
on 21 July 2015 - 08:13 PM
in
Ask a Pro
KingofGamesYami, on 21 July 2015 - 07:48 PM, said:
shell.run("themccm/updater", <insert program>)
I want to do this so I can run the program within a program, or seperately, and update the program without having to make a seperate updater for each program.
Posted by
Zenon
on 21 July 2015 - 07:21 PM
in
Ask a Pro
flaghacker, on 21 July 2015 - 06:15 AM, said:
parallel.waitForAll(e(), r())Remove the parentheses after 'e' and 'r'. Here you're calling them, but you want to pass them to the function instead. Fixed code:
parallel.waitForAll(e, r)
Posted by
Zenon
on 21 July 2015 - 06:33 PM
in
Ask a Pro
local name = {...}
program = name[1]
function update()
shell.run("pastebin", "run", "GVZYhGTS")
print(tostring(program[1]))
if program[1] == true then
shell.run("pastebin", "get", program[2], "updatetest")
end
end
update()
function update(program)
shell.run("pastebin", "run", "GVZYhGTS")
print(tostring(program[1]))
if program[1] == true then
shell.run("pastebin", "get", program[2], "updatetest")
end
end
update(enderdice)
Posted by
Zenon
on 21 July 2015 - 04:50 PM
in
Ask a Pro
H4X0RZ, on 21 July 2015 - 03:06 AM, said:
Lyqyd, on 21 July 2015 - 04:01 AM, said:
Posted by
Zenon
on 21 July 2015 - 02:59 AM
in
Ask a Pro
function updateCheck()
--shell.run("pastebin", "run", "GVZYhGTS")
--if enderdiceupdate == true then
--shell.run("pastebin", "get", program.."link", "updatetest")
shell.run("pastebin", "get", "KXRzGDcC", "updatecheck")
--end
end
attempt to index nil ? (a nil value)And I can use other functions in my api, so it isnt that.
Posted by
Zenon
on 21 July 2015 - 02:47 AM
in
Ask a Pro
H4X0RZ, on 21 July 2015 - 01:27 AM, said:
local f1 = function()
while true do
--do the event stuff here
end
end
local f2 = function(...)
--the same as above
end
parallel.waitForAll(f1, function()
f2("Random","arguments","foo","bar")
end)
Posted by
Zenon
on 21 July 2015 - 01:00 AM
in
Ask a Pro
function r()
ev, param1 = os.pullEvent()
if param1 == keys.r then
print("R")
end
end
function e()
ev, param1 = os.pullEvent()
if param1 == keys.e then
print("R")
end
end
parallel.waitForAll(e(), r())
function r()
ev, param1 = os.pullEvent()
if param1 == keys.r then
print("R")
end
end
function e()
ev, param1 = os.pullEvent()
if param1 == keys.e then
print("R")
end
end
parallel.waitForAll(e, r)
Posted by
Zenon
on 20 July 2015 - 01:57 AM
in
Ask a Pro
Dragon53535, on 20 July 2015 - 01:55 AM, said:
Posted by
Zenon
on 20 July 2015 - 01:44 AM
in
Ask a Pro
Bomb Bloke, on 20 July 2015 - 01:41 AM, said:
Posted by
Zenon
on 20 July 2015 - 01:36 AM
in
Ask a Pro
Wait_, on 20 July 2015 - 01:32 AM, said:
theMCcm, on 20 July 2015 - 01:28 AM, said:
--------------------------------------------------
--API Load--
file = fs.exists("themccm")
if file == false then
fs.makeDir("themccm")
end
file = fs.exists("themccm/API")
if file == false then
shell.run("pastebin", "get", "5ww6Pb8i", "themccm/API")
end
os.unloadAPI("themccm/API") --you didn't load the api before this
os.loadAPI("themccm/API")
Posted by
Zenon
on 20 July 2015 - 01:28 AM
in
Ask a Pro
--------------------------------------------------
--API Load--
file = fs.exists("themccm")
if file == false then
fs.makeDir("themccm")
end
file = fs.exists("themccm/API")
if file == false then
shell.run("pastebin", "get", "5ww6Pb8i", "themccm/API")
end
os.unloadAPI("themccm/API")
os.loadAPI("themccm/API")
--------------------------------------------------
--Color Loading--
file = fs.exists("themccm/enderdice")
if file == false then
fs.makeDir("themccm/enderdice")
end
file = fs.exists("themccm/enderdice/textcolor")
if file == false then
colorfile = fs.open("themccm/enderdice/textcolor", "w")
colorfile.writeLine("red")
colorfile.close()
end
colorfile = fs.open("themccm/enderdice/textcolor", "r")
textcolor = colorfile.readLine()
colorfile.close()
--------------------------------------------------
--Functions--
function introPrint()
print[[
Enter 'help' For A List Of Commands
What Dice Do You Want To Roll? -In Numbers-]]
term.write("Roll A d")
end
--------------------------------------------------
--Clear--
clear()
--------------------------------------------------
--Visuals--
term.setTextColor(colors.lime)
print[[
--------------------------------------------------]]
term.setTextColor(colors.purple)
print[[
---- ----
/ 20 \ -------------------- / 20 \
\ 20 / /Welcome To EnderDice\ \ 20 /
---- |For Your Dicey Needs| ----
---- \ Made By: theMCcm / ----
/ 10 \ -------------------- / 10 \
\ 10 / \ 10 /
---- Beta V1.1 ----]]
term.setTextColor(colors.lime)
print[[
--------------------------------------------------]]
if colors[textcolor] then
term.setTextColor(colors[textcolor])
end
introPrint()
--------------------------------------------------
--Main Code--
while true do
input = read()
inp = tonumber(input)
if type(inp) == "number" then
if inp < 1 then
term.clearLine()
print("Sorry, But Dice Need To Be Atleast One-Sided!")
elseif inp > 100000000000 then
term.clearLine()
print("That Would Crash The Program! Try A Smaller Number")
else
dice = math.random(input)
term.clearLine()
print("You Rolled A d"..inp.." And Got "..dice)
end
lineUp()
lineUp()
term.clearLine()
term.write("Roll A d")
else
if input == "exit" or input == "Exit" or input == "E" or input == "e" or input == "EXIT" then
clear()
break
elseif input == "help" or input == "h" or input == "Help" or input == "H" or input == "HELP" then
lineUp()
term.clearLine()
term.write("Roll A d")
lineDown()
lineDown()
print[[
Type 'Exit' To Exit (Duh :P/>)
Type 'Color' To Change Text Color]]
lineUp()
lineUp()
lineUp()
lineUp()
term.write("Roll A d")
elseif input == "color" or input == "c" or input == "Color" or input == "C" or input == "COLOR" then
lineUp()
term.clearLine()
term.write("Pick A Color: ")
textcolor = read()
if colors[textcolor] then
term.setTextColor(colors[textcolor])
colorfile = fs.open("themccm/enderdice/textcolor", "w")
colorfile.writeLine("colors."..textcolor)
end
term.clearLine()
lineDown()
term.clearLine()
lineDown()
term.clearLine()
lineUp()
lineUp()
lineUp()
term.clearLine()
lineUp()
term.clearLine()
lineUp()
term.clearLine()
introPrint()
else
lineUp()
term.clearLine()
term.write("Roll A d")
lineDown()
term.clearLine()
print("That Wasnt A Number! Try Again.")
lineUp()
lineUp()
term.write("Roll A d")
end
end
end
--------------------------------------------------
--Extras--
--Pastebin: www.pastebin.com/KXRzGDcC
--CompCraft Forums:
---http://www.computercraft.info/forums2/index.php?/topic/24031-enderdice/
--Thanks All And Hope You Enjoy My Dice Roller!
--------------------------------------------------
--theMCcm's API-- function clear() term.clear() term.setCursorPos(1,1) end function lineUp() x,y = term.getCursorPos() y = y - 1 term.setCursorPos(1, y) end function lineDown() x,y = term.getCursorPos() y = y + 1 term.setCursorPos(1, y) end function lineClear() term.clearLine() end
Posted by
Zenon
on 19 July 2015 - 07:30 PM
in
Ask a Pro
input = read() term.setTextColor(color.input)^That^ doesnt seem to work, so I was wondering if there was another way of doing that instead of the following:
input = read() if input == "red" then term.setTextColor(colors.red) end
Posted by
Zenon
on 19 July 2015 - 06:56 PM
in
Ask a Pro
Dragon53535, on 19 July 2015 - 06:54 PM, said:
Posted by
Zenon
on 19 July 2015 - 06:16 PM
in
Ask a Pro
