« first day (1597 days earlier)      last day (3413 days later) » 

12:10 AM
I still read it :P
 
That wasn't what I meant to ask :/
 
aha
try again
 
Upon translating the binary to hax I get a table with 4202496 values. However, using offset=chunks[x][z].pos*4*1024 gives me values like 148901888, which is way too high
Did converting into hex reduce the size ? @OMGtechy
 
@Hippalectryon hex is just a way of representing the number, the actual values remains the same no matter how you show it (dec, hex, oct etc)
 
Then why does chunks[x][z].pos*4*1024 exceed the size of the table ?
 
12:17 AM
Why are you using a 2d array? (I'm assuming that's what it is, it looks like one)
 
The hex table is a 1D array, the "chunk" array is 2D because the indexes used are x,y to map the chunk's positions
 
like I said, you're still jumping too far ahead
one step at a time
So you can now read the data as bytes, awesome
so what do you think the next step is?
 
To extract the header of each chunk ?
By header I mean 4 bytes header
 
So that's more than one problem combined still
 
Isn't that one problem ?
 
12:23 AM
you have two problems; reading 4 bytes separately and interpreting them as a header
also, ask yourself how you know how many chunk headers to expect
 
32*32
Because x,z both range from 0 to 31
 
is that in the documentation?
I usually work with other file formats that aren't so kind aha
I'll take your word for it anyway for now
 
" in which groups of 32×32 chunks are stored in a region file rather than individually"
They also say that "non existing chunks" have a header full of zeroes
 
just looked it up, it seems you are correct. awesome
 
12:25 AM
it says bytes 0 - 4095 are locations
so that's your next step
so, it says the first 3 bytes are the offset (big endian) and the last byte is the sector count whatever that is
 
But then I'd need to know which group of 4 byte corresponds to which x,z
 
we'll get to that
 
so you need to take those 3 bytes and combine them into a number
so first step is to get those 3 bytes
 
for i=0,4095,4 do
	local offset=tonumber(read_(i,i+3), 16)
end
 
12:28 AM
can you trust the endianess there?
 
Well it's big endian so it should be in the right order
 
wait why are you using tonumber
you already have it as a number don't you?
 
As Hex
tonumber(...,16) will convert it to decimal
 
tonumber will take a string and convert it
hex numbers do not need "converting"
 
But if we need the offset later to know where to look, won't we need a decimal position ?
 
12:31 AM
you're still thinking of it as text
0xFF is the same as 255 which is the same as 11111111
 
Hm the problem is that the way I did it, I turned hex into strings
 
well you don't want to do that for a start
 
for b in string.gfind(content, ".") do
	s=string.format("%02X ", string.byte(b)):gsub(' ','')
    table.insert(contentHex,s)
end
--print(#contentHex)
function read_(a,b)
	print(a,b)
	local s=""
	for i=a,b do
		s=s..contentHex[i]
	end
	return s
end
 
ok you need to stop doing that
for the last time, please stop treating everything as strings/text :P
 
That's the only way I know to make a hex table
 
12:32 AM
ok do you have python handy?
I really need to get this idea out of your head that everything is strings
 
I can use python
But I haven't used it that much
But if needed I can use python
 
it's fine, I'll just give you code to run that's all
type this in: bin(0xFF).zfill(8)[2:]
 
that will show you the "real" data (binary), not how we people like to see it
for the number 0xFF
 
'11111111'
 
12:35 AM
yep
now change that 0xFF to 255, the decimal equivalent
 
Same thing
 
exactly
0xFF is just a neat way to write 255
or even 11111111
now try 0xFF == 255
 
exactly
no conversion is going on there
well, not in the sense you're thinking
0xFF literally IS 255
 
Mhm I see
 
12:38 AM
when you print the number, it'll probably come back as decimal by default
because that's usually how people like to read numbers
no other reason
the bits are the same
you can still use the hex or decimal as the offset
either will work, because they are the same value
 
offset 0xFF is the same as offset 255
do you get it yet ?:P
 
Yeah I get it
 
awesome, so now you know why you don't need to convert this into a string or anything else for that matter?
I suppose you could think of the alphabet as base 26 aha
 
I do, but I don't see how to implement it in lua. The string.format("%02X ", string.byte(b)):gsub(' ','') was a trick to split the source into hex strings, but I can't think of a way to make a table of the real values
 
12:43 AM
you don't need to split at all
you don't need to do anything to it
it's already a number
 
So... When I do local content = f:read("*all"), content is a huuuuuge (hex) number ?
 
yup!
and you might split that huge number into bytes
 
Then how do I split a number ?
 
you can, but you don't want to
you have two choices here
a) read the file byte by byte
b) read the file into a byte array
they're both essentially the same thing though
you don't want to say read all
you want to say read 1
as in 1 byte
you could even say read 3 and tada you have your offset
then read 1 and you have the sector count
@Hippalectryon has the lightbulb gone ping yet?
 
