Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 2015-03-15 21:58:26

ParadoxInTheVoid
Member
From: ̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺
Joined: 2015-02-18
Posts: 341

[Help] Advanced Diggy

Okay, I have made a digbot, but the problem is that it will mine anything... I want it to only be a select few.

I'm not releasing the diggy code because I want to keep that secretive, I had to figure it out on my own.


signature.png

Offline

#2 2015-03-15 22:40:17, last edited by ewoke (2015-03-15 22:41:03)

ewoke
Member
Joined: 2015-02-20
Posts: 412

Re: [Help] Advanced Diggy

make a array, dictionary whatever you want to store x,y and blockid, check if the array contains a block ID at the given movementlocation.

int[,] data;

now give the array values at "init"and at "b"

int[m.getint(1),m.getint(2)] = m.getint(3);


and check the movement stuff

if(data[player.x+m.getint(7),player.y + m.getint(8)] ==9)
{
//do stuff
}

i think i got you on teamviewer so feel free to spam me when you need help.


if you can read this....good for you

Offline

#3 2015-03-15 22:50:58

ParadoxInTheVoid
Member
From: ̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺
Joined: 2015-02-18
Posts: 341

Re: [Help] Advanced Diggy

I have the code to do that but it isn't working...

if (m.Type == "m") {

int X = Convert.ToInt32(Convert.ToDouble(m[1]) / 16);
int Y = Convert.ToInt32(Convert.ToDouble(m[2]) / 16);

if (m.GetInt(7) == 1 && m.GetInt(8) == 0) // right
{
if (diggableBlocks.Contains(block[X + 1, Y].BlockID))
{
conn.Send(worldKey, new object[] { 0, X + 1, Y, 4 });
}
}
else if (m.GetInt(7) == -1 && m.GetInt(8) == 0) // left
{
if (!diggableBlocks.Contains(block[X - 1, Y].BlockID))
{
conn.Send(worldKey, new object[] { 0, X - 1, Y, 4 });
}
}
else if (m.GetInt(7) == 0 && m.GetInt(8) == 1) // down
{
if (!diggableBlocks.Contains(block[X, Y + 1].BlockID))
{
conn.Send(worldKey, new object[] { 0, X, Y + 1, 4 });
}
}
else if (m.GetInt(7) == 0 && m.GetInt(8) == -1) // up
{
if (!diggableBlocks.Contains(block[X, Y - 1].BlockID))
{
conn.Send(worldKey, new object[] { 0, X, Y - 1, 4 });
}
}
}
if (m.Type == "b") {
block[m.GetInt(1), m.GetInt(2)].BlockID = m.GetInt(3);
}
public static int[] diggableBlocks = new int[] { 9, 16, 0 };

In the "init"

block = new GetBlock[m.GetInt(12), m.GetInt(13)];
Read(m, 18);

Desirialiser

public static void Read(PlayerIOClient.Message m, uint c)
{
while (c < m.Count && !(m[c].ToString().StartsWith("PW") || m[c].ToString().StartsWith("BW")))
{
if (m[c].ToString() != "we")
{
int bid = m.GetInt(c);
for (int n = 0; n < m.GetByteArray(c + 2).Length; n += 2)
{
int x = m.GetByteArray(c + 2)[n] << 8 | m.GetByteArray(c + 2)[n + 1];
int y = m.GetByteArray(c + 3)[n] << 8 | m.GetByteArray(c + 3)[n + 1];
block[x, y].BlockID = bid;
}
c += 4;
}
else
{
break;
}
}
}

signature.png

Offline

#4 2015-03-15 23:06:18

ewoke
Member
Joined: 2015-02-20
Posts: 412

Re: [Help] Advanced Diggy

check the Desirialiser its not updated


if you can read this....good for you

Offline

#5 2015-03-16 13:09:37

Zumza
Member
From: root
Joined: 2015-02-17
Posts: 4,645

Re: [Help] Advanced Diggy

If it dosent have anything else than basic blocks it will work.


Everybody edits, but some edit more than others

Offline

Zumza1426507777483562

Board footer

Powered by FluxBB

[ Started around 1714943885.1251 - Generated in 0.046 seconds, 12 queries executed - Memory usage: 1.4 MiB (Peak: 1.51 MiB) ]