Skip to content

Commit 294e957

Browse files
authored
Add files via upload
1 parent 64f18c6 commit 294e957

69 files changed

Lines changed: 7179 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Java hack.chat Bot
2+
A simple bot for https://hack.chat/ in java
3+
4+
5+
## Download
6+
Download the latest executable jar [JHCBot v1.0.2](https://github.com/OpSimple/jhcbot/releases/download/v1.0.2/jhcbot-latest.jar)
7+
8+
### Sources
9+
You can download source code releases from [Github Releases](https://github.com/OpSimple/jhcbot/releases)
10+
11+
### Building
12+
This project is created with [Apache Maven](https://maven.apache.org/) so download and install it if you don't have it already.
13+
Build executable jar files using
14+
15+
mvn clean package
16+
17+
This will produce the two jars:
18+
- **JHCBot-1.0-SNAPSHOT.jar** This is the executable jar without the dependencies packed within the jar. You must have all dependencies in the classpath to run the bot.
19+
- **JHCBot-1.0-SNAPSHOT-jar-with-dependencies.jar** This executable jar has all the dependencies mentioned in `pom.xml` already packed within the jar. You can run the bot directly with it although it is slightly heavier.
20+
21+
## Running
22+
First, create/modify the config file for the bot `jhcbot.xml` or `jhcbot.properties` with all the required entries with their appropriate values respectively (See `jhcbot.xml` file for the explanations and suggestions on the config values).
23+
Now, place the config file in the current directory/folder and proceed towards executing the jar.
24+
25+
Run the bot by executing any of the jars but its better to execute JHCBot-1.0-SNAPSHOT-jar-with-dependencies.jar cause it has all the dependencies in it. Be sure, you include all the dependencies mentioned in `pom.xml` if you are going to execute JHCBot-1.0-SNAPSHOT.jar
26+
27+
To execute the jar and run the bot
28+
29+
java -jar target/JHCBot-1.0-SNAPSHOT-jar-with-dependencies.jar
30+
31+
Or
32+
33+
java -jar <path to jar file>
34+
35+
You can also provide the config file with its path while executing the jar
36+
37+
java -jar <path to jar file> -f <path to config file>
38+
39+
# License
40+
This project is under [MIT License](https://github.com/OpSimple/jhcbot/blob/master/LICENSE)
41+

cmds/CONFUSED.bsh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/java bsh.Interpreter
2+
// Simple bean script
3+
4+
import org.simplelabz.jhcbot.command.Command;
5+
import org.simplelabz.jhcbot.command.event.CommandEvent;
6+
7+
CONFUSED()
8+
{
9+
public String name()
10+
{
11+
return "Confused face";
12+
}
13+
14+
public String call()
15+
{
16+
return "confused";
17+
}
18+
19+
public String desc()
20+
{
21+
return "Confused face";
22+
}
23+
24+
public boolean isHidden()
25+
{
26+
return false;
27+
}
28+
29+
public void action(CommandEvent ev)
30+
{
31+
ev.send("(。>﹏<。)");
32+
}
33+
34+
public boolean listens()
35+
{
36+
return false;
37+
}
38+
public void listen(CommandEvent ev)
39+
{
40+
//nothing to do here
41+
}
42+
43+
return this;
44+
}

cmds/KILL.bsh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/java bsh.Interpreter
2+
// Simple bean script
3+
4+
import org.simplelabz.jhcbot.command.Command;
5+
import org.simplelabz.jhcbot.command.event.CommandEvent;
6+
7+
KILL()
8+
{
9+
public String name()
10+
{
11+
return "KILL";
12+
}
13+
14+
public String call()
15+
{
16+
return "kill";
17+
}
18+
19+
public String desc()
20+
{
21+
return "I'M NOT GONNA SPARE EM TODAY!";
22+
}
23+
24+
public boolean isHidden()
25+
{
26+
return false;
27+
}
28+
29+
public void action(CommandEvent ev)
30+
{
31+
String[] args = ev.getArgs();
32+
if(args==null)return;
33+
ev.send("@"+ev.getNick()+" killed "+args[0]);
34+
}
35+
36+
public boolean listens()
37+
{
38+
return false;
39+
}
40+
public void listen(CommandEvent ev)
41+
{
42+
//nothing to do here
43+
}
44+
45+
return this;
46+
}

cmds/LENNY.bsh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/java bsh.Interpreter
2+
// Simple bean script
3+
4+
import org.simplelabz.jhcbot.command.Command;
5+
import org.simplelabz.jhcbot.command.event.CommandEvent;
6+
7+
LENNY()
8+
{
9+
public String name()
10+
{
11+
return "Lenny face";
12+
}
13+
14+
public String call()
15+
{
16+
return "lenny";
17+
}
18+
19+
public String desc()
20+
{
21+
return "Lenny face";
22+
}
23+
24+
public boolean isHidden()
25+
{
26+
return false;
27+
}
28+
29+
public void action(CommandEvent ev)
30+
{
31+
ev.send("@"+ev.getNick()+" ( ͡° ͜ʖ ͡°) "+((ev.getArgsStr()!=null)?ev.getArgsStr():""));
32+
}
33+
34+
public boolean listens()
35+
{
36+
return false;
37+
}
38+
public void listen(CommandEvent ev)
39+
{
40+
//nothing to do here
41+
}
42+
43+
return this;
44+
}

cmds/LOL.bsh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/java bsh.Interpreter
2+
// Simple bean script
3+
4+
import org.simplelabz.jhcbot.command.Command;
5+
import org.simplelabz.jhcbot.command.event.CommandEvent;
6+
7+
LOL()
8+
{
9+
public String name()
10+
{
11+
return "LOL";
12+
}
13+
14+
public String call()
15+
{
16+
return "lol";
17+
}
18+
19+
public String desc()
20+
{
21+
return "A big and loud laugh! LOL!";
22+
}
23+
24+
public boolean isHidden()
25+
{
26+
return false;
27+
}
28+
29+
public void action(CommandEvent ev)
30+
{
31+
ev.send("$\\Huge LOL$");
32+
}
33+
34+
public boolean listens()
35+
{
36+
return false;
37+
}
38+
public void listen(CommandEvent ev)
39+
{
40+
//nothing to do here
41+
}
42+
43+
return this;
44+
}

cmds/PUNCH.bsh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/java bsh.Interpreter
2+
// Simple bean script
3+
4+
import org.simplelabz.jhcbot.command.Command;
5+
import org.simplelabz.jhcbot.command.event.CommandEvent;
6+
7+
PUNCH()
8+
{
9+
public String name()
10+
{
11+
return "Punch";
12+
}
13+
14+
public String call()
15+
{
16+
return "punch";
17+
}
18+
19+
public String desc()
20+
{
21+
return "Knock em down!";
22+
}
23+
24+
public boolean isHidden()
25+
{
26+
return false;
27+
}
28+
29+
public void action(CommandEvent ev)
30+
{
31+
String[] args = ev.getArgs();
32+
if(args.length==0)return;
33+
ev.send("@"+ev.getNick()+" punches "+args[0]+" and knocks them DOWNN!");
34+
}
35+
36+
public boolean listens()
37+
{
38+
return false;
39+
}
40+
public void listen(CommandEvent ev)
41+
{
42+
//nothing to do here
43+
}
44+
45+
return this;
46+
}

cmds/SHRUG.bsh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/java bsh.Interpreter
2+
// Simple bean script
3+
4+
import org.simplelabz.jhcbot.command.Command;
5+
import org.simplelabz.jhcbot.command.event.CommandEvent;
6+
7+
SHRUG()
8+
{
9+
public String name()
10+
{
11+
return "Shrug";
12+
}
13+
14+
public String call()
15+
{
16+
return "shrug";
17+
}
18+
19+
public String desc()
20+
{
21+
return "Shrug";
22+
}
23+
24+
public boolean isHidden()
25+
{
26+
return false;
27+
}
28+
29+
public void action(CommandEvent ev)
30+
{
31+
ev.send("¯\\_(ツ)_/¯");
32+
}
33+
34+
public boolean listens()
35+
{
36+
return false;
37+
}
38+
public void listen(CommandEvent ev)
39+
{
40+
//nothing to do here
41+
}
42+
43+
return this;
44+
}

cmds/SLAP.bsh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/java bsh.Interpreter
2+
// Simple bean script
3+
4+
import org.simplelabz.jhcbot.command.Command;
5+
import org.simplelabz.jhcbot.command.event.CommandEvent;
6+
7+
SLAP()
8+
{
9+
public String name()
10+
{
11+
return "Slap";
12+
}
13+
14+
public String call()
15+
{
16+
return "slap";
17+
}
18+
19+
public String desc()
20+
{
21+
return "Teach em a good lesson!";
22+
}
23+
24+
public boolean isHidden()
25+
{
26+
return false;
27+
}
28+
29+
public void action(CommandEvent ev)
30+
{
31+
String[] args = ev.getArgs();
32+
if(args==null)return;
33+
ev.send("@"+ev.getNick()+" slaps "+args[0]+" so hard that "+args[0]+" falls two feet away!");
34+
}
35+
36+
public boolean listens()
37+
{
38+
return false;
39+
}
40+
public void listen(CommandEvent ev)
41+
{
42+
//nothing to do here
43+
}
44+
45+
return this;
46+
}

0 commit comments

Comments
 (0)