<commit_before>/*
 * Skybot, a multipurpose discord bot
 *      Copyright (C) 2017 - 2018  Duncan "duncte123" Sterken & Ramid "ramidzkh" Khan & <NAME> "Sanduhr32"
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package ml.duncte123.skybot.objects.delegate;

import Java.lang.VRCubeException;
import groovy.lang.Script;
import org.codehaus.groovy.control.CompilationFailedException;

import java.io.File;
import java.io.IOException;

public class ScriptDelegate extends Script {
    private int counter = 0;

    public ScriptDelegate(Script s) {
        super(s.getBinding());
    }

    @Override
    public Object run() {
        return "I am a bot, I can't run.";
    }

    @Override
    public void println() {
        throw new VRCubeException("Hey, i like to keep my console clean");
    }

    @Override
    public void print(Object value) {
        throw new VRCubeException("Hey, i like to keep my console clean");
    }

    @Override
    public void println(Object value) {
        throw new VRCubeException("Hey, i like to keep my console clean");
    }

    @Override
    public void printf(String format, Object value) {
        throw new VRCubeException("Hey, i like to keep my console clean");
    }

    @Override
    public void printf(String format, Object[] values) {
        throw new VRCubeException("Hey, i like to keep my console clean");
    }

    @Override
    public Object evaluate(String expression) throws CompilationFailedException {
        throw new VRCubeException("This method is blocked");
    }

    @Override
    public Object evaluate(File file) throws CompilationFailedException, IOException {
        throw new VRCubeException("How did you get access to the file class?");
    }

    @Override
    public void run(File file, String[] arguments) throws CompilationFailedException, IOException {
        throw new VRCubeException("I am a bot, I can't run");
    }

    public Object dump() {
        return "\uD83D\uDEAE";
    }

    public Object find() {
        return "You will never find me.";
    }

    public int quick_mafs(int x) {
        int the_thing = x + 2 -1;
        return the_thing;
    }

    public boolean isEven(int number) {
        return number % 2 == 0;
    }

    @Override
    public String toString() {
        return "Script" + (++counter);
    }
}<commit_msg>Fix ScriptDelegate.java<commit_after>/*
 * Skybot, a multipurpose discord bot
 *      Copyright (C) 2017 - 2018  Duncan "duncte123" Sterken & Ramid "ramidzkh" Khan & <NAME> "Sanduhr32"
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package ml.duncte123.skybot.objects.delegate;

import Java.lang.VRCubeException;
import groovy.lang.Binding;
import groovy.lang.MetaClass;
import groovy.lang.Script;
import org.codehaus.groovy.control.CompilationFailedException;

import java.io.File;
import java.io.IOException;

public class ScriptDelegate extends Script {

    private static int counter = 0;

    private int count = ++counter;

    public ScriptDelegate(Script s) {
        super(s.getBinding());
    }

    @Override
    public Object run() {
        return "I am a bot, I can't run.";
    }

    @Override
    public void println() {
        throw new VRCubeException("Hey, i like to keep my console clean");
    }

    @Override
    public void print(Object value) {
        throw new VRCubeException("Hey, i like to keep my console clean");
    }

    @Override
    public void println(Object value) {
        throw new VRCubeException("Hey, i like to keep my console clean");
    }

    @Override
    public void printf(String format, Object value) {
        throw new VRCubeException("Hey, i like to keep my console clean");
    }

    @Override
    public void printf(String format, Object[] values) {
        throw new VRCubeException("Hey, i like to keep my console clean");
    }

    @Override
    public Object evaluate(String expression) throws CompilationFailedException {
        throw new VRCubeException("This method is blocked");
    }

    @Override
    public Object evaluate(File file) throws CompilationFailedException, IOException {
        throw new VRCubeException("How did you get access to the file class?");
    }

    @Override
    public void run(File file, String[] arguments) throws CompilationFailedException, IOException {
        throw new VRCubeException("I am a bot, I can't run");
    }

    @Override
    public Binding getBinding() {
        Binding b = new Binding();
        b.setProperty("meme", "you");
        return b;
    }

    @Override
    public void setProperty(String property, Object newValue) {}

    public Object dump() {
        return "\uD83D\uDEAE";
    }

    public Object find() {
        return "You will never find me.";
    }

    public int quick_mafs(int x) {
        int the_thing = x + 2 -1;
        return the_thing;
    }

    public boolean isEven(int number) {
        return number % 2 == 0;
    }

    @Override
    public String toString() {
        return "Script" + count;
    }
}
{'fraction_non_alphanumeric': 0.0851472471190781, 'fraction_numerical': 0.0076824583866837385, 'mean_word_length': 2.9031855090568395, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1089990', 'n_tokens_mistral': 1783, 'n_tokens_neox': 1694, 'n_words': 681}