Skip to content

Commit c3095a9

Browse files
author
JasonTheKitten
committed
Thank you, SquidDev!
1 parent 8967035 commit c3095a9

File tree

5 files changed

+82
-7
lines changed

5 files changed

+82
-7
lines changed

ReadMe.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,52 @@
1-
# ComputerCraft Code Critic Bot
1+
# ComputerCraft Code Critic Bot (C4Bot)
22

33
### Discord bot which attempts to help new programmers to code in lua
4+
5+
Currently, C4Bot only indirectly runs CCEmuX. However, the eventual goal of this project
6+
is to evaluate a given ComputerCraft:Tweaked lua script from either discord or pastebin and
7+
evaluate the scripts complexity (Did it use deprecated functions? Did it remember to use the local scope?).
8+
9+
### License
10+
[License.txt](License.txt)
11+
12+
### Contributors
13+
Lupus590
14+
15+
EveryOS
16+
17+
YOU! (Maybe)
18+
19+
### Special Thanks To
20+
SquidDev - Converted ComputerCraft to ComputerCraft:Tweaked and wrote CCEmuX.
21+
Additionally, was a large help with getting gradle to work.
22+
23+
Dan200 - Initial developer of ComputerCraft
24+
25+
Other ComputerCraft and ComputerCraft:Tweaked contributors
26+
27+
Referenced sites of this project (e.g. https://discordapp.com, https://pastebin.com)
28+
29+
GitHub, and also Linus Torvalds - Git
30+
31+
Shadow, a gradle plugin
32+
33+
The people who wrote Gradle, also the people who came up with the idea of a ReadMe
34+
35+
Oracle & Sun - Java 1.8
36+
37+
Eclipse and IntelliJ - IDEs
38+
39+
etc, etc, you get it.
40+
41+
And YOU!
42+
43+
### Building and running
44+
```cd CCEmuX
45+
./gradlew build
46+
cd ..
47+
./gradlew build
48+
cd build/libs
49+
java -jar Lupus590.C4Bot-<VERSION>.jar
50+
```
51+
Replace <VERSION> with the project version.
52+
```

build.gradle

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,46 @@
1-
version '1.0-SNAPSHOT'
1+
buildscript {
22

3-
apply plugin: 'java'
3+
}
4+
5+
plugins {
6+
id 'com.github.johnrengelman.shadow' version '2.0.1'
7+
id 'java'
8+
}
9+
10+
version '0.0.1-SNAPSHOT'
411

512
sourceCompatibility = 1.8
613

14+
allprojects {
715
repositories {
816
mavenCentral()
917
jcenter()
1018
}
1119

1220
dependencies {
1321
testCompile group: 'junit', name: 'junit', version: '4.12'
14-
compile 'net.dv8tion:JDA:3.8.1_454'
22+
implementation 'net.dv8tion:JDA:3.8.1_454'
23+
implementation files('CCEmuX/build/libs/CCEmuX-1.0.0-cct.jar')
24+
file('CCEmuX/build/libs/CCEmuX-1.0.0-cct.jar')
25+
}
1526
}
1627

28+
apply plugin: 'com.github.johnrengelman.shadow'
29+
apply plugin: 'java'
30+
1731
jar {
1832
manifest {
1933
attributes(
20-
"Class-Path": configurations.compile.collect { it.getName() }.join(' '),
34+
//"Class-Path": configurations.compile.collect { it.getName() }.join(' '),
35+
//"Class-Path": '../../CCEmuX/build/libs/CCEmuX-1.0.0-cct.jar',
36+
//"Class-Path": "com.github.jengelman.gradle.plugins:shadow:2.0.1",
2137
"Main-Class": "lupus590.c4bot.main.Main"
2238
)
2339
}
2440
}
41+
42+
shadowJar {
43+
classifier = null
44+
}
45+
46+
//Thanks to squiddev

src/main/java/lupus590/c4bot/main/CodeFilter.java renamed to src/main/java/filters/CodeFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package lupus590.c4bot.main;
1+
package filters;
22
//takes discord message as input and strips out everything that is not in code tags
33

44
public class CodeFilter {

src/main/java/lupus590/c4bot/main/MessageListener.java renamed to src/main/java/listeners/MessageListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package lupus590.c4bot.main;
1+
package listeners;
22
import net.dv8tion.jda.core.entities.Message;
33
import net.dv8tion.jda.core.events.message.MessageReceivedEvent;
44
import net.dv8tion.jda.core.hooks.ListenerAdapter;

src/main/java/lupus590/c4bot/main/Main.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
package lupus590.c4bot.main;
22
import java.io.File;
33

4+
import listeners.MessageListener;
5+
import net.clgd.ccemux.init.Launcher;
46
import net.dv8tion.jda.core.JDA;
57
import net.dv8tion.jda.core.JDABuilder;
68

79
public class Main {
810
public static void main(String[] args) throws Exception
911
{
12+
Launcher.main(new String[] {});
13+
1014
String token = null;
1115
if(args.length == 0) {
1216
File f = new File("./config.xml");

0 commit comments

Comments
 (0)