@name Imagepusher
@inputs Digi:wirelink Elements:array  ParserData 
@outputs Strs:string StringVar:string Data:string Parse
@persist A B Data:string N   Vectors:array   V
@persist Color:array RA RV Z:vector RM  Culoare:vector Elem1 Elem2 Elem3 Text:array
@model models/hunter/plates/plate.mdl

runOnTick(1)
runOnFile(1)
#===================                                               #REPLACE THIS PART
URL = "http://melondevstudios.com/imagewriter/imagewriter.php?path=#http://www.multiplaying.net/wp-content/uploads/2011/08/Nyan-180x180.jpg"
X = 64
Y = 64
Digi[1048573] = X
Digi[1048572] = Y
Resolution = X*Y
Res = X:toString()+"x"+Y:toString()
#Setting 2
#Setting 3
#===================
#===================
#Statitics & Stuff
#====================
E = entity()
if(first()){
    Parse = 1
    E:setMaterial("models/debug/debugwhite")
    timer("parser",6000)
}

ParsVec = round((RV/Resolution)*100)
if(ParsVec>100){ParsVec=100}
E:setColor(vec(ParsVec*1.2,0,0))
VCount = Text:count()
setName("Parser
Rendered: "+ParsVec+" %
Parsed Vectors: "+VCount+"
Image Size: "+Res+"
Pixels to read: "+Resolution)

#===================
#HTTP
#====================
Link = ""

if(httpClk()){
httpRequest(URL)}
Data = httpData()
Strs = Data
#===================
if(clk("parser")){
 Parse = 0   
}
   if(Parse==1){
   while(perf()){  
Text = Data:explode(".")
}}
if(Parse==0){

function vector toVector(String:string){
 Func = String:explode(",")
Vector = vec(Func[1,string]:toNumber(),Func[2,string]:toNumber(),Func[3,string]:toNumber())
return Vector 
}
#===================
#Parser
#====================
if(first()){A=-1
  
    }
while(perf()){
    RA+=1
    RM+=1
    N+=1
    if(RM==3){
    RM=0
    RV+=1
    Color[RV,vector] = toVector(Text[RV,string])
    }
Number = rgb2digi(Color[RV,vector],0)
Digi[RV]=Number
V+=1
if(RV>Resolution){ 
}}}  
