Code:
@name EGP for dummies V1
@inputs EGP:wirelink
@persist [Blue2 Orange Red Green Blue White Gray]:vector
@persist [Index Shape Pos Size Color Mindex Sindex Material Said]:array
@persist [Spos]:array
@persist Mode I Me:entity Q:string
@trigger
runOnChat(1)
if(chatClk(Me)){
LSL=Me:lastSaid():lower()
LSE=LSL:explode(" ")
LS=owner():lastSaid()
if(LSE[1,string]=="-draw"){
Shapes=LSE[2,string]
IDXs=LSE[3,string]
PosXs=LSE[4,string]
PosYs=LSE[5,string]
SizeXs=LSE[6,string]
SizeYs=LSE[7,string]
Rs=LSE[8,string]
Gs=LSE[9,string]
Bs=LSE[10,string]
As=LSE[11,string]
##Default white
if(As==""){As="255"}
if(Rs==""){Rs="255"}
if(Gs==""){Gs="255"}
if(Bs==""){Bs="255"}
IDX=IDXs:toNumber()
PosX=PosXs:toNumber()
PosY=PosYs:toNumber()
SizeX=SizeXs:toNumber()
SizeY=SizeYs:toNumber()
R=Rs:toNumber()
G=Gs:toNumber()
B=Bs:toNumber()
A=As:toNumber()
if(LSE[2,string]=="box"){
EGP:egpBox(IDX,vec2(PosX,PosY),vec2(SizeX,SizeY),
vec4(R,G,B,A))
EGP:egpDraw()
}
if(LSE[2,string]=="boxoutline"){
EGP:egpBoxoutline(IDX,vec2(PosX,PosY),vec2(SizeX,SizeY),
vec4(R,G,B,A))
EGP:egpDraw()
}
if(LSE[2,string]=="circle"){
EGP:egpCircle(IDX,vec2(PosX,PosY),vec2(SizeX,SizeY),
vec4(R,G,B,A))
EGP:egpDraw()
}
if(LSE[2,string]=="line"){
EGP:egpLine(IDX,vec2(PosX,PosY),vec2(SizeX,SizeY),
vec4(R,G,B,A))
EGP:egpDraw()
}
Index[IDX,string]=(IDXs)
Shape[IDX,string]=(Shapes:sub(1,1):upper()+Shapes:sub(2))
Pos[IDX,string]=(PosXs+","+PosYs)
Size[IDX,string]=(SizeXs+","+SizeYs)
Color[IDX,string]=(Rs+","+Gs+","+Bs+","+As)
if(Mode==1){
printColor(Green,"EGP",White,":",Blue,"egp"+
Shapes:sub(1,1):upper()+Shapes:sub(2),White,"(",Red,
IDXs,White,",",Blue,"vec2",White,"(",Red,PosXs,White,
",",Red,PosYs,White,"),",Blue,"vec2",White,"(",Red,SizeXs,
White,",",Red,SizeYs,White,"),",Blue,"vec4",White,"(",Red,
Rs,White,",",Red,Gs,White,",",Red,Bs,
White,",",Red,As,White,"))")
}
EGP:egpDraw()
EGP:egpClear()
}
if(LSE[1,string]=="-mat"){
Mat=LSE[3,string]
IDXs=LSE[2,string]
IDX=IDXs:toNumber()
EGP:egpMaterial(IDX,Mat)
Mindex[IDX,string]=IDXs
Material[IDX,string]=Mat
if(Mode==1){
printColor(Green," EGP",White,":",Blue,"egpMaterial",
White,"(",Red,IDXs,White,",",Gray,Q+Mat+Q,White,")")
}
EGP:egpDraw()
EGP:egpClear()
}
if(LSE[1,string]=="-write"){
Txt=LS:explode(Q)[2,string]
IDXs=LSE[2,string]
IDX=IDXs:toNumber()
PosXs=LSE[3,string]
PosYs=LSE[4,string]
PosX=PosXs:toNumber()
PosY=PosYs:toNumber()
EGP:egpText(IDX,Txt,vec2(PosX,PosY),vec4(255,255,255,255))
EGP:egpDraw()
if(Mode==1){
printColor(Green," EGP",White,":",Blue,"egpMaterial",
White,"(",Red,IDXs,White,",",Gray,Q+Txt+Q,White,",",Blue,
"vec2",White,"(",Red,PosXs,White,",",Red,PosYs,White,"),",
Blue,"vec4",White,"(",Red,"255",White,",",Red,"255",White,",",
Red,"255",White,",",Red,"255",White,"))")
}
Sindex[IDX,string]=IDXs
Spos[IDX,string]=(PosXs+","+PosYs)
}
if(LSL=="!progressive on"){
Mode=1
printColor(Blue2,"Progressive Mode Enabled!")
}
if(LSL=="!progressive off"){
Mode=0
printColor(Blue2,"Progressive Mode Disabled!")
}
if(LSL=="!clear"){
EGP:egpClear()
Index:clear()
Shape:clear()
Pos:clear()
Size:clear()
Color:clear()
}
if(LSL=="!build e2"){
hideChat(1)
I=1
printColor(Orange,"@name EGP for dummies by Jacoby6000")
printColor(Orange,"@inputs EGP:wirelink")
printColor(Gray,"##GENERATED BY JACOBY6000'S EGP EASY INTERFACE")
printColor(Blue2,"if",White,"(",Blue,"first",White,"()){")
while(I<=Index:count()){
printColor(Green," EGP",White,":",Blue,"egp"+
Shape[I,string],White,"(",Red,Index[I,string],White,
",",Blue,"vec2",White,"(",Red,Pos[I,string],White,"),",
Blue,"vec2",White,"(",Red,Size[I,string],White,"),",
Blue,"vec4",White,"(",Red,Color[I,string],White,"))")
I++
}
I=1
while(I<=Sindex:count()){
printColor(Green," EGP",White,":",Blue,"egpText",
White,"(",Red,Sindex[I,string],White,",",Blue,"vec2",
White,"(",Red,Spos[I,string],White,"),",Blue,"vec4",
White,"(",Red,"255,255,255,255",White,"))")
I++
}
I=1
while(I<=Mindex:count()){
printColor(Green," EGP",White,":",Blue,"egpMaterial",
White,"(",Red,Mindex[I,string],White,",",Gray,Q+
Material[I,string]+Q,White,")")
I++
}
printColor(Green," EGP",White,":",Blue,"egpDraw",White,"()")
printColor(White,"}")
}
}
if(first()){
concmd("echo ----------------------------------------------------------------------------------------------------------------")
concmd("echo ----------------------------------------------------------------------------------------------------------------")
concmd("echo ####Version 0.5########################## COMMANDS SECTION ###################################################")
concmd("echo ## !progressive on/off enables/disables code printing to chat as you create new shapes")
concmd("echo ## !build e2 sends the code to console & chat, ready to be copied and pasted directly into an E2 chip")
concmd("echo ## !clear obviously, clears all arrays/screen")
concmd("echo ## -draw circle index Posx Posy Radiusx Radiusy R G B A Creates a circle with these attributes")
concmd("echo ## -draw box index Posx Posy Sizex Sizey R G B A Creates a box with these attributes")
concmd("echo ## -draw boxoutline index Posx Posy Sizex Sizey R G B A Creates a boxoutline with these attributes")
concmd("echo ## -draw line index Pos1x Pos1y Pos2x Pos2y R G B A Creates a line with these attributes")
concmd("echo ## -mat Index Material changes the specified index's material to the said material")
concmd("echo ## -write Index PosX PosY 'Text In Quotes' writes text in the stated position")
concmd("echo ################################################################################################################")
concmd("echo ## Remember this is a WIP")
concmd("echo ## Future Updates:")
concmd("echo ## Animations (maybe)")
concmd("echo ## Polygons")
concmd("echo ## Angular stuff")
concmd("echo ## Materials")
concmd("echo ----------------------------------------------------------------------------------------------------------------")
Directive=vec(240,240,160) #Yellow EG: @name
Comment=vec(128,128,128) #Gray EG: A comment
Number=vec(240,160,160) #Pink EG: Numbers
Function=vec(160,160,240) #Dark Blue EG: functions, first, vec, etc..
Operator=vec(224,224,224) #White EG: () {} ==
Variable=vec(160,240,160) #Green EG: An Output/Input or defined variable
Keyword=vec(160,240,240) #Light Blue EG: if while for
Green=Variable
Blue2=Keyword
Red=Number
White=Operator
Orange=Directive
Gray=Comment
Blue=Function
printColor(Gray,"EGP for dummies V0.5",Blue2," | ",Red,"Created by Jacoby6000")
printColor(Red,"Accurate color coding thanks to smkdeath")
printColor(Green,"Type ",Orange,"wire_expression2_concmd 1",Green," in console then respawn the chip for full access to this chips functions, and function list")
printColor(Green,"if you still do not see it try:",Orange," wire_expression2_concmd_whitelist echo",Green,", then respawn the chip")
printColor(Blue2,"Progressive Mode Currently Enabled!")
Q=toChar(34)
Index=array()
Shape=array()
Pos=array()
Size=array()
Color=array()
Me=owner()
Mode=1
I=1
} PHP Code:
@name EGP for dummies V1
@inputs EGP:wirelink @persist [Blue2 Orange Red Green Blue White Gray]:vector
@persist [Index Shape Pos Size Color Mindex Material]:array
@persist [Tpos1 Tpos2 Tpos3 Tindex Sindex Spos]:array
@persist Mode I Me:entity Q:string
@trigger
runOnChat(1)
if(chatClk(Me)){
LSL=Me:lastSaid():lower()
LSE=LSL:explode(" ")
LS=owner():lastSaid()
if(LSE[1,string]=="-draw" & LSE[2,string]!="triangle"){
Shapes=LSE[2,string]
IDXs=LSE[3,string]
PosXs=LSE[4,string]
PosYs=LSE[5,string]
SizeXs=LSE[6,string]
SizeYs=LSE[7,string]
Rs=LSE[8,string]
Gs=LSE[9,string]
Bs=LSE[10,string]
As=LSE[11,string]
##Default white
if(As==""){As="255"}
if(Rs==""){Rs="255"}
if(Gs==""){Gs="255"}
if(Bs==""){Bs="255"}
IDX=IDXs:toNumber()
PosX=PosXs:toNumber()
PosY=PosYs:toNumber()
SizeX=SizeXs:toNumber()
SizeY=SizeYs:toNumber()
R=Rs:toNumber()
G=Gs:toNumber()
B=Bs:toNumber()
A=As:toNumber()
if(LSE[2,string]=="box"){
EGP:egpBox(IDX,vec2(PosX,PosY),vec2(SizeX,SizeY),
vec4(R,G,B,A))
EGP:egpDraw()
}
if(LSE[2,string]=="boxoutline"){
EGP:egpBoxoutline(IDX,vec2(PosX,PosY),vec2(SizeX,SizeY),
vec4(R,G,B,A))
EGP:egpDraw()
}
if(LSE[2,string]=="circle"){
EGP:egpCircle(IDX,vec2(PosX,PosY),vec2(SizeX,SizeY),
vec4(R,G,B,A))
EGP:egpDraw()
}
if(LSE[2,string]=="line"){
EGP:egpLine(IDX,vec2(PosX,PosY),vec2(SizeX,SizeY),
vec4(R,G,B,A))
EGP:egpDraw()
}
Index[IDX,string]=(IDXs)
Shape[IDX,string]=(Shapes:sub(1,1):upper()+Shapes:sub(2))
Pos[IDX,string]=(PosXs+","+PosYs)
Size[IDX,string]=(SizeXs+","+SizeYs)
Color[IDX,string]=(Rs+","+Gs+","+Bs+","+As)
if(Mode==1){
printColor(Green,"EGP",White,":",Blue,"egp"+
Shapes:sub(1,1):upper()+Shapes:sub(2),White,"(",Red,
IDXs,White,",",Blue,"vec2",White,"(",Red,PosXs,White,
",",Red,PosYs,White,"),",Blue,"vec2",White,"(",Red,SizeXs,
White,",",Red,SizeYs,White,"),",Blue,"vec4",White,"(",Red,
Rs,White,",",Red,Gs,White,",",Red,Bs,
White,",",Red,As,White,"))")
}
EGP:egpDraw()
EGP:egpClear()
}
if(LSE[1,string]=="-mat"){
Mat=LSE[3,string]
IDXs=LSE[2,string]
IDX=IDXs:toNumber()
EGP:egpMaterial(IDX,Mat)
Mindex[IDX,string]=IDXs
Material[IDX,string]=Mat
if(Mode==1){
printColor(Green," EGP",White,":",Blue,"egpMaterial",
White,"(",Red,IDXs,White,",",Gray,Q+Mat+Q,White,")")
}
EGP:egpDraw()
EGP:egpClear()
}
if(LSE[1,string]=="-write"){
Txt=LS:explode(Q)[2,string]
IDXs=LSE[2,string]
IDX=IDXs:toNumber()
PosXs=LSE[3,string]
PosYs=LSE[4,string]
PosX=PosXs:toNumber()
PosY=PosYs:toNumber()
EGP:egpText(IDX,Txt,vec2(PosX,PosY),vec4(255,255,255,255))
EGP:egpDraw()
if(Mode==1){
printColor(Green," EGP",White,":",Blue,"egpMaterial",
White,"(",Red,IDXs,White,",",Gray,Q+Txt+Q,White,",",Blue,
"vec2",White,"(",Red,PosXs,White,",",Red,PosYs,White,"),",
Blue,"vec4",White,"(",Red,"255",White,",",Red,"255",White,",",
Red,"255",White,",",Red,"255",White,"))")
}
Sindex[IDX,string]=IDXs
Spos[IDX,string]=(PosXs+","+PosYs)
}
if(LSE[1,string]=="-draw " & LSE[2,string]=="triangle"){
IDXs=LSE[3,string]
Pos1Xs=LSE[4,string]
Pos1Ys=LSE[5,string]
Pos2Xs=LSE[6,string]
Pos2Ys=LSE[7,string]
Pos3Xs=LSE[8,string]
Pos3Ys=LSE[9,string]
Rs=LSE[10,string]
Gs=LSE[11,string]
Bs=LSE[12,string]
As=LSE[13,string]
if(Rs==""){Rs="255"}
if(Gs==""){Gs="255"}
if(Bs==""){Bs="255"}
if(As==""){As="255"}
IDX=IDXs:toNumber()
Pos1X=Pos1Xs:toNumber()
Pos1Y=Pos1Ys:toNumber()
Pos2X=Pos2Xs:toNumber()
Pos2Y=Pos2Ys:toNumber()
Pos3X=Pos3Xs:toNumber()
Pos3Y=Pos3Ys:toNumber()
R=Rs:toNumber()
B=Bs:toNumber()
G=Gs:toNumber()
A=As:toNumber()
EGP:egpTriangle(IDX,Pos1X,Pos1Y,Pos2X,Pos2Y,Pos3X,Pos3Y,R,G,B,A)
if(Mode==1){
printColor(Green," EGP",White,":",Blue,"egpTriangle",
White,"(",Red,IDXs,White,",",Blue,"vec2",White,"(",Red,
Pos1Xs,White,",",Red,Pos1Ys,White,",),",Blue,"vec2",White,"(",Red,
Pos2Xs,White,",",Red,Pos2Ys,White,",),",Blue,"vec2",White,"(",Red,
Pos3Xs,White,",",Red,Pos3Ys,White,",),",Blue,"vec4",White,"(",Red,
Rs,White,",",Gs,White,",",Red,Bs,White,",",Red,As,White,"))"
}
Tindex[IDX,string]=IDXs
Tpos1[IDX,string]=Pos1Xs+","+Pos1Ys
Tpos2[IDX,string]=Pos2Xs+","+Pos2Ys
Tpos3[IDX,string]=Pos3Xs+","+Pos3Ys
Color[IDX,string]=Rs+","+Gs+","+Bs+","+As
if(LSL=="!progressive on"){
Mode=1
printColor(Blue2,"Progressive Mode Enabled!")
}
if(LSL=="!progressive off"){
Mode=0
printColor(Blue2,"Progressive Mode Disabled!")
}
if(LSL=="!clear"){
EGP:egpClear()
Index:clear()
Shape:clear()
Pos:clear()
Size:clear()
Color:clear()
}
if(LSL=="!build e2"){
hideChat(1)
I=1
printColor(Orange,"@name EGP for dummies by Jacoby6000")
printColor(Orange,"@inputs EGP:wirelink")
printColor(Gray,"##GENERATED BY JACOBY6000'S EGP EASY INTERFACE")
printColor(Blue2,"if",White,"(",Blue,"first",White,"()){")
for(I=1,Index:count()){ #Build Regular Shapes
printColor(Green," EGP",White,":",Blue,"egp"+
Shape[I,string],White,"(",Red,Index[I,string],White,
",",Blue,"vec2",White,"(",Red,Pos[I,string],White,"),",
Blue,"vec2",White,"(",Red,Size[I,string],White,"),",
Blue,"vec4",White,"(",Red,Color[I,string],White,"))")
}
for(I=1,Sindex:count()){ #Build Text
printColor(Green," EGP",White,":",Blue,"egpText",
White,"(",Red,Sindex[I,string],White,",",Blue,"vec2",
White,"(",Red,Spos[I,string],White,"),",Blue,"vec4",
White,"(",Red,"255,255,255,255",White,"))")
I++
}
for(I=1,Tindex:count()){ #Build Triangles
printColor(Green," EGP",White,":",Blue,"egpTriangle",
White,"(",Red,Tindex[I,string],White,",",Blue,"vec2",
White,"(",Red,Tpos1[I,string],White,")",White,",",Blue,"vec2",
White,"(",Red,Tpos2[I,string],White,")",White,",",Blue,"vec2",
White,"(",Red,Tpos3[I,string],White,")",White,",",Blue,"vec4",
White,"(",Red,Color[I,string],White,"))"
}
for(I=1,Mindex:count()){ #Build Materials
printColor(Green," EGP",White,":",Blue,"egpMaterial",
White,"(",Red,Mindex[I,string],White,",",Gray,Q+
Material[I,string]+Q,White,")")
I++
}
printColor(Green," EGP",White,":",Blue,"egpDraw",White,"()")
printColor(White,"}")
}
}
if(first()){
concmd("echo ----------------------------------------------------------------------------------------------------------------")
concmd("echo ----------------------------------------------------------------------------------------------------------------")
concmd("echo ####Version 0.5########################## COMMANDS SECTION ###################################################")
concmd("echo ## !progressive on/off enables/disables code printing to chat as you create new shapes")
concmd("echo ## !build e2 sends the code to console & chat, ready to be copied and pasted directly into an E2 chip")
concmd("echo ## !clear obviously, clears all arrays/screen")
concmd("echo ## -draw circle index Posx Posy Radiusx Radiusy R G B A Creates a circle with these attributes")
concmd("echo ## -draw box index Posx Posy Sizex Sizey R G B A Creates a box with these attributes")
concmd("echo ## -draw boxoutline index Posx Posy Sizex Sizey R G B A Creates a boxoutline with these attributes")
concmd("echo ## -draw line index Pos1x Pos1y Pos2x Pos2y R G B A Creates a line with these attributes")
concmd("echo ## -mat Index Material changes the specified index's material to the said material")
concmd("echo ## -write Index PosX PosY 'Text In Quotes' writes text in the stated position")
concmd("echo ## -draw triangle PosX1 PosY1 PosX2 PosY2 PosX3 PosY3 R G B A To create a triangle
concmd("echo ################################################################################################################")
concmd("echo ## Remember this is a WIP")
concmd("echo ## Future Updates:")
concmd("echo ## Animations (maybe)")
concmd("echo ## Polygons")
concmd("echo ## Angular stuff")
concmd("echo ## Materials")
concmd("echo ----------------------------------------------------------------------------------------------------------------")
Directive=vec(240,240,160) #Yellow EG: @name
Comment=vec(128,128,128) #Gray EG: A comment
Number=vec(240,160,160) #Pink EG: Numbers
Function=vec(160,160,240) #Dark Blue EG: functions, first, vec, etc..
Operator=vec(224,224,224) #White EG: () {} ==
Variable=vec(160,240,160)#Green EG: An Output/Input or defined variable
Keyword=vec(160,240,240) #Light Blue EG: if while for
Green=Variable
Blue2=Keyword
Red=Number
White=Operator
Orange=Directive
Gray=Comment
Blue=Function
printColor(Gray,"EGP for dummies V0.5",Blue2," | ",Red,"Created by Jacoby6000")
printColor(Red,"Accurate color coding thanks to smkdeath")
printColor(Green,"Type ",Orange,"wire_expression2_concmd 1",Green," in console then respawn the chip for full access to this chips functions, and function list")
printColor(Green,"if you still do not see it try:",Orange," wire_expression2_concmd_whitelist echo",Green,", then respawn the chip")
printColor(Blue2,"Progressive Mode Currently Enabled!")
Q=toChar(34)
Index=array()
Shape=array()
Pos=array()
Size=array()
Color=array()
Me=owner()
Mode=1
I=1
}
Bookmarks