Hello, I recently been trying to learn pinescript and its going relatively well. I gotten the basics down but the one thing that confuse the **** out of me is how the loops and interrupts work.
From other scripts I seen it seem you add an infinite loop that waits for an interrupt and then call said interrupt arg which make sense. However it seem each interrupt will only ever be called once and never again after that. So this works for instances where its a 1 way trip.
However I'm trying to code for an field map, aka a raid boss. Now in my mind (I do have programming experience) I would basically set up a infinite loop that constantly find the boss and place it in a handle, then have interrupts set up for when it reaches ay 80/60/40/20% hp and those interrupt will call functions that will do what needs to be done. Because if its an infinite loop then even if the boss reset or dies and new one spawns it will keep doing the same thing over and over again.
But what I found out is that everything only runs ones, even if its set in a infinite loop or a never ending while loop the findhandle only ever run once, the interrupts only ever run once and until the map is reset they will never work again. So does anyone know if its possible to do what I'm attempting to do, because its like one of the first concept you learn in programing but it doesn't seem to work here =\
Also some where people said you can use C# in the script, anyone know if thats true if so how much? Thanks for any help guys and here sample code of what I tried with the loop.
infinite
open
interruptclear all.
findhandle BossHandle "KHeartless" 0.
interruptset HPLow "" 1 BossHandle 990 "onBossHP99".
infinite
open
waitinterrupt InterruptBlock "InterruptArg".
call InterruptBlock.
close.
close






