Advanced Scene Switcher

Advanced Scene Switcher 1.29.3

Warmuptill

Active Member
I can't seem to set the variable to be the text source, which the text source itself is referencing its own file source (not static text, but the text inside the .txt file).
If you are trying to set the value of a variable to be the file path referenced by a text source, you can use a macro like this:
1745079530241.png


If you are then trying to read the contents of that text file and assign it to another macro you can use this setup:
1745079777351.png


I hope I understood your question correctly - I apologise if I did not!

The other thing is, i'm not sure how to ask the macro to skip itself until a new line is created... here is the use case.

The kill feed shows who has died, and stays on that line position for 5-7 seconds then disappears - however, it could get bumped if another player dies within that same window, screenshot below.

https://imgur.com/a/4mETJXW Video example: https://streamable.com/z0yfqt
(you can see deaths go from 8 to 9, because I pattern matched the "continue button"), so I can track my own K/D ratio but trying to track my teammates via the kill feed.

Line 1 on the screen initially is "BoT slain by Baba"
then quickly after another person dies and Line 1 now becomes Line 2, Line 1 is now "cT was slain by Kaal", etc.

So it's like I need the script to not read Line 1 and spam the hotkey counting kills every 1 second, but also be smart enough to read a different line is created.
Not sure if it will work:
Maybe you can limit the area to be check to be only the lowest line like this:

1745080582408.png


Then you are sure that only the most recent death log is being checked and the lines which are pushed up are being ignored.
However with that approach you would have to set up a separate macro for each of the players.

1745081039076.png


The "Within the last X seconds" option in combination with "Perform actions only on condition change" at the top ensures that the increment happens at most every X seconds.
So you will have to tweak that value to your liking.

You can import the example macros shown in this post using this code:
Code:
AAApA3ic7Vrvb9s2E/5XBGIf2s1y9Mt2km+pm3QGmiyr0/bDUhSURElcJFIgqTR5A//v75GSbElxknbL1g2z0aASeXc83j28e+jkDhU4Elyiw9/uEMMFQYfo+AYXZU7QCKWCVyU6THAuyQiVuJJkia/JK5Lha8oFOnSa0Y6MwHlO8vUAZ/MMs3QjIa9oeXxDol/YUmGhNuOKl0eRopzJRXLG1WvONkp64YwLNaciqqg6vsZ5hbVsV2JegY1izllM9dQ8I9HVgikiQHotFz0qdIe0ZdJ5cMbeweAzQuq21FMrWJZRZcJwTYQ0/rgwGvPoakmUoiyV2pYgKZWwxtqLDM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nWB91BXvK9SURKaHW2+rqFjPCrvjjzvvjyf5f7PwcABlTzORTrr8ROMOF9UYTkW0p6rjtAu3+Q24XpOBUPG/IzzOa57SUI+s1houTdQSWwFTHv/rx0yVboc53P9u+Tu4eGOfegelqD7r3U4prLgKVoiLNuV4fe+QCrxz79sxOQ3wwc6Jwhlb/ByrktAA=
You will of course have to re-adjust the source selections etc.

Hope that helps!
 

ArdSagart

New Member
Hi! Could you please advise what should I use as a ${VarName} in the macro to create a welcome message for the latest follower? I can't retrieve the correct value.
 

StadiumPK

New Member
If you are trying to set the value of a variable to be the file path referenced by a text source, you can use a macro like this:
View attachment 112949

If you are then trying to read the contents of that text file and assign it to another macro you can use this setup:
View attachment 112950

I hope I understood your question correctly - I apologise if I did not!


Not sure if it will work:
Maybe you can limit the area to be check to be only the lowest line like this:

View attachment 112951

Then you are sure that only the most recent death log is being checked and the lines which are pushed up are being ignored.
However with that approach you would have to set up a separate macro for each of the players.

View attachment 112952

The "Within the last X seconds" option in combination with "Perform actions only on condition change" at the top ensures that the increment happens at most every X seconds.
So you will have to tweak that value to your liking.

