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
Hi !
*I'm form Poland so sorry for my English !*
I make bot to my brother (filiposs) and i need to do to blocks disappear at certain cords.
Now I have that the blocks are "flying" all the time.
Offline
yes cuz that it was you have programmed there,
whats the problem exactly
if you can read this....good for you
Offline
Offline
I want make something like this :
Block "fly" in the left page, and then when the "fly" 10 blocks he disappear.(not "fly" next, because he destroy map).
Offline
You check if your x is at the position you want the flying block to stop, and in that case you only make the block disappear and not create a new one.
Meaning your code will look something like this:
if (bid == 1)
{
if (blocks[0, x - 1, y] == 0)
{
con.Send(bldatam, 0, x, y, 0);
if(x == ***Ending x value***)
{
con.Send(bldatam, 0, x -1, y, 1);
}
}
}
Offline
When i change code and i put arrows(id:1) then bot delete this arrow, when i put arrows on x = 4 then arrows moving to -x.
So... This is not this code
But when i change code to :
if (blocks[0, x - 1, y] == 0)
{
con.Send(bldatam, 0, x -1, y, 1);
if(x == 4)
{
con.Send(bldatam, 0, x, y, 0);
}
}
... almost was well. When i put arrows then they moving to - x and when they are in x = 4 bot delete this arrows, but only in this cords. I want make that arrows disappear in X cords and not destroy my map .
Offline
My bad, it's supposed to be if(x >= 4)
Using this all x cords above 3 will be deleted, so this would include 4.
Can be you want if(x <= 4) instead, but I'm not sure about that.
P.S. Compliments to the way you give us information and actually try to fix things yourself.
Offline
Now my bot working perfect
But have someone tutorial how to get a save section of the map ?! I don't want write after the 1 line for every block
If no ... i will need to combine
Offline
Make a function that places blocks for you, in that function you can check if the desired coordinates for the block are inside the safezone. If they are, do some error handling if you want.
Offline
In the sense that i must make 1 line to 1 block ?!
We can't redo it?
https://www.youtube.com/watch?v=2bK5bcG … e=youtu.be
Offline
In the sense that i must make 1 line to 1 block ?!
We can't redo it?
https://www.youtube.com/watch?v=2bK5bcG … e=youtu.be
You can write a function that takes 2 parameters: starting position and ending position
What the method then will do is draw your flying line from the given start to the given end.
If you want to make sure you always keep your save zones unedited, make a function with the following parameters
block Id
x position
y position
and all other parameters that are required for placing blocks like rotation and such
Within that method you place the block IF it is outside of the savezone.
Offline
:/ :S
Offline
We need more then that to see what's the error is.
Offline
Replace:
client = PlayerIO.QuickConnect.SimpleConnect("everybody-edits-su9rn58o40itdbnw69plyw", email_TextBox.Text, password_TextBox.Text);
With:
client = PlayerIO.QuickConnect.SimpleConnect("everybody-edits-su9rn58o40itdbnw69plyw", email_TextBox.Text, password_TextBox.Text, null);
Hope this helps
*EDIT
I see that u have CheckForIllegalCrossThreadCalls = false;
I recommend that you do:
Invoke(new EventHander(delegate
{
//Ur Connect code here
}));
I think that it's like that, i think..
Offline
Thx Srna !
And next problem ... [Pushing blocks] but blocks don't want to be moved...
Offline
m[1] and m[2] are Doubles.
You have to round them.
int PlayerX = Math.Round(m.GetDouble(1)) / 16;
int PlayerY = Math.Round(m.GetDouble(2)) / 16;
Offline
Offline
Oops.
Try
int PlayerX = (Math.Round(m.GetDouble(1)) / 16) as int;
int PlayerY = (Math.Round(m.GetDouble(2)) / 16) as int;
(That wasn't too hard to figure out. You can use Convert.ToInt32, too.)
(
int PlayerX = Convert.ToInt32(Math.Round(m.GetDouble(1)) / 16);
int PlayerY = Convert.ToInt32(Math.Round(m.GetDouble(2)) / 16);
)
Offline
int playerx = m.GetInt(1) / 16;
int playery = m.GetInt(2) / 16;
You can just make them ints.
thanks zoey aaaaaaaaaaaand thanks latif for the avatar
Offline
int playerx = m.GetInt(1) / 16; int playery = m.GetInt(2) / 16;
You can just make them ints.
Well, not sure about it then.
Offline
I wrote " int PlayerX = Convert.ToInt32(Math.Round(m.GetDouble(1)) / 16);
int PlayerY = Convert.ToInt32(Math.Round(m.GetDouble(2)) / 16);" ... but blocks still don't want to be moved.
I wrote too : " say("X : " + PlayerX);
say("Y : " + PlayerY); " ... and bot don't want say my Y cords .
Offline
I always do:
int PlayerX = (int)(m.GetDouble(1)) / 16;
int PlayerY = (int)(m.GetDouble(2)) / 16;
int Horizontal = m.GetInt(7);
int Vertical = m.GetInt(8);
You could try that but i dont know if it's different or the same as the other codes.
To test the X and Y, just do a simple dig.
ThreadPool.QueueUserWorkItem(delegate
{
if (blocks[0, PlayerX + Horizontal, PlayerY + Vertical] == 16) //Brown brick
{
con.Send(worldKey, 0, PlayerX + Horizontal, PlayerY + Vertical, 4);
Thread.Sleep(10);
}
});
ThreadPool.QueueUserWorkItem is for Thread.Sleep
If you dont use ThreadPool.QueueUserWorkItem it will freeze everything else (probably).
Hope this helps
Offline
I change to : " int PlayerX = (int)(m.GetDouble(1)) / 16;
int PlayerY = (int)(m.GetDouble(2)) / 16;
int Horizontal = m.GetInt(7);
int Vertical = m.GetInt(8); " ... , make this Digbot and Digbot too don't work :/
Offline
ThreadPool.QueueUserWorkItem is for Thread.Sleep
If you dont use ThreadPool.QueueUserWorkItem it will freeze everything else (probably).
Threadpool makes it so you are able to do other things while there is a thread.sleep.
Thread.sleep will not allow you to do anything while it waits.
thanks zoey aaaaaaaaaaaand thanks latif for the avatar
Offline
Pages: 1
[ Started around 1732798863.3404 - Generated in 0.236 seconds, 12 queries executed - Memory usage: 1.7 MiB (Peak: 1.94 MiB) ]