public class Main extends javax.swing.JFrame {
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea();
jScrollPane2 = new javax.swing.JScrollPane();
jTree1 = new javax.swing.JTree();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Testable");
setResizable(false);
jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jScrollPane1.setViewportView(jTextArea1);
javax.swing.tree.DefaultMutableTreeNode treeNode1 = new javax.swing.tree.DefaultMutableTreeNode("root");
javax.swing.tree.DefaultMutableTreeNode treeNode2 = new javax.swing.tree.DefaultMutableTreeNode("Events");
javax.swing.tree.DefaultMutableTreeNode treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Brick");
javax.swing.tree.DefaultMutableTreeNode treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("OnTouched");
javax.swing.tree.DefaultMutableTreeNode treeNode5 = new javax.swing.tree.DefaultMutableTreeNode("Delete the brick that touched");
treeNode4.add(treeNode5);
treeNode3.add(treeNode4);
treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("OnTouched(by a player)");
treeNode5 = new javax.swing.tree.DefaultMutableTreeNode("Kill the player");
treeNode4.add(treeNode5);
treeNode3.add(treeNode4);
treeNode2.add(treeNode3);
treeNode1.add(treeNode2);
treeNode2 = new javax.swing.tree.DefaultMutableTreeNode("Actions");
treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Bricks");
treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Dissappear(smooth)");
treeNode3.add(treeNode4);
treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Dissappear");
treeNode3.add(treeNode4);
treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Reappear(smooth)");
treeNode3.add(treeNode4);
treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Reappear");
treeNode3.add(treeNode4);
treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Move");
treeNode5 = new javax.swing.tree.DefaultMutableTreeNode("Towards");
javax.swing.tree.DefaultMutableTreeNode treeNode6 = new javax.swing.tree.DefaultMutableTreeNode("Nearest brick");
treeNode5.add(treeNode6);
treeNode6 = new javax.swing.tree.DefaultMutableTreeNode("Nearest player");
treeNode5.add(treeNode6);
treeNode4.add(treeNode5);
treeNode5 = new javax.swing.tree.DefaultMutableTreeNode("Upwards (y+)");
treeNode4.add(treeNode5);
treeNode5 = new javax.swing.tree.DefaultMutableTreeNode("Downwards (y-)");
treeNode4.add(treeNode5);
treeNode5 = new javax.swing.tree.DefaultMutableTreeNode("To the left (x-)");
treeNode4.add(treeNode5);
treeNode5 = new javax.swing.tree.DefaultMutableTreeNode("To the right (x+)");
treeNode4.add(treeNode5);
treeNode5 = new javax.swing.tree.DefaultMutableTreeNode("To the other left (z-)");
treeNode4.add(treeNode5);
treeNode5 = new javax.swing.tree.DefaultMutableTreeNode("To the other right (z+)");
treeNode4.add(treeNode5);
treeNode3.add(treeNode4);
treeNode2.add(treeNode3);
treeNode3 = new javax.swing.tree.DefaultMutableTreeNode("Other");
treeNode4 = new javax.swing.tree.DefaultMutableTreeNode("Wait");
treeNode5 = new javax.swing.tree.DefaultMutableTreeNode("Wait under a second");
treeNode6 = new javax.swing.tree.DefaultMutableTreeNode("Wait one millisecond");
treeNode5.add(treeNode6);
treeNode6 = new javax.swing.tree.DefaultMutableTreeNode("Wait two milliseconds");
treeNode5.add(treeNode6);
treeNode6 = new javax.swing.tree.DefaultMutableTreeNode("Wait three milliseconds");
treeNode5.add(treeNode6);
treeNode6 = new javax.swing.tree.DefaultMutableTreeNode("Wait four milliseconds");
treeNode5.add(treeNode6);
treeNode6 = new javax.swing.tree.DefaultMutableTreeNode("Wait five milliseconds");
treeNode5.add(treeNode6);
treeNode6 = new javax.swing.tree.DefaultMutableTreeNode("Wait six milliseconds");
treeNode5.add(treeNode6);
treeNode6 = new javax.swing.tree.DefaultMutableTreeNode("Wait seven milliseconds");
treeNode5.add(treeNode6);
treeNode6 = new javax.swing.tree.DefaultMutableTreeNode("Wait two milliseconds");
treeNode5.add(treeNode6);
treeNode4.add(treeNode5);
treeNode3.add(treeNode4);
treeNode2.add(treeNode3);
treeNode1.add(treeNode2);
jTree1.setModel(new javax.swing.tree.DefaultTreeModel(treeNode1));
jTree1.setRootVisible(false);
jScrollPane2.setViewportView(jTree1);
jButton1.setText("Generate");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton2.setText("Help");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE)
.addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, 128, Short.MAX_VALUE)
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 128, Short.MAX_VALUE))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(jButton2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 298, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 278, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 38, Short.MAX_VALUE)))
.addContainerGap())
);
pack();
}// </editor-fold>
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String text = this.jTextArea1.getText();
String news = "";
String[] lns = new String[100];
int ll=0;
int l=0;
for(int i=0;i<text.length();i++) {
if(text.substring(i,i).equals("\n")) {
lns[l] = text.substring(ll,i);
ll=i+1;
l++;
}
}
for(int f =0;f<100;l++) {
if(lns[f] != null) {
String c = lns[f];
if(c.equals("OnTouched")) {
news += "script.Parent.OnTouched:connect(function(hit)\n";
}
else if(c.equals("OnTouched(by a player)")) {
news += "script.Parent.OnTouched:connect(function(hit)\n\tif(not hit.Parent:findFirstChild(\"Humanoid\")) then\n\t\treturn;\n\\n";
}
else if(c.equals("Kill the player")) {
news += "\thit.Parent.Humanoid.Health = 0;\n";
}
else if(c.equals("Delete the brick that touched")) {
news += "\thit:remove();\n";
}
}
}
}
/**
* @param args
*/
public static void main(String[] args) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Main().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JTextArea jTextArea1;
private javax.swing.JTree jTree1;
// End of variables declaration
}