Thanks :) Itreally helps, I had a messed up vision of what binary is
 
12:47 AM
binary is this 00101000101010101010
reading them as hex is just nice for humans :P
 
local f = io.open("map/r.0.0.mcr", "rb")
local header={}
for i=0,4095,4 do
	header[i]={}
	header[i].location=f:read(3)
	header[i].len=f:read(1)
end
 
I know nothing of Lua, but it looks sane
does it do what you want it to?
 
Well I don't know until I actually get a chunk :)
 
aha
well did you get that hex editor?
You can check
 
Oh right
Works perfect :D
 
12:52 AM
wahey!
 
5
Q: Paint.NET alternative for Mac OS X

user1249170I would be extremely grateful to anyone pointing me in the direction of the Mac OS X analogue for the free Windows image-editing software Paint.NET. Basically the way I use it is I take lots of screenshots for work, then put arrows in there, some ovals and text - it's all for documentation purpo...

some mac user looking for a paint.net alternative... and someone recommends GIMP.
I don't have enough rep to downvote that.
 
I'd say it's overkill, but a valid answer.
 
@Almo gahh gimp is so shitty. Even the shortcuts make no sense
minus key for zoom out. shift + to zoom in wtf
That right there. Who thought that was a good idea for defaults
 
it's not really valid, as if you send a noob user who just wants paint.net functionality will be overwhelmed by GIMP, and will have to go download something else.
GIMP is a "photoshop alternative"
 
12:56 AM
@OMGtechy Wouldn't it be easier to make a byte map for accessing to each chunk's data, as they might not be 'in order' ?
 
@Hippalectryon you could read the whole lot into a byte array, then go through that byte array and read the headers (saving their data somewhere useful), then use the offset as an index to that array
 
@OMGtechy And if I want to replicate f:read(3), do I add the three corresponding bytes in the array, or ... ?
 
@Almo I have no shadows inside unity, but I do when exported. What do?
 
not sure what you mean? you would already have the header data stored elsewhere
 
I enable shadows but don't see them, but they are there when exported.
 
1:01 AM
1) dump into byte array
2) go through location headers and save somewhere useful (like a chunk list)
3) use that information to get the offsets you need whenever
@Hippalectryon
 
@AttackingHobo no idea :(
 
@OMGtechy ok
@OMGtechy My problem is that once I've made the array,
local byteTable={}
file=f:read(1)
i=0
repeat
byteTable[i]=file
file=f:read(1)
i=i+1
until file==nil,
I can't use f:read(1) anymore to get the headers. How do I get the headers from the byte table ?
 
@Hippalectryon they're in the byte table, the byte table is just like the file (only store in memory now, so much quicker to random access)
you now have random access memory rather than serial
 
But how do I "replace" read(...) ? Do I add the corresponding numbers ? For instance, if the reading index was 1000, to replace f:read(2), do I return table[1000]+table[1001] ?
 
if you want the data at byte 0, use index 0, byte 1, index 1, and so on
 
1:10 AM
But, for instance, the location in a header consists of three bytes, not just one
 
then use three different indicies
 
But f:read(3) return one number, not three. How do I do the same ? After all, the location is one number... Or am I messing things up again ?
 
ah I get what you mean now
you're asking how to interpret 3 big endian bytes as a single number?
 
Do you know what a bit shift is?
 
1:14 AM
Not really
 
ok, mini tutorial
 
say these are your three bytes:
1) 0000 0001
2) 0100 0100
3) 0001 1000
the result you want is this:
0000 0001 0100 0100 0001 1000
so to do that, you can literally "shift" the bits to the left
so looking at our 24 bit number, we want the first byte shifted over by 16 bits
agreed?
 
