ShorePatrol 0 Posted April 11, 2020 Report Share Posted April 11, 2020 (edited) I need some clarification.... Please see *working* attached script. The intention is to loop through the list, and display "Stat: 1 of 5"...."Stat: 2 of 5", etc.... The UI Stat Monitor is placed BEFORE the Loop node (as I learned in the tutorial)....and this works.... However, since the UI Stat Monitor is BEFORE the loop node, I would not expect this to work....I would think the US Stat Monitor would need to be INSIDE the loop node... Why does it work this way - how does this flow???? Doesn't make sense to me.....? Can someone explain please? Thank you Edited April 12, 2020 by ShorePatrol Quote Link to post Share on other sites
pash 504 Posted April 12, 2020 Report Share Posted April 12, 2020 "UI Stat Monitor" Should be placed on the top. Should not be placed in any node exemplehttps://wiki.ubotstudio.com/wiki/UI_stat_monitor Quote Link to post Share on other sites
ShorePatrol 0 Posted April 12, 2020 Author Report Share Posted April 12, 2020 (edited) Sorry, I forgot to attach the image (It's attached now) - yes, I see it goes on top, but again, this doesn't make sense to me...if the script runs from the top to the bottom, the UI Stat Monitor runs before it enters the loop, therefore, it's weird that it updates while the loop is running. clear list(%newlist)add list to list(%newlist,$list from file("C:\\Users\\David\\Desktop\\daves.txt"),"Delete","Global")ui stat monitor("Stat:","{$list position(%newlist)} of {$list total(%newlist)}")loop($list total(%newlist)) { alert($next list item(%newlist))} Edited April 12, 2020 by ShorePatrol Quote Link to post Share on other sites
pash 504 Posted April 12, 2020 Report Share Posted April 12, 2020 clear list(%newlist) add list to list(%newlist,$list from file("C:\\Users\\David\\Desktop\\daves.txt"),"Delete","Global") ui stat monitor("Stat:","{$list position(%newlist)} of {$list total(%newlist)}") set list position(%newlist,0) loop($list total(%newlist)) { set(#Debug,$next list item(%newlist),"Global") wait(0.1) } clear list(%newlist) add list to list(%newlist,$list from file("C:\\Users\\David\\Desktop\\daves.txt"),"Delete","Global") ui stat monitor("Stat:","{#loop} of {$list total(%newlist)}") set list position(%newlist,0) set(#loop,0,"Global") loop($list total(%newlist)) { increment(#loop) set(#Debug,$next list item(%newlist),"Global") wait(1) } Quote Link to post Share on other sites
ShorePatrol 0 Posted April 12, 2020 Author Report Share Posted April 12, 2020 I guess you don't understand my question. I appreciate your reply, and again, my script works...I just don't understand why. I guess once you set a UI Stat, it just updates throughout your script.. Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted April 13, 2020 Report Share Posted April 13, 2020 I usually place all my UI commands at the end of my scripts. That way they're out of my way. You can have five loops in the same stat monitor, the stat monitor is not just for loops. You can use variables in there too.You can also have multiple stat monitors.It's just a debug tool and a way to give the user all sorts of information. 1 Quote Link to post Share on other sites
HelloInsomnia 1103 Posted April 14, 2020 Report Share Posted April 14, 2020 From the link Pash provided to the wiki page: "The UI stat monitor is a live command, and it is always checking the value of the variable, list item or table cell assigned to it." 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.