#Infinite looping

1 messages · Page 1 of 1 (latest)

rapid shore
#

Coming back to scripting, and I got a dumb question.
If I make a looping macro go forever (like a poorly worded while). How do I kill the macro?

zealous patrol
rapid shore
#

whelp. Is there a way to make a macro fire of every 30 seconds for like 5 minutes then?

dawn pumice
#

Did you actually cause an infinite loop, MTScript has a built in loop ceiling that should kill the macro so I wonder how you managed to not get caught by that

rapid shore
#

yes i did :/

#

using defered macros

#
[h: id = currentToken()]

[h: loopamount = loopamount-1]
[h, if (loopamount > 0), code:{
    [h: link = macrolinktext("turn2@lib:rock","none",loopamount,id)]
    [h: execLink(link, 1)]
};{}]
#

but i messed up the if condition

#

well... I think

dawn pumice
#

yeah defered macro is run an new macro... 😦

rapid shore
#

managed to get it to run. I was trying to make some kind of animation with a rotating token.
For some reason it absolutely lag the whole thing (even when it dosnt loop infinitely)
Anyway I dropped the whole thing, was a dumb attempt

dawn pumice
#

The map rendering lagged?

rapid shore
#

yea, rotation where super choppy

misty iron
#

Can't say it would have interrupted this particular looping issue... but in the past I've had some success with holding down the ESC key while the loop is in progress.

dawn pumice
#

for animation purposes if you could delay how long of a delay would you want, because that would also be choppy

#

MTScript wouldn't be reliable with < 1 second timers

rapid shore
#

probably that yea

#

delay loop was like 200 ms

#

nah, checked, when i start 2 rotating object the whole interfac elag

#

even zooming in/out

dawn pumice
#

yeah, sadly MTScript runs on the GUI thread, so you have
Script->Refresh Map->Script->Refresh Map->... (and so on) so other UI messages like zoom, menus macro buttons get interspersed between that meaning they could take a while to process

stuck siren
#

Find the feature request for a macro killing button or key combo and vote me too.

zealous patrol
# rapid shore yea, rotation where super choppy

I'd done a good bit of playing around with token rotation and animation.
Locally, things are good, but for remote players, token rotation has always been choppy. The timing is a busy loop.
I can point you to the code bits in ActionPads if you're interested.

stuck siren
#

Animation will never work for tokens over a network. You have no control over the timing.

zealous patrol
# stuck siren Animation will never work for tokens over a network. You have no control over th...

I know in 1.11.5 remote performance in my testing was pretty good, but you're correct, it will never be "really good".
In 1.12.x performance went down to a really choppy remote experience.
I haven't d-loaded the 1.15 (still on 1.15.rc3), performance seems "really good" via a LAN but yeah, network remoteness will be a problem

The one thing on my list was to use CSS instead of the token (like lib:slide or the dice).

stuck siren
#

@zealous patrol stop spending your time on it and get smart, learn Java, and implment agif and webp in MT code