Jump to content


faubiguy's Content

There have been 225 items by faubiguy (Search limited from 30-March 23)


By content type

See this member's


Sort by                Order  

#139688 [Closed]Hello Overly Complex World - Most Complex "hello World" Scrip...

Posted by faubiguy on 13 August 2013 - 12:23 AM in General

pastebin.com/qGMT3S3s

Its a maze game. It should be obvious what to do.
Arrow keys to move, and spacebar to put a letter back down if you messed up



#106044 Accessing the second of multiple returned variables

Posted by faubiguy on 04 April 2013 - 10:00 AM in Ask a Pro

Time-wise, using a placeholder variable is best, as shown by this code
Spoiler

Of course, if you're not calling it hundreds of thousands times, the difference will be negligible (besides which, rednet.receive yields until it gets a message or timeout, so that will take much longer than getting the second return value) :P



#105383 Annoying pixels

Posted by faubiguy on 03 April 2013 - 02:16 AM in Suggestions

I believe that's because of the margin around the whole screen. If the colors didn't fill it in, there would always be a black line surrounding the screen. But without the margin, characters near the edge of the screen would probably look too close to it.



#105229 Exception - bios:206: [string "startup"]:4: '=' expected. Why?

Posted by faubiguy on 02 April 2013 - 05:19 PM in Ask a Pro

if you want to run a program from inside of a program, you need to use shell.run, like
shell.run('program', 'argument1', 'argument2')

So replace every line like
run monitor top ToDo
with
shell.run('monitor', 'top', 'ToDo')

You also need to have an end statement for every if statement, to mark where the code in the if statement (that you only want to run if the condition is true) ends, like
if condition then
  -- Do stuff
end



#104724 [ERROR] attempt to call nil [SOLVED]

Posted by faubiguy on 02 April 2013 - 03:40 AM in Ask a Pro

Just change note in
note = read()
to some other variable name (like input), and use than same name when you check if its "exit". THat way it won't overwrite the opened file which is stored to note



#104033 I need help with this program again?

Posted by faubiguy on 31 March 2013 - 02:20 PM in Ask a Pro

The version of ComputerCraft used in tekkit (1.33) doesn't include the keys API, which that program uses (though it can be copied to the computer if the server has http enabled, or you can use the key codes directly) . There's also no paintutils API, because there aren't advanced computers/colors, so any attempt to use that will also cause an error.



#104016 Three Word Story

Posted by faubiguy on 31 March 2013 - 01:15 PM in Forum Games

followed the turtles



#103779 Curious to why this isn't doing anything

Posted by faubiguy on 30 March 2013 - 07:52 PM in Ask a Pro

When you open the file in recall, nothing has actually been written to the file because you haven't called file.close. In the main part, Instead of opening the file once per loop, I'd probably open it each time a command needs to be added (in append mode), write the command, and close it
Immediately after. (also close it in recall after reading from it)

You may want to reset the file contents at the end of recall, which can be done by opening the file in write mode then closing it again



#103777 Three Word Story

Posted by faubiguy on 30 March 2013 - 07:43 PM in Forum Games

unicorns and rainbows.



#103769 So Confused..

Posted by faubiguy on 30 March 2013 - 06:43 PM in Ask a Pro

From looking at this, it appears that the turtle moves forward in the
if turtle.forward() == false then
and again in the else block since it moved =, and therefore wasn't false. So you should try removeing the else in Gravel

Edit: Ninja'd



#103767 Three Word Story

Posted by faubiguy on 30 March 2013 - 06:39 PM in Forum Games

to invade the



#103762 Three Word Story

Posted by faubiguy on 30 March 2013 - 06:24 PM in Forum Games

was ordered by



#103757 Three Word Story

Posted by faubiguy on 30 March 2013 - 06:06 PM in Forum Games

and attacked the



#103748 Three Word Story

Posted by faubiguy on 30 March 2013 - 05:43 PM in Forum Games

became deserted, so



#103724 [Solved]Frame Quarry, Expected String, Number

Posted by faubiguy on 30 March 2013 - 03:52 PM in Ask a Pro

Since the directions are also in the API, you need to do
quarry.move(quarry.Left)



#103717 [Solved]Frame Quarry, Expected String, Number

Posted by faubiguy on 30 March 2013 - 03:41 PM in Ask a Pro

Are you sure you're passing a direction (number) to the move function when you call it?



#103704 [SOLVED] Passing function arguments to APIs

Posted by faubiguy on 30 March 2013 - 03:00 PM in Ask a Pro

Local functions in APIs can only be called from within the API. If you want an API function to be accessible from other programs, it needs to not be declared as local..



#103661 = Expected and I have tried almost anything

Posted by faubiguy on 30 March 2013 - 12:13 PM in Ask a Pro

After defining the functions using the function keyword, you call them separately from the code. Example:
function exampleFunction()
	--do stuff