and what about the second?
 
1:16 AM
by 16-4=12 bytes
 
where did 4 comes from?
 
Oh wait I meant 8 :)
16-8=8
 
yeah
 
The length of one byte
 
and the third by 0 because it's fine as it is
so in python it'd look like this:
my_number = (byte1 << 16) + (byte2 << 8) + byte3
or something like that
Now you need to look up how to left bit shift in lua
I am going to sleep
night
 
1:20 AM
Thanks a lot
 
:)
 
@Almo V.1 FACES
 
MLM
1:55 AM
@Almo said failed to connect :/ - brb
Restart client didn't work. Restarted pc and I have Windows updates installing now :(
Totally screwed for a while, sorry
 
2:13 AM
@MLM it's ok we won 4v5
i got 27 kills, more than their whole team
 
MLM
@Almo awesome. Just getting logged back in.
 
whoa, if you hit enter in the middle of a string in eclipse, it'll automatically end the string, add a + sign, then start the string again on the new line.
this is the first awesome thing I've discovered about eclipse
 
MLM
That "Failed to connect" error has happened once before months ago when I was playing with Icy. Only a restart fixed it. Even forum posts have no quick fixes
 
oh, yeah, I have a bash script for that
or rather, I know of one. I haven't had a use for it yet.
let me find it again
@echo off
taskkill /F /IM "League of Legends.exe"
taskkill /F /IM "LoLPatcher.exe"
taskkill /F /IM "LoLPatcherUx.exe"
taskkill /F /IM "LoLPatcher.exe"
taskkill /F /IM "LolClient.exe"
taskkill /F /IM "LoLLauncher.exe"

@echo resetting IP
ipconfig /release
ipconfig /flushdns
sleep 5
ipconfig /renew

pause press any key to launch league of legends
cd C:\Riot Games\League of Legends
lol.launcher.admin.exe
timeout 15
I haven't tested this, so let me know how it works
 
MLM
2:21 AM
I did try ipconfig /flushdns
 
ah, then maybe it won't work
this script was created because of league's "firewall error" which isn't really caused by firewalls. I just figured it would work for you too.
 
MLM
It has only happened twice so it isn't something I can test readily but I'll keep it handy.
 
also, this wouldn't technically be a bash script, would it
cmd script maybe? whatever
 
MLM
Shell, maybe?
 
sure let's go with that
 
MLM
2:24 AM
Trying to find out what to save it as(extension) and whether it can be run in CMD instead of Powershell
 
I think you just paste into notepad and save as a .bat file
looks like .cmd and .btm work too
then you can double-click the file to run it
 
MLM
Ye, found this which confirms(if you aren't looking at the same thing): superuser.com/a/373711/130885
 
I found the wiki page: wikiwand.com/en/Batch_file
I hate how wikiwand replaces the url of wikipedia pages
annoying when trying to paste wikipedia links, even if the rest of the extension is awesome
 
MLM
lol, I was wondering what Wikiwand even is, just a wikipedia viewer with some customization as far as I can tell
 
2:29 AM
@MLM basically. it keeps the ToC on the left and lets me have a dark theme, so just with that it's pretty nice
 
@MLM we're on again
 
MLM
@Almo Thanks for the heads up
 
3:00 AM
last bit of homework for the semester is finally done. now let's see if I can hit gold in league tonight.
97 LP in S1 right now
 
icy... poro toss? @IcyDefiance
 
too late, in queue D:
 
ok
 
I probably should at least try it...
 
 
4 hours later…
6:41 AM
@IcyDefiance poro game?
 
waiting on wakka to get out of a game. maybe we can pull him in with us.
we were going to duo ranked, so I can't really ditch him
 
ok i can't sleep
so i'll just play a poro game
good luck :)
 
aight
my last game I want 18/3/20 with ez and my team didn't even have any tanks :D
just because I feel like bragging
 
:D
 
