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-12-07 22:50:18

Real_Naa2001
Member
Joined: 2015-10-24
Posts: 16

Time between placing a block

OK I want to have at least 10 seconds between two different blocks being placed in the same place.

I already tried:


con.Send(bldatam, 0, x, y, blockid, TimeSpan.FromSeconds(10));


    OR


con.Send(bldatam, 0, x, y, blockid);
  Thread.Sleep(200);

 

Sorry, I'm a beginning in Programming s I don't really know anything.

If you know reply please.
//forums.everybodyedits.com/img/smilies/smile


SHUT AND LISTEN!!!

giphy.gif

Offline

#2 2015-12-07 23:00:04, last edited by hummerz5 (2015-12-07 23:00:26)

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

Re: Time between placing a block

I know all. Next question?

edit: nvm.
First question?

Offline

#3 2015-12-07 23:09:48

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

Re: Time between placing a block

Thread.Sleep is in ms, meaning a value of 1000 = 1 second.
So if you'd want 10 seconds, you'd need a value of 10 * 1000 = 10000.

Long story short, use this:

con.Send(bldatam, 0, x, y, blockid);
Thread.Sleep(10000);

Offline

#4 2015-12-07 23:30:29

Real_Naa2001
Member
Joined: 2015-10-24
Posts: 16

Re: Time between placing a block

Thanks for the help!!! //forums.everybodyedits.com/img/smilies/smile 

I'm dumb


SHUT AND LISTEN!!!

giphy.gif

Offline

#5 2015-12-07 23:59:16

AmdS
Member
From: Brazil
Joined: 2015-05-27
Posts: 2,384
Website

Re: Time between placing a block

Real_Naa2001 wrote:

Thanks for the help!!! //forums.everybodyedits.com/img/smilies/smile 

I'm dumb

You're not dumb for dont know something ^^

Offline

Wooted by: (2)

#6 2015-12-08 05:10:36

Xfrogman43
Member
From: need to find a new home
Joined: 2015-02-15
Posts: 4,174

Re: Time between placing a block

AmdS wrote:
Real_Naa2001 wrote:

Thanks for the help!!! //forums.everybodyedits.com/img/smilies/smile 

I'm dumb

You're not dumb for dont know something ^^

Just ignorant //forums.everybodyedits.com/img/smilies/smile


zsbu6Xm.png thanks zoey aaaaaaaaaaaand thanks latif for the avatar

Offline

Wooted by: (3)

#7 2015-12-08 12:23:54

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

Re: Time between placing a block

Xfrogman43 wrote:
AmdS wrote:
Real_Naa2001 wrote:

Thanks for the help!!! //forums.everybodyedits.com/img/smilies/smile 

I'm dumb

You're not dumb for dont know something ^^

Just ignorant //forums.everybodyedits.com/img/smilies/smile

You didn't know this at one point, get off your high-horse.

He was almost correct, he had

Real_Naa2001 wrote:

TimeSpan.FromSeconds(10)

and

Real_Naa2001 wrote:

Thread.Sleep(200);

therefore very close to

Thread.Sleep(TimeSpan.FromSeconds(10));

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

Wooted by:

#8 2015-12-08 13:46:38

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

Re: Time between placing a block

I must say using Thread.Sleep isn't a smart way to do it though (unless you run it in a separate thread).
Try and use Timers as much as you can.

Offline

Wooted by:

#9 2015-12-08 21:05:48

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

Re: Time between placing a block

den3107 wrote:

I must say using Thread.Sleep isn't a smart way to do it though (unless you run it in a separate thread).
Try and use Timers as much as you can.

Let's not throw the book at a newbie.


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:

#10 2015-12-08 22:39:30

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

Re: Time between placing a block

Tomahawk wrote:
den3107 wrote:

I must say using Thread.Sleep isn't a smart way to do it though (unless you run it in a separate thread).
Try and use Timers as much as you can.

Let's not throw the book at a newbie.

Exactly, stick to Thread.Sleep then timers later on when an understanding of the language has actually improved!


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

#11 2015-12-08 22:43:39

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

Re: Time between placing a block

Koya wrote:

therefore very close to

heh, yes. Put the 200 in teh FromSeconds, then wonder why teh entire bot breaks. lel

Offline

#12 2015-12-08 22:45:59

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

Re: Time between placing a block

hummerz5 wrote:
Koya wrote:

therefore very close to

heh, yes. Put the 200 in teh FromSeconds, then wonder why teh entire bot breaks. lel

Really? That's not what I said, he had the correct timing for 10 seconds and he has the means to implement the delay/sleep - he just didn't put it together because he is new.
It broke because he put a timing into the block send not because it was waiting 200 seconds.


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

#13 2015-12-08 22:58:14

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

Re: Time between placing a block

Tomahawk wrote:
den3107 wrote:

I must say using Thread.Sleep isn't a smart way to do it though (unless you run it in a separate thread).
Try and use Timers as much as you can.

Let's not throw the book at a newbie.

Which is why my original solution didn't contain it yet //forums.everybodyedits.com/img/smilies/tongue

Offline

#14 2015-12-08 23:37:04

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

Re: Time between placing a block

Koya wrote:
hummerz5 wrote:
Koya wrote:

therefore very close to

heh, yes. Put the 200 in teh FromSeconds, then wonder why teh entire bot breaks. lel

Really? That's not what I said, he had the correct timing for 10 seconds and he has the means to implement the delay/sleep - he just didn't put it together because he is new.
It broke because he put a timing into the block send not because it was waiting 200 seconds.

sorry. I didn't mean to say that wasn't what you said.

HOWEVER
your claim that "oh, he was close" struck me as funny, because random combinations of the two lines could have lead to an inexplicably long wait.

Offline

#15 2015-12-12 00:35:57

Processor
Member
Joined: 2015-02-15
Posts: 2,246

Re: Time between placing a block

Problem solved, topic closed.


I have never thought of programming for reputation and honor. What I have in my heart must come out. That is the reason why I code.

Offline

Processor1449876957565740

Board footer

Powered by FluxBB

[ Started around 1732442312.9087 - Generated in 0.129 seconds, 10 queries executed - Memory usage: 1.64 MiB (Peak: 1.85 MiB) ]