Jump to content


luza's Content

There have been 42 items by luza (Search limited from 30-March 23)


By content type

See this member's


Sort by                Order  

#1572 Start Computer With A Password

Posted by luza on 26 February 2012 - 01:40 PM in Programs

you can easily bypass it by using ctrl + t.



#1055 Neui Programs (Multilaunage Craftos1.2)

Posted by luza on 22 February 2012 - 04:58 PM in Programs

Es heißt Language <_</>



#1052 In Game Time Clock

Posted by luza on 22 February 2012 - 04:23 PM in Programs

can someone move this to the peripheral section please?



#1051 Masked Input Api

Posted by luza on 22 February 2012 - 04:12 PM in Programs

DERP DERP. I JUT REALISED read("*") DOES THE SAME...






function maskedInput(pReplace)
local replace = pReplace or "*"
local x,y = term.getCursorPos()
local input = {}
term.setCursorBlink(true)

while true do
    local event, p1 = os.pullEvent()
    if event == "char" then
	    input[#input+1]=p1
	    write(replace)
    elseif event == "key" then
	    if p1 == 28 then --enter
		    break
	    elseif p1 == 14 then --backspace
		    table.remove(input)
		    term.setCursorPos(x+#input, y)
		    write(" ")
		    term.setCursorPos(x+#input, y)
	    end
    end
end
 print("")
term.setCursorBlink(false)
return table.concat(input)
end






#1046 [Forum Request] Oses & Password Locks

Posted by luza on 22 February 2012 - 03:32 PM in General

View PostFuzzyPurp, on 20 February 2012 - 02:27 PM, said:

Haha - take ALL of CraftOS files out of the /rom folder, and then start coding. That's an OS <_</>

Posted Image

Here's the result!



#1044 Too Long Without Yielding

Posted by luza on 22 February 2012 - 03:27 PM in Ask a Pro

you forgot some brackets.

while true do
shell.run("redside")
end



#1042 [1.3] Midcraft Commander 0.5.0.3 - An Orthodox File Manager

Posted by luza on 22 February 2012 - 03:19 PM in Programs

 MewK, on 22 February 2012 - 12:18 AM, said:

there is no good way to check whether a file is a program or not. not even craftos can d that.
just type "rom/help/list" on the shell and you'll see the same error.

yes, there is.
fs.isDir( path )



#1031 Simple Door Password On Startup Or Command

Posted by luza on 22 February 2012 - 06:00 AM in Media

I like it. But only because of your accent.
Program is nothing special.



#1030 Luza's Database Api

Posted by luza on 22 February 2012 - 05:54 AM in Programs

release in probably 2 days



#989 Table.remove Isn't Working.

Posted by luza on 21 February 2012 - 04:37 PM in Ask a Pro

aaaaaaaaaaaah thanks.

:huh:/>



#985 Useful Tutorials & Resources

Posted by luza on 21 February 2012 - 03:17 PM in Ask a Pro

View PostAdvert, on 21 February 2012 - 02:58 PM, said:

View PostFuzzyPurp, on 21 February 2012 - 02:58 PM, said:

View Postluza, on 21 February 2012 - 01:24 PM, said:

Anyone has got problems if I translate some of them to german so that non-english speakers can use them too?

Web browsers should auto translate or ask to their native language. May be unnecessary.

No. Just no. Have you seen what that translation comes up with?
exspecially because all the programming terms are in english and the browser will try to translate them aswell.



#978 Tutorial: Creating An Api

Posted by luza on 21 February 2012 - 02:25 PM in Tutorials

German translation:

Es ist ziemlich einfach ein API in Computercraft zu erstellen.
Definiere einfach die Funktionen die du in deinem API haben möchtest und speichere sie in einer Datei. Um das API zu laden benutze os.loadAPI(apiname).

Beispiel: speichere das als HBW (Halbbeständige Werte)
-- Beispiel halbbeständige Werte (speichert die werte nicht, das könntest du natürlich hinzufügen) API
local data = {}

-- Gibt die Versionsnummer dieses API zurück. Das kann für Entwickler sehr nützlich sein; besonders bei komplizierten APIs.
function getVersion()
return 0.2
end

-- eine Funktion um Werte vom API zu bekommen.
function getData(key)
return data[key]
end

-- eine Funktion um Werte im API festzulegen.
function setData(key, value)
local oldData = data[key]
data[key] = value
return oldData -- es ist beim Festlegen neuer Werte immer sinnvoll die alten Werte zurückzugeben.
end



#973 Table.remove Isn't Working.

Posted by luza on 21 February 2012 - 01:27 PM in Ask a Pro

I just tested table.remove() with my example code. works if I don't use table as a variable name. So the error must be in my function.. :/



#971 Useful Tutorials & Resources

Posted by luza on 21 February 2012 - 01:24 PM in Ask a Pro

Anyone has got problems if I translate some of them to german so that non-english speakers can use them too?



#969 Table.remove Isn't Working.

Posted by luza on 21 February 2012 - 01:18 PM in Ask a Pro

well, that was just an example code. this is my actual code:

function deleteLine(table, index) --expects string, number
	local path = getTablePath(table)
	local fields = {}
	fields = getFields(table)

	local file = nil
	local field_content = {}
	local file_path = nil
	for i=1, #fields, 1 do


		field_content = getField(table, fields[i])

	    -- everything is working until here.

		table.remove(field_content,index)

		file_path = path..fields[i]
		file = io.open(file_path, "w")
		file:write(field_content)
		file:close()
	end
end



#968 [1.3] Midcraft Commander 0.5.0.3 - An Orthodox File Manager

Posted by luza on 21 February 2012 - 01:13 PM in Programs

Just tested it out. GREAT!
but can you make it possible to select multiple files?



#965 Table.remove Isn't Working.

Posted by luza on 21 February 2012 - 01:09 PM in Ask a Pro

table = {"lukas","peter","hans"}

for i=1, #table, 1 do
    print(table[i])
end

table.remove(table, 2)


for i=1, #table, 1 do
    print(table[i])
end

I get the output:
lukas
peter
hans
attemt to call nil

Can't I use the table.remove function in CC?



#963 My Website

Posted by luza on 21 February 2012 - 12:49 PM in General

pleeeease, pleeeease learn html and css. It's not that hard but self-coded websites look so much better.



#960 [Sugestion] Computer Screens Displays Letter+Numbers

Posted by luza on 21 February 2012 - 12:38 PM in General

@Suggestions 1: Build a peripheral for it!


@Suggestion 2: Totally agreed.



#841 Item Counting And Retrieving Sytem

Posted by luza on 20 February 2012 - 09:53 AM in Media

*cough* simply use logistics pipes ;)/>

but anyway, nice system.



#840 Tutorial Request?

Posted by luza on 20 February 2012 - 09:52 AM in General

There's a gameAPI in reworks which sould be pretty much self-explanatory.



#839 Filesystem Access Over Network & Dependency Check

Posted by luza on 20 February 2012 - 09:49 AM in Ask a Pro

@your second question:

You could check if the startup file contains keywords like "reworks" or you could check with fs.exists if some special files only redworks would use exist on the computer.



#837 Luza's Database Api

Posted by luza on 20 February 2012 - 09:43 AM in Programs

Luza's Database API


As I haven't found any nice database programs for cc yet I decided to write one myself.
I've not yet finished coding it yet (one function isn't working correct) but I think it'll be released quite soon.

Functions:
  • getVersion()
  • createDatabase(database)
  • dropDatabase(database)
  • selectDb(database)
  • closeDb(database)
  • createTable(table, fields)
  • getTablePath(table)
  • dropTable(table)
  • getFields(table)
  • getField(table, field)
  • getLine(table, index)
  • insert(table, value)
  • select(table, field, like)

Functionexplanations:


getVersion()


Returns the version of the API.

createDatabase(database)


Expects a string. A new database called $database will be created.

dropDatabe(database)


Expects a string. The database $database will be deleted.

selectDb(database)


Expects a string. "opens a connection to the database $database" (not really correct but it's difficult to explain)

closeDb(database)


Expects a string. "closes the connection to the database $database" (again, not really correct)

createTable(table, fields)


Expects a string and a table. Will create a table in the database selected with selectDb() with the fields in $fields.

dropTable(table)


Expects a string. Will delete the table in the database selected with selectDb().

getFields(table)


Expects a string. Will return a table with all the fields in the table $table in the database selected in selectDb().

getField(table, field)


Expects a string and a string. Will return a table with the content of the field $field in table $table in the database selected in selectDb().

getLine(table, index)


Expects a string and a number. Will return a table with the content of the $index-th line of the table $table in the database selected in selectDb().

insert(table, value)


Expects a string and a table. Will insert the content of $value into the table $table in the database selected in selectDb().

select(table, field, like)


Expects a string, table and a table. Will return a two dimensional table containing the fields in witch $field[i] == $like[i]

As it's hard to explain here'S an example:
selectDb("luza")
createTable("testtable",{"field1","field2","field3"}
insert("testtable",{"test","cc","luza"})
insert("testtable",{"test","cc","peter"})

findings = select("testtable",{"field1","field2"},{"test","cc"})

print(findings[1][3])		   --Output:  luza
print(findings[2][3])		   --Output: peter



To Do:
  • release it ;)/>
  • add an "update" function



#835 Humble Suggestions For Better Guis

Posted by luza on 20 February 2012 - 09:08 AM in General

Hm... Minecraft supports "Ä","ö","ü" and "ß" (I don't know how you call them in english ;)/> ) but cc doesn't.



#834 Stop Your Program Being Terminated

Posted by luza on 20 February 2012 - 09:05 AM in Ask a Pro

you could for example put your password system into another file.
And into the startupsystem you write:
while true do
shell.run("check")  --for "check" you write the name of your passwordsystem file.
end

that would be the simpliest method.

You could also change the os.pullEvent() method but I think in your case it's not necessary.