kat and I won the game pretty much by ourselves. it was great.
 
6:43 AM
i went 27/9 with cait in a 4v5 poro game, and we were the 4
cool :)
 
ooh really? I wouldn't expect cait to be that good with the engage mechanic.
 
she does well for some reason
 
huh, interesting
 
went 20/9 in another game, though we lost
 
 
4 hours later…
11:07 AM
Sup homies.
tips hat
 
Jon
sup blue
 
Not much, just workin' away.
 
Jon
thats good
keep working hard, so you can keep paying your taxes
 
That and buy other stuff.
 
Jon
CONSUME!
Ads in the future are no longer subtle... they just say "CONSUME"
LOL.. imagine having a augmented reality app, that simplified ads like above ^
it would analyze the ad type, and simplify it to EAT
 
11:14 AM
@Blue just thought of a game last night...
now, I only need some motivation to start working on it :P
 
Oh? @Ali.S what kind of game?
 
kinda endless runner thingy
well, mostly endless roller thingy :D
 
Jon
a minecart one?
 
since the main character is an sphere instead of a guy
for some reasons...
 
Jon
make it a snowball
and if you hit a wall you explode and your life as a snowball is over
3% royalty if you do that
 
11:16 AM
that could be done, in fact I had thoughts like that
later I found something(s) easier to play with
 
Jon
your wee wee?
 
like you can hit the walls, but you shouldn't hit spiked walls
and you are running away from some volcano erruption
 
Jon
rolling away
 
that would be a nice name for it :D
tnx, I'll certainly consider it, if I ever get it done ...
@SpartanDonut why?
 
11:32 AM
@Ali.S Read the context Ali :P
 
I read it...
but I don't really understand the reasoning behind it
 
Using M$ is an obnoxious way of referring to Microsoft. :)
 
Jon
gotta write a webservice that will be used all over Canada.. no worries.
 
yeah, true...
 
Jon
M$ is way more efficient to type.
And you know what it means, so not an actual issue, aside from it annoying you
what the hell
 
11:36 AM
@Jon How is it more efficient? :P
 
Jon
M$ == 2 chars , Microsoft == 9 chars
 
Jon
4.5 times more efficient
 
Jon
11:50 AM
woot woot.. passed my first $50 in sales.. lol
I'm at $52 now, after google taxes
74 copies sold, haha
 
Hello
 
Jon
Hey
 
Can someone here help me with reading minecraft files ? I've extracted a .mcr's chunks, but now I need to read them
 
user92578
One day of school (just a christmas fest) and then school's done for this year
 
and I can't manage to understand how to do that from minecraft.gamepedia.com/Chunk_format#Block_Format
 
Jon
11:55 AM
what are you hung up on?
because I'm not gonna start reading minecraft specs
 
Well I have the hex data of the chunks
But I don't understand what to search where
 
Jon
Also did you hear about minecraft adventure mode is coming?
 
user92578
you might want to take a look at PyMCLevel
 
I saw that on reddit, yeah :)
Bit I don't have Minecraft
 
user92578
or just MCEdit
 
11:57 AM
I'm just doing a minecraft to another 3D engine converter
Map converter
 
user92578
why?
 
Just a challenge someone gave me :)
 
user92578
ah, okay :)
 
So far I've got the chunk's "whole" data
 
11:58 AM
And by reading that "wiki" I don't get what to get where
(where to get blocks)
 
Jon
blocks are probably data[0,1,2].Type
what are you writing in?
 
Lua
function toStr(c)
	s=""
	for b in string.gfind(c, ".") do
		s=s..string.format("%02X ", string.byte(b))
	end
	return s
end
function toStr2(c)
	s=""
	for b in string.gfind(c, ".") do
		s=s..string.format("%02X ", string.byte(b)):gsub(' ','')
	end
	return s
end
local btab={}
function btab:read_(a,b)
	if b<a then return "" end
	s=""
	for i=a,b do s=s..btab[i] end
	return s
end

local f = io.open("map/r.0.0.mcr", "rb")

file=f:read(1)
i=0
repeat
	btab[i]=file
	file=f:read(1)
	i=i+1
until file==nil
 

« first day (1597 days earlier)      last day (3413 days later) »