- ComputerCraft | Programmable Computers for Minecraft
- → Orwell's Content
Orwell's Content
There have been 432 items by Orwell (Search limited from 10-February 22)
#148154 Lua Code Golf
Posted by
Orwell
on 06 October 2013 - 06:09 PM
in
Forum Games
Symmetryc, on 06 October 2013 - 05:49 PM, said:
x = 1==2 y = x --# or nilOf course, in the case of the golf submission, b is only used in the conditional statement 'if b then' so it wouldn't matter in this particular example.
But you are right about it having a use. I didn't realize that.
#148152 Lua Code Golf
Posted by
Orwell
on 06 October 2013 - 05:39 PM
in
Forum Games
kreezxil, on 06 October 2013 - 11:43 AM, said:
bentallea, on 06 October 2013 - 10:09 AM, said:
instructions:
- place turtle facing west
- insert fuel into any slot
- run goto(x,y,z,)
function goto(x, y, z, B)/>/>/>/>/>/>/>/>/>/> if b then c,d,e = gps.locate() x=x-c y=y-d z=z-e end t=turtle f=t.forward for a = 1,16 do t.select(a) t.refuel() end if x+y+z > t.getFuelLevel() then (x < 0) and for a = -1, x, -1 do t.back() end or for a = 1, x do f() end (y < 0) and for a = -1,y,-1 do t.down() end or for a = 1,y do t.up() end (z < 0) and t.turnLeft() or t.turnRight() (z < 0) and for a = -1, z -1 do f() end or for a = 1, z do f() end end end
a={...}
goto(a[1],a[2],a[3],a[4] or nil)
Also there is an error on line 1 of your function() you have 'B' and not 'b'. Remember variables are case sensitive. With my addition to make your goto function an actual program for the competition valid your total character count comes to 476!goto(...)This keeps the count at 456 which is a lot less than your addition.
And why would you ever do this?
a[4] or nilIt's like doing '1+0'.
#134074 CC-copy -- Your solution to servers without HTTP API
Posted by
Orwell
on 17 July 2013 - 07:18 AM
in
APIs and Utilities
AliveGhost, on 16 July 2013 - 05:32 PM, said:
It all seems to be running okay, apart from it says "Couldn't open file 'desktop\mainprog'. How can I get the cmd to open it?
Cheers,
AliveGhost
CC-copy.exe "C:\Users\username\desktop\mainprog"
#133006 Who will get GTA V?
Posted by
Orwell
on 12 July 2013 - 07:17 AM
in
General
Quote
- Full retail copy of Grand Theft Auto V
- Collectible SteelBook with Exclusive Artwork This special SteelBook features double-sided, never-before-seen artwork of Michael, Trevor and Franklin. Custom color and metallic treatments bring out the detail of the artwork created exclusively for this SteelBook.
- Blueprint Map This exclusive, additional 21.5” x 26.75” map displays a blueprint view of Los Santos and Blaine County. Cryptic markings indicate locations for fast cash and other points of interest for the up-and-coming entrepreneur.
- Special Ability Boost Michael, Franklin and Trevor each have a unique special ability. With this boost, the special ability bar will generate 25% faster.
- Stunt Plane Trials Single player Stunt Plane Trials let you take on additional aerial challenges spread throughout Los Santos and Blaine County.
- Bonus Outfits, Tattoos and More Michael, Franklin and Trevor get bonus outfits in their wardrobes, character specific tattoos at tattoo parlors, and special deals from shopkeepers across Los Santos and Blaine County.
- Additional Weapons When visiting Ammunation stores in single player, merchants will have special weapons in their inventory available for free: the Pistol .50, Bullpup Shotgun and melee Hammer.
#130488 [C++] My first program!
Posted by
Orwell
on 30 June 2013 - 06:33 PM
in
General
Also, your program behaves somewhat strange when using Wine on Ubuntu. Not sure if it's Wine or the program... But the clock isn't working for me, it sort of restarts the program.
#129062 About Linux
Posted by
Orwell
on 25 June 2013 - 08:34 AM
in
General
ShadowedZenith, on 25 June 2013 - 08:24 AM, said:
Either way, I don't see why you'd rather go with Ubuntu when you can get Linux Mint. Like I said before, Linux Mint is a fork off of Ubuntu to begin with, so they're able to use mostly the same packages are each other (except maybe in some rare, freak case). Linux Mint has a bit more freedom with it.
Also, wasn't Ubuntu adding in like advertisements and stuff into Unity? I could have sworn that they were sending unencrypted searches to Amazon or something like that when you searched your own computer/desktop.
#125619 Generate numbers from strings
Posted by
Orwell
on 12 June 2013 - 08:05 AM
in
Ask a Pro
theoriginalbit, on 12 June 2013 - 08:00 AM, said:
Orwell, on 12 June 2013 - 07:54 AM, said:
#125615 Generate numbers from strings
Posted by
Orwell
on 12 June 2013 - 07:54 AM
in
Ask a Pro
superanonymous, on 12 June 2013 - 07:46 AM, said:
#125414 Regex description
Posted by
Orwell
on 11 June 2013 - 09:36 AM
in
Ask a Pro
theoriginalbit, on 11 June 2013 - 08:49 AM, said:
Orwell, on 11 June 2013 - 06:44 AM, said:
local config = fs.open("file", "r")
local sFile = config.readAll()
local something = sFile:gmatch("something = (%S+)")() -- %S matches every character except for space characters
print(something or "No match has been found!")
#125381 Regex description
Posted by
Orwell
on 11 June 2013 - 06:44 AM
in
Ask a Pro
Edit:
LBP is right, there are some other issues with the code. You don't need to loop through the lines of the file and obviously you need to pass the content from the file to string.gmatch. This is a updated version of yours:
local config = fs.open("file", "r")
local sFile = config.readAll()
local something = sFile:gmatch("something = (%S+)")() -- %S matches every character except for space characters
print(something or "No match has been found!")
Now if you have a file on your computer named 'file' that has this content:
This is a file with some stuff in. foo = bar something = foobar me ~= you
#125376 Protecting a text file or folder with Password
Posted by
Orwell
on 11 June 2013 - 06:23 AM
in
Ask a Pro
Engineer, on 11 June 2013 - 02:25 AM, said:
Also, you are quoting me lately a lo, may I ask why?
Let's say you want to send a file from client to server. Then you encrypt it on the client using a password as the key, next send it over rednet to the server. The server stores it encrypted. Then the client can ask to fetch it again, it will still be sent encrypted over rednet. Then the client will be prompted for the password so the file can be decrypted again.
#125375 coord into name on say command
Posted by
Orwell
on 11 June 2013 - 06:18 AM
in
Ask a Pro
SirDiggalot, on 11 June 2013 - 04:02 AM, said:
Xenthera, on 11 June 2013 - 12:46 AM, said:
Orwell, on 11 June 2013 - 12:46 AM, said:
Yeah, except
[@]Xenthera:
Xenthera:
They're pretty distinguishable. Plus, when it sends a message, it can return to the server the computer's coordinates. That can also help in tracking who is using the computer. At least maybe. Besides it would be no different than spamming with the current block, would it?
Plus, I don't know if it already exists, but there could be a block limit, (say 64 or something) so it would only bother people within a 64 block radius.
#125338 Post your desktop!
Posted by
Orwell
on 10 June 2013 - 09:54 PM
in
General
ETHANATOR360, on 10 June 2013 - 07:35 PM, said:
#125337 [Turtle] Schematic File Builder
Posted by
Orwell
on 10 June 2013 - 09:49 PM
in
Turtle Programs
Vas, on 10 June 2013 - 09:45 PM, said:
rm programName
You changed the code for a list in the NBT data. But I don't think the schematic files use lists, so you had luck.
Oh yeah, what I meant to say earlier. If there are more than 16 materials needed.. Just returning to a chest for the next materials wouldn't be so handy because you can't know what item is which. The automatic refill would work because the turtle can always keep one of each item, thus sucked items from the chest would append to the allready loaded items.
#125336 coord into name on say command
Posted by
Orwell
on 10 June 2013 - 09:45 PM
in
Ask a Pro
Xenthera, on 10 June 2013 - 09:32 PM, said:
#125328 [Turtle] Schematic File Builder
Posted by
Orwell
on 10 June 2013 - 09:10 PM
in
Turtle Programs
Vas, on 10 June 2013 - 12:39 AM, said:
http://pastebin.com/789upkpX - is this correct? For the use of 16 slots. I don't know programming of any kind so I wouldn't know if I was right or not. I changed 2 9s into 16 and left the others alone since they didn't seem to be part of the code, were more like block IDs.
Here is the a correct adaption: http://pastebin.com/RAztRaLH
#125327 [CC 1.51 | MC 1.5.2] Scanner Peripheral v0.4
Posted by
Orwell
on 10 June 2013 - 09:01 PM
in
Peripherals and Turtle Upgrades
Script Kiddie, on 10 June 2013 - 04:04 AM, said:
and please add a video to use the scanner add an example program for it
thanks
ccbad, on 10 June 2013 - 01:10 PM, said:
- ComputerCraft | Programmable Computers for Minecraft
- → Orwell's Content


