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.
Pages: 1
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.
Offline
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
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;
}
}
}
Offline
check the Desirialiser its not updated
if you can read this....good for you
Offline
If it dosent have anything else than basic blocks it will work.
Everybody edits, but some edit more than others
Offline
Pages: 1
[ Started around 1732505763.849 - Generated in 0.115 seconds, 12 queries executed - Memory usage: 1.41 MiB (Peak: 1.51 MiB) ]