#(Wahrheit) Fractal tasks question

44 messages · Page 1 of 1 (latest)

spare pollen
#

Is there a theoretical or practical reason why I should not inject the task I am already running into itself? I'm rewriting my daily login script to simplify a lot of the code, and when a player hits a "jackpot" they get to roll again on a better loot table.

outer flameBOT
#

(Wahrheit) Fractal tasks question

outer flameBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

spare pollen
#

Currently it just runs a separate task with the same / similar code but I figured I could inject the same task with new definitions and it would... be fine?

#

I could also probably just reorder the code to not make it run fractally lol

#

but I find the concept amusing

delicate urchin
#

I do this as well with a leveling system I'm working on (runs to give a player certain amount of xp, if the xp is greater than one level threshold, it substracts the current threshold and runs again to handle the remaining thresholds reached (if that's the case) inside the same task)

Would love to hear opinions on this or if it's frowned upon/there's an alternative to it(?)

spare pollen
#

I tested it and it appears to work

delicate urchin
#

Yeah it works very well for me and I was relieved I could handle it without having to write similar code that basically does the same thing lol, I'm just interested to see if it's not preferred or there are any risks to it

runic quartz
#

i personally wouldn't inject, but instead use run to start a new queue

#

no idea if there are consequences to recursive injects

spare pollen
#

I generally prefer inject over run

spare pollen
#

related to this uplift am I going to get shouted at by the debugger if I use elementtag.parsed to parse a maptag value

#

not seeing an alternative tag

#

I am storing item: <mythic_item[ImbuedShovel]> in the data script atm which is not my favorite way to do it, but...

#

I don't see a warning in the editor

#

and it appears to work flawlessly

bleak yew
#

!t script.parsed_key

glass jayBOT
# bleak yew !t script.parsed_key

Returns the value from a data key on the script as an ElementTag, ListTag, or MapTag.
Will automatically parse any tags contained within the value of the key, preserving key data structure
(meaning, a tag that returns a ListTag, inside a data list, will insert a ListTag inside the returned ListTag, as you would expect).

Returns

ObjectTag

spare pollen
#

not sure that will work here

#
    - define itemlist <list>
    - foreach <script[daily_login_spinner].data_key[data.<[sourcelist]>]> as:entry:
        - define itemlist <[itemlist].pad_left[<[itemlist].size.add[<[entry].get[weight]>]>].with[<[entry].get[item].parsed.as[item].with[quantity=<[entry].get[quantity]>]>]>
#

I could try

bleak yew
#

if you have maptag definitions you can also do <[entry.weight]>

spare pollen
#

oh shit does that actually work lol

bleak yew
#

does the foreach loop runs in the same script as your data?

spare pollen
#

lol alas no

#

I made a separate task

bleak yew
#

ah ye ok

spare pollen
#

heading to the movies for now, will try some more of these little tweaks after

#

already YUGE progress today tho

bleak yew
#

nice

#

if you paste the whole thing I could check it for you

spare pollen
bleak yew
#

I'm so glad @digital walrus did the github highlighting

spare pollen
#

same lol

digital walrus
visual dome
#

mergus suggestion on running it as a new queue on repeat is probably a good suggestion but as long as you're being careful with infinite loops, you shouldn't really have any issues

visual dome
#

but unfairly confident war height would have compensated for that
but i'm fairly confident wahrheit would have* - yike, i dont know how i missed that typo

opaque tigerBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@spare pollen