ID:2040768
 
(See the best response by Lige.)
Under interface, I use a label that changes its image from time to time. So, somewhere in my code, I want to make an if statement where, if that label uses a specific image then perform action a else do action b. Is there a way to get a label's image programmatically (if it uses image.png for example, get that name and store it in a variable)?
Thanks

Best response
You can use winget().

mob
verb
getimage()
var/retrieve = winget(src,"default.label","image")
if(retrieve == "image.png")
do stuff
else
do other stuff
Keep in mind that winget() actually queries the client to get that information, so there is a delay (can be anywhere from 50ms to 200ms or more). It's generally better to just track on the server which image you set last (unless you have client-side controls that can change it without informing the server)