Help With Procedures - delay block [Solved]

Started by DragenSlayor on Mon, 05/14/2018 - 01:33

Topic category: Help with MCreator's application

Last seen on 19:28, 24. May 2019
Joined Jul 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Help With Procedures - delay block [Solved]
Mon, 11/19/2018 - 16:54 (edited)

Is there any way to wait in between each action in procedures? I'd like to know if theres a way.

Edited by DragenSlayor on Mon, 11/19/2018 - 16:54
Last seen on 05:15, 7. Jun 2018
Joined May 2018
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
You might try the custom…
Tue, 05/22/2018 - 13:19

You might try the custom code snippet (under advanced) and add

Thread.sleep(X);

Where "X" is number of milliseconds to wait. This appears to compile properly, but I cannot test operation.

Last seen on 19:33, 17. Nov 2019
Joined Jun 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
I have already replied in…
Tue, 05/22/2018 - 21:25

I have already replied in the mcreator news, anyways, here is a copy+paste

Actually a procedure is a Minecraft tick (1/20 seconds), so the only way for doing so is adding a global variable, then adding something that makes the global variable increase at the end of the procedure and adding an "if" condition that checks the value of the variable, does something and resets the variable. Rember to put big numbers in the "if" condition (if you'll put 100 it will wait 5 seconds, 100:20=5) Sorry for bad English

Last seen on 23:54, 30. May 2018
Joined Oct 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
how to make it increase at…
Tue, 05/22/2018 - 21:39

how to make it increase at the end of the procedure?

 

Last seen on 23:54, 30. May 2018
Joined Oct 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
oh any way to make a…
Wed, 05/23/2018 - 01:32

oh any way to make a cooldownw procedure?

Last seen on 19:33, 17. Nov 2019
Joined Jun 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Set Variable x (GetVariable…
Wed, 05/23/2018 - 05:22

Set Variable x (GetVariable x +1)

Last seen on 23:54, 30. May 2018
Joined Oct 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
can u sed  me a pic?
Wed, 05/23/2018 - 20:13

can u sed  me a pic?

Last seen on 23:54, 30. May 2018
Joined Oct 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Bro Raol Plz answer OMG
Sat, 05/26/2018 - 06:52

Bro Raol Plz answer

OMG

Last seen on 05:15, 7. Jun 2018
Joined May 2018
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
I'm not in front of my…
Sat, 05/26/2018 - 10:15

I'm not in front of my computer but i think this is what he's getting at.

  1. under loops section, get "WHILE []"
  2. under logic section, get "[]<[]"
  3. under custom variables section, get "GET [custom variable]", put into first logic slot
  4. under math get "0", put into second logic slot, set to number ticks you want counted
  5. under custom variables section, get the option "SET [custom variable] =[]", put into loop thread
  6. under math section get "[]+[]", put into SET slot
  7. custom variables "GET [custom variable]", put into first + slot
  8. math "0", put into second + slot, set to 1
  9. logic "if[]", underneath-outside-after while loop
  10. logic "[]=[]" into IF slot
  11. GET custom variable into first logic slot
  12. math "0" into second logic slot, set to tick value you want event to happen
  13. put events into IF loop
  14. repeat 9-13 for each "warning" or timed event
Last seen on 05:15, 7. Jun 2018
Joined May 2018
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
edit: step 2: put that logic…
Sat, 05/26/2018 - 10:16

edit: step 2: put that logic into the while slot.

Last seen on 05:15, 7. Jun 2018
Joined May 2018
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
edit 2: step 9 and following…
Sat, 05/26/2018 - 10:31

edit 2: step 9 and following; on second thought, better put those if functions into the while loop. :weary: this whole thing inefficient and cludgy but if you're absolutely certain thread.sleep(X) won't work for your purposes...

my understanding is that thread.sleep() will count actual time and the while loop will count ticks. This means if the server is lagging, there might be a significant difference in amount of time measured.