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 2016-12-09 15:52:35, last edited by Anatoly (2016-12-09 15:53:28)

Anatoly
Guest

Blocks not placed entirely

That's from my for loop:

Console Log

Hidden text

But only blocks X ( 31 - 46 ) were placed.


My code part

private static void MiniGameVoid()
{
	if (MiniGame_State == 0) {
		MiniGame_State = 1;
		for (int a = 1; a <= 41; a++) {
			con.Send("b", 0, a + 30, 64, 11);
			Console.ForegroundColor = ConsoleColor.DarkGray;
			Console.WriteLine("X: " + (a + 30));
		}
	} else {
		
	};
}

#2 2016-12-09 15:59:22

hummerz5
Member
From: wait I'm not a secret mod huh
Joined: 2015-08-10
Posts: 5,852

Re: Blocks not placed entirely

you're not pausing between blocks

Offline

Wooted by:

#3 2016-12-09 16:08:55, last edited by SirJosh3917 (2016-12-09 16:09:41)

SirJosh3917
Formerly ninjasupeatsninja
From: USA
Joined: 2015-04-05
Posts: 2,095

Re: Blocks not placed entirely

Do a

System.Threading.Thread.Sleep(10);

This will sleep 10 milliseconds.

EDIT: Also Can I ask why you have a semicolon to complete your if statement?

Offline

Wooted by:

#4 2016-12-09 16:09:02

Koya
Fabulous Member
From: The island with those Brits
Joined: 2015-02-18
Posts: 6,310

Re: Blocks not placed entirely

The server throttles people, a delay of 10ms between blocks is plenty or you can do bursts of about 10 then pause for 100ms; the first being easier and the second is useful for doing small things like opening doors at the same time.


Po9cnQh.png

PLNQVL8.png
Thank you eleizibeth ^

1SYOldu.png

I stack my signatures rather than delete them so I don't lose them
giphy.gif

WfSi4mm.png

Offline

#5 2016-12-09 17:05:01

Tomahawk
Forum Mod
From: UK
Joined: 2015-02-18
Posts: 2,824

Re: Blocks not placed entirely

Gotta love the misleading title. This could've been an awesome bug.

You can add:

using System.Threading;

to your list of namespaces, so you only have to type:

Thread.Sleep(10);

every time you need a delay.


One bot to rule them all, one bot to find them. One bot to bring them all... and with this cliché blind them.

Offline

Wooted by:

#6 2016-12-09 17:15:33

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

Re: Blocks not placed entirely


Everybody edits, but some edit more than others

Offline

#7 2016-12-10 13:00:11

MartenM
Member
From: The Netherlands
Joined: 2016-03-31
Posts: 966
Website

Re: Blocks not placed entirely

I feel like the next question is going to be like: "Why does my consol freeze and why can't I use commands while placing many blocks.".


lm3hgg8.jpg

Ingame: marten22        My steam: MartenM

Offline

#8 2016-12-10 13:30:49, last edited by Vinyl Melody (2016-12-10 13:42:47)

Vinyl Melody
Formerly BananaMilkShake
Joined: 2016-06-19
Posts: 616

Re: Blocks not placed entirely

Add this:

using System.Threading.Tasks;

Then put this on the void, before the static

async

Then use this after you placed a block AKA con.Send

await Task.Delay(20);
MartenM wrote:

I feel like the next question is going to be like: "Why does my consol freeze and why can't I use commands while placing many blocks.".

Got ya covered there mate.


cb0de83627.png
Thanks to: Ernesdo (Current Avatar), Zoey2070 (Signature)

Very inactive, maybe in the future, idk.

Offline

Wooted by: (2)

#9 2016-12-10 16:01:45

Anatoly
Guest

Re: Blocks not placed entirely

i was working around values. 10 was not sleeping enough, 17 is good.

What does sleeping -1 do? You can sleep negative amount of time?

#10 2016-12-10 16:04:50

Era
Member
From: ::1
Joined: 2015-05-06
Posts: 884

Re: Blocks not placed entirely

AnatolyEE wrote:

i was working around values. 10 was not sleeping enough, 17 is good.

What does sleeping -1 do? You can sleep negative amount of time?

used to put a threat to sleep indefinetely without terminating your application

Offline

Era1481382290639025

Board footer

Powered by FluxBB

[ Started around 1711722708.8245 - Generated in 0.045 seconds, 10 queries executed - Memory usage: 1.54 MiB (Peak: 1.71 MiB) ]