Vtank Expressions
is there a way to detect if a character has vitea with vtank? trying to refine my DT meta's and being able to tell how much VP I have would be quite useful.
Last night had the idea of adding a readout at the end of each room in Colosseum for the time remaining, I have to say im quite pleased with the result.
basic idea is this start with a stopwatch when the run begins
throughout the run in default states 5,7,9 whenever
this will allow you to get the remaining seconds with 60-StopwatchSecond-Counter
then in default3 you will want something similar to defaut 5,7,9 except it will also set state back to default3 incase you need to do it again before the readout
then when you see the door message ^A Door appears or ^Congratulations! you use this for the readout, you may want to limit this action to your leader only using inventory item count.
the result will be something like this [Fellowship] You say, "Time Remaining 51m 30s"
basic idea is this start with a stopwatch when the run begins
Code: Select all
ExprAct setvar[StopwatchSecond, stopwatchcreate[]];stopwatchstart[getvar[StopwatchSecond]]
Code: Select all
Expr stopwatchelapsedseconds[getvar[StopwatchSecond]]-getvar[Counter]>=60
ExprAct setvar[Counter, getvar[Counter]+60]
then in default3 you will want something similar to defaut 5,7,9 except it will also set state back to default3 incase you need to do it again before the readout
Code: Select all
Expr stopwatchelapsedseconds[getvar[StopwatchSecond]]-getvar[Counter]>=60
All: {Expr setvar[Counter, getvar[Counter]+60], Set Meta State: Default3}
Code: Select all
ExprChat \/f\ Time\ Remaining\ +cstrf[59-stopwatchelapsedseconds[getvar[StopwatchSecond]]/60, \F\0]+m\ +cstrf[60-(stopwatchelapsedseconds[getvar[StopwatchSecond]]-getvar[Counter]), \F\0]+s
just a friendly warning, if you copy/paste a meta expression from this forum that is fairly long for example
ExprChat \/f\ Time\ Remaining\ +cstrf[60-stopwatchelapsedseconds[getvar[StopwatchSecond]]/60, \F\0]+m\ +cstrf[60-(stopwatchelapsedseconds[getvar[StopwatchSecond]]-getvar[Counter]), \F\0]+s
make sure to paste it first into the AC chat first then copy again before you post it into the meta. For some reason if you do not it will cause an error with the metas format and be unloadable until you go into the meta using notepad and remove it.
ExprChat \/f\ Time\ Remaining\ +cstrf[60-stopwatchelapsedseconds[getvar[StopwatchSecond]]/60, \F\0]+m\ +cstrf[60-(stopwatchelapsedseconds[getvar[StopwatchSecond]]-getvar[Counter]), \F\0]+s
make sure to paste it first into the AC chat first then copy again before you post it into the meta. For some reason if you do not it will cause an error with the metas format and be unloadable until you go into the meta using notepad and remove it.
- Immortalbob
- Site Admin
- Posts: 677
- Contact:
have you tried using the code tag?Dmdtt wrote:just a friendly warning, if you copy/paste a meta expression from this forum that is fairly long for example
ExprChat \/f\ Time\ Remaining\ +cstrf[60-stopwatchelapsedseconds[getvar[StopwatchSecond]]/60, \F\0]+m\ +cstrf[60-(stopwatchelapsedseconds[getvar[StopwatchSecond]]-getvar[Counter]), \F\0]+s
make sure to paste it first into the AC chat first then copy again before you post it into the meta. For some reason if you do not it will cause an error with the metas format and be unloadable until you go into the meta using notepad and remove it.
Code: Select all
ExprChat \/f\ Time\ Remaining\ +cstrf[60-stopwatchelapsedseconds[getvar[StopwatchSecond]]/60, \F\0]+m\ +cstrf[60-(stopwatchelapsedseconds[getvar[StopwatchSecond]]-getvar[Counter]), \F\0]+s
Immortalbob of MT
I'll give it a try later if it works I will go back and make the proper edits.
Edit: works perfectly thanks for the suggestion bob!
Edit: works perfectly thanks for the suggestion bob!
Worked out something rather useful a few nights ago finally got it working properly so I figured id share. Goal was to set my macros to interrupt their hunting whenever killtasks were available. I started this timer by talking to the first killtask npc at hoshino, when I am on a timer I will get a readout like You may complete this quest again in 15h 38m 1s. now I would have to have 1 rule for each potential hour for the killtasks in question, for most npcs this is will be 20 rules that look something like this.
then in my default2 state I setup a rule which reacts to when enough time has elapsed to set me to return and retrieve the killtasks.
Code: Select all
KilltaskCheck -
Chat Message: ^You may complete this quest again in 15h
All: {ExprAct setvar[KilltaskCounter, (16*3600)], ExprAct setvar[StopwatchKilltask, stopwatchcreate[]];stopwatchstart[getvar[Stopwatchkilltask]]}
Code: Select all
Default2-
stopwatchelapsedseconds[getvar[StopwatchKilltask]]>=getvar[KilltaskCounter]
All: {ExprAct clearallvars[], Set Meta State: Killtask}
hitting a wall with an idea of mine,
trying to store multiple coordinate points with different names using a counter then attempting to react using an expression for every coordinate point stored.
storing the variables was the easy part
initial setup- setvar[coord, coord];setvar[Counter, 1]
ExprAct setvar[getvar[coord]+cstr[getvar[Counter]], getplayercoordinates[]];setvar[Counter, getvar[Counter]+1]
that part works flawlessly
the part I am struggling with is making an expression condition that will react to being in any of the stored coordinate point locations.
so far this is what I am thinking
coordinatetostring[getvar[getvar[coord]+cstr[getvar[Counter]]]]==coordinatetostring[getplayercoordinates[]]
the problem is I need a way to react to every getvar[Counter] 1-99 etc sort of like how you would use .* in regex searches using VGI but I can't figure out how to do it.
anyone got any ideas?
trying to store multiple coordinate points with different names using a counter then attempting to react using an expression for every coordinate point stored.
storing the variables was the easy part
initial setup- setvar[coord, coord];setvar[Counter, 1]
ExprAct setvar[getvar[coord]+cstr[getvar[Counter]], getplayercoordinates[]];setvar[Counter, getvar[Counter]+1]
that part works flawlessly
the part I am struggling with is making an expression condition that will react to being in any of the stored coordinate point locations.
so far this is what I am thinking
coordinatetostring[getvar[getvar[coord]+cstr[getvar[Counter]]]]==coordinatetostring[getplayercoordinates[]]
the problem is I need a way to react to every getvar[Counter] 1-99 etc sort of like how you would use .* in regex searches using VGI but I can't figure out how to do it.
anyone got any ideas?
Dmdtt wrote:hitting a wall with an idea of mine,
trying to store multiple coordinate points with different names using a counter then attempting to react using an expression for every coordinate point stored.
storing the variables was the easy part
initial setup- setvar[coord, coord];setvar[Counter, 1]
ExprAct setvar[getvar[coord]+cstr[getvar[Counter]], getplayercoordinates[]];setvar[Counter, getvar[Counter]+1]
that part works flawlessly
the part I am struggling with is making an expression condition that will react to being in any of the stored coordinate point locations.
so far this is what I am thinking
coordinatetostring[getvar[getvar[coord]+cstr[getvar[Counter]]]]==coordinatetostring[getplayercoordinates[]]
the problem is I need a way to react to every getvar[Counter] 1-99 etc sort of like how you would use .* in regex searches using VGI but I can't figure out how to do it.
anyone got any ideas?
so I figured out a potential solution to my earlier idea it isn't exactly what id call perfect but it does function
using the expression,
coordinatetostring[getvar[getvar[coord]+cstr[randint[1, getvar[Counter]]]]]==coordinatetostring[getplayercoordinates[]]
randint[2] will constantly loot for different stored variables for coord1, coord2, coord3 etc between 1-getvar[Counter] however high that is. if I were to split this into sections 1-10 11-20 21-30 etc I think I can also cut down the time it takes to react to being in one of the stored locations.
another option I found would be using cstrf[stopwatchelapsedseconds[getvar[Stopwatch]]*10, \F\0] in place of radint[2] then whenever stopwatchelapsedseconds[getvar[Stopwatch]]==10 restart the stopwatch