@name Ammuts Ranger Camera System
@inputs Range
@outputs  PixelX PixelY FillColor Clk
@persist E:entity J TT Y
@trigger 

timer("chatloop1",100)
if(clk("chatloop1")){
    Clk = 0
timer("chatloop2",100)}

runOnChat(1)
if(first()){
    E = entity():isWeldedTo()
    gSetStr(1,E:pos():x():toString())
        gSetStr(2,E:pos():y():toString())
            gSetStr(3,E:pos():z():toString())
            TT = 0
            J = 0
            Y = 0
            
            holoCreate(1)
            holoPos(1,E:pos() + vec(0,0,10))
            holoCreate(2)
            holoPos(2,E:pos() + vec(0,0,20))
            holoCreate(3)
            holoPos(3,E:pos() + vec(0,0,30))
            holoCreate(4)
            holoPos(4,E:pos() + vec(0,0,40))
            
            
}
if(clk("chatloop2")){
R = owner():lastSaid():lower()
if(R:find("!start")){
    timer("loop",100)
    if(first()){
    J=0}
   # concmd("say Hold Still, Taking picture!")
}
timer("chatloop1",100)
Clk = 1
}
G = gGetStr(3)

#[print(gGetStr(1))
print(gGetStr(2))
print(gGetStr(3))]#

if(clk("loop")){
E:setPos(E:pos() + vec(0,2.5,0))
TT++
timer("loop2",100)
}
if(clk("loop2")){
    timer("loop",100)
}


if(TT>20){
    TT = 0
    Y = Y + 5
    J++
    E:setPos(holoEntity(J):pos())

}


if(J>4){
 concmd("say Done!")
    E:setPos(holoEntity(1):pos())
    stoptimer("loop")
    stoptimer("loop2")
       J = 0
}

if(Range>0){
    
}