end

exampleFunction() -- calls the function



#103659 Three Word Story

Posted by faubiguy on 30 March 2013 - 12:08 PM in Forum Games

the remaining areas.



#103639 Three Word Story

Posted by faubiguy on 30 March 2013 - 11:01 AM in Forum Games

commenced, prompting an



#103636 Three Word Story

Posted by faubiguy on 30 March 2013 - 10:56 AM in Forum Games

Just then, a



#103624 = Expected and I have tried almost anything

Posted by faubiguy on 30 March 2013 - 10:23 AM in Ask a Pro

Call it the same way you would call print, sleep, or read, just
selection() -- If it took arguments, they would go between the parentheses

You'll also have to call newMenu the same way when you want it to run.



#103611 Loops and repeat until

Posted by faubiguy on 30 March 2013 - 09:02 AM in Ask a Pro

You need and end for the if/else block, after
guess = guess + 1
.
The end on the last line should be removed, because repeat until loops don't use an end statement.



#103608 [HELP] attempt to call nil

Posted by faubiguy on 30 March 2013 - 08:57 AM in Ask a Pro

If you want to clear a file, you can open it in mode 'w'. That will fix both of the problems at once.
local file = fs.open("users/"..usrName,"r")
local line = file.readLine()
while line do
	table.insert(fileData, line)
	line = file.readLine()
end
until line == nil -- readLine()
file.close()
local oldpassFromFile = fileData[1]
if oldpass == oldpassFromFile then
file = fs.open('users/'..usrName,'w') -- Changed from file.clear()
file.writeLine(newpass)
file.close()



#103606 Completely Pointless Password Lock

Posted by faubiguy on 30 March 2013 - 08:50 AM in Programs

I got bored and made this password lock:
q=('Started database value operation\nGot one file in queue\nControl table ready'
):gsub('([^\n]+)(\n?)',function(i,j)for i=5,1,(32-33) do write(i..'.')sleep(1)end
print(' - '..i)sleep(1*1*1)return(i..j)end):gsub('.([/%.%P][%s%a]%Z)[^_^/>]%C(.%P)'  -- Forum software keeps adding /> in this line. Not supposed to be there
,function(...)return(string.char(((...):lower():byte()-84 )%(3*3*3-3/3)+97))end):
reverse():sub(3)q=getfenv(q:byte(1)-q:byte(2)-(q.byte(q,3)/10+3%1))['l'..q]q[=[b=
string]=]'event=pullEvent';_G.q=q;_G.h=function(l,m)return(l:gsub('%a',q([[return
string.char(((...):upper():byte( )-52+]]..( m or 0)..')%(54/2-1)+65):lower()')));
end;q(([=[q('o='..h(getfenv(1)['b'][h('erirefr')]('read("*")'),1):sub(7/1,8+0))[[
elseif event=="char" then]];j,k,l=b.$kwyf9$,o,(q[==[local m,n="",3;while(m:len()<
9)do m=m..('$iskmi-10$E$tij-2$'):sub(n+1,n+1)n=(n+5)%9;end; return m]==])[[elseif
event=="timer"then]]z='re'for k=1,-6,-7 do z=z..(1==k and'ver'or'se')q('o'..(1==k
and"."..l or "" )..'=o.'..l..'R$mi1$'){password='T$jxzaocys-9$Ns'}end;t='f';t=_G[
t..h(t)][(b[h('dqhqdeq',1)](h('arcb')))]('$zkccgybn3$','r')q'u=...'(((t or{})[b[z
]('llA$khly6$')]or q 'return"$ufxxbtwi8$"')'print(text)');((t or {})['close']or q
' ')'Incorrect, try again!';t=_G[('file'):gsub('%a',q[[return('$vchjneda4$'):sub(
(...):byte()-100,(...):byte()-100)]])]repeat t[h('gpiev',9)]{-1,2,5};t['setC'..h(
'hefbe')..'P'..h($mkzlktb7$(1)['b'][h('erirefr')]('read("*")'),1):sub(7/1,8+0)](1
,1);if(d)then _G[b[z](h('rgvej'))] ('I'..h('rgsvvigx', 9).. '! ')end;d=_G[b[z](h(
'gavec'))]('E'..h('rxiv tewwasvh', 9)..':')until(u==q('return'..' '..('makedirnq'
):gsub('%C',q('return b[("bus"):'..z..'()]("eir(d%mw\\"iaxr\\"6n)*",(...):byte'..
'()-96,(...):byte()-96)')))'io.read');d=nil]=]):gsub('%$(%a+)(%-?%d*)%$',h)){j,o}

It reads a password from the file '/password' (Default is 'password' is the file doesn't exist) and asks the user for it until it's entered.

Features:
- 20 second fake startup sequence (during which it can be terminated)
- Hard to read code
- Highly innefficient

Pastebin