You can import the example macros shown in this post using this code:
Code:
AAApA3ic7Vrvb9s2E/5XBGIf2s1y9Mt2km+pm3QGmiyr0/bDUhSURElcJFIgqTR5A//v75GSbElxknbL1g2z0aASeXc83j28e+jkDhU4Elyiw9/uEMMFQYfo+AYXZU7QCKWCVyU6THAuyQiVuJJkia/JK5Lha8oFOnSa0Y6MwHlO8vUAZ/MMs3QjIa9oeXxDol/YUmGhNuOKl0eRopzJRXLG1WvONkp64YwLNaciqqg6vsZ5hbVsV2JegY1izllM9dQ8I9HVgikiQHotFz0qdIe0ZdJ5cMbeweAzQuq21FMrWJZRZcJwTYQ0/rgwGvPoakmUoiyV2pYgKZWwxtqLDMt3FXtVKaVVlKjqsXMdy3ujECdVybc47IQ1o2mWw49aJOu9yAtRbUImWvsX5AZcRLAearLVGzdrIr2T+3Pv6zGYjXqL1B41Qpv1LSyIpd0e9zROtEOPqRiPtY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u+Tu4eGOfegelqD7r3U4prLgKVoiLNuV4fe+QCrxz79sxOQ3wwc6Jwhlb/ByrktAA=
You will of course have to re-adjust the source selections etc.

Hope that helps!

Ok so it works, except when I changed the value within the text, it doesn't actually update the variable - but if I update anything in the variable command, it does update.

I think the "value changed" is not looking at the text file modification date, or something. Basically if I manually update everything, the variable changes, but I do it via my other bot to adjust the text file value, the variable does not update.

I am going to use this for a different function I believe, more controllable - but amazing help regardless - thank you.
 

Warmuptill

Active Member
Hi! Could you please advise what should I use as a ${VarName} in the macro to create a welcome message for the latest follower? I can't retrieve the correct value.
You can find an example how to set this up here in the wiki:
 

Tallicia

Member
A build with additional options to modify JSON values contained in variables is available here on GitHub:
Note that you will have to be logged in to be able to download it.
If that should be a problem I upload it somewhere else.

For example, let's assume My Variable has the following value:
JSON:
{
    "books":
    [
        {
            "category": "fiction",
            "title" : "A Wild Sheep Chase",
            "author" : "Haruki Murakami",
            "price" : 22.72
        },
        {
            "category": "fiction",
            "title" : "The Night Watch",
            "author" : "Sergei Lukyanenko",
            "price" : 23.58
        },
        {
            "category": "fiction",
            "title" : "The Comedians",
            "author" : "Graham Greene",
            "price" : 21.99
        },
        {
            "category": "memoir",
            "title" : "The Night Watch",
            "author" : "Phillips, David Atlee"
        }
    ]
}

This set of actions actions ...

View attachment 112888

... will then reduce the value to The Night Watch.

Let me know if everything works as expected / if you have feedback.
Thank you so much for this! in my case, it's not quite working.

When I put in a hardcoded "lookup" value I get back the value wrapped in [" and "] - Maybe an option to "strip"/pare down to the value, as it appears it is still in a json form.

1745119529824.png


1745119503882.png


And slightly more important to be usable, the variable is not being used for the value in the query, it's just resulting in an empty set json of []

1745119626409.png

It looks like the
$['${CardId}'] .ShortName
is not being parsed and the variable converted to the Id


======
And for context, I can't use the array index as the entries are not guaranteed to be in order or sequential. there are gaps in the Ids.

1745119794042.png


Hopefully that is sufficiently clear. let me know if further explanation is needed.
 

Warmuptill

Active Member
When I put in a hardcoded "lookup" value I get back the value wrapped in [" and "] - Maybe an option to "strip"/pare down to the value, as it appears it is still in a json form.
A JSONPath query will always return a JSON array, as the query can return multiple results.
I also stumbled over that, which is why I decided to include the option to access JSON array elements.

1745145142309.png


I thought about automatically stripping the array in case only one / no result is found, but decided against it, as deviating from default JSONPath behavior might cause incompatibilities in the future / surprise other potential users of this functionality.

And slightly more important to be usable, the variable is not being used for the value in the query, it's just resulting in an empty set json of []

1745119626409.png

It looks like the
$['${CardId}'] .ShortName
is not being parsed and the variable converted to the Id
I just gave it a try, but unfortunately I am not able to reproduce the problem and the variable values used in the query are resolved as expected.
Maybe "CardId" was not set to the expected value?
This would result in the behavior you described, as the query would return an empty array if the given Id was not found.
Example.gif


Or did I misunderstand the problem?

And thank you a lot for your feedback!
 
Top