Tyoung_
Legend
I sometimes write programs in Java. If you want to run any other these yourselves, I'd recommend downloading Eclipse compiler. But there's this website that will run them online https://www.compilejava.net/
Here's a relatively simple random loot generator I made for Abbo's gravedigging event. I wanted a random dispersion of loot in all the coffins, and this was the result. It facilitates three tiers of loot for dead bodies with varying degrees of wealth. I remember Squidziod 's char Rohrer actually twigged this early on, which was cool. It's a pity we didn't get to dig up some more but oh well haha. There's another loot level in there for filler like bones, and skulls and stuff.
Trying to isolate some rumors from the rumors thread on their own. I can get the first one, but any of them after that are a bit harder. If anyone wants to help, it would be handy if there were some rumors on the most recent page starting with "Rumor has it" and not just OOC stuff like. . . this. . .
Your standard welcome message. Nothing new here.
A special message to a new player. You can't see it here but it also gives the player 32 bread.
Here's a relatively simple random loot generator I made for Abbo's gravedigging event. I wanted a random dispersion of loot in all the coffins, and this was the result. It facilitates three tiers of loot for dead bodies with varying degrees of wealth. I remember Squidziod 's char Rohrer actually twigged this early on, which was cool. It's a pity we didn't get to dig up some more but oh well haha. There's another loot level in there for filler like bones, and skulls and stuff.
This is what I'm working on atm, messing around with something called jsoup, which lets you take information from webpages as a Java outputs. Note: This code won't work with the online compiler I linked about because you have to import jsoup as an external jar.import java.util.concurrent.ThreadLocalRandom;
public class RandomNumber {
public static void main(String[] args) {
int min = 1;
int max = 10;
int randomNum1 = ThreadLocalRandom.current().nextInt(min, max + 1);
int randomNum2 = ThreadLocalRandom.current().nextInt(min, max + 1);
int randomNum3 = ThreadLocalRandom.current().nextInt(min, max + 1);
int randomNum4 = ThreadLocalRandom.current().nextInt(min, max + 1);
int randomNum5 = ThreadLocalRandom.current().nextInt(min, max + 1);
int randomNum6 = ThreadLocalRandom.current().nextInt(min, max + 1);
char lootLevel = '3';
// Input your loot level here - Either 'J', '1', '2', or '3'.
switch (lootLevel) {
case 'J':
int bones = (randomNum1 - 5);
bones = bones < 0? 0 : bones;
int flesh = (randomNum2 - 6);
flesh = flesh < 0? 0 : flesh;
int skull = (randomNum3 - 8);
skull = skull < 0? 0 : skull;
skull = skull > 1? skull : 1;
int emeraldJ = (randomNum4 - 7);
emeraldJ = emeraldJ < 0? 0 : emeraldJ;
int clothes = (randomNum5 - 8);
clothes = clothes < 0? 0 : clothes;
int books = (randomNum6 - 8);
books = books < 0? 0 : books;
System.out.println( "This grave needs " + bones + " Bone(s), " + flesh + " rotton flesh, " + skull + " skull(s), " + emeraldJ + " emeralds, " + clothes + " Rotten Clothes and " + books + " Rotten Books!");
break;
case '1':
int jewelry1 = ((randomNum1)/3);
jewelry1 = jewelry1 < 0? 0 : jewelry1;
int emerald1 = (3 * (randomNum2 - 3));
emerald1 = emerald1 < 0? 0 : emerald1;
int diamonds = (randomNum3 - 6);
diamonds = diamonds < 0? 0 : diamonds;
System.out.println( "This grave needs " + jewelry1 + " pieces of jewelry " + emerald1 + " emeralds " + diamonds + " diamonds." );
break;
case '2':
int jewelry2 = ((randomNum1/3) - 1);
jewelry2 = jewelry2 < 0? 0 : jewelry2;
int emerald2 = (2 * (randomNum2 - 3));
emerald2 = emerald2 < 0? 0 : emerald2;
char weapon2 = 'y';
int wep2 = (randomNum3 -7);
wep2 = wep2 > 0? (weapon2 = 'y') : (weapon2 = 'n');
int weptier2 = ((randomNum4/3) + 1);
weptier2 = weptier2 <= 0? 1 : weptier2;
System.out.println( "This grave needs " + jewelry2 + " piece(s) of jewelry and " + emerald2 + " emerald(s). " + "Does this need a weapon? " + weapon2 + " . ");
if (randomNum3 > 7)
{
System.out.println(weptier2 + " Is the weapon tier!");
}
else
{
System.out.println("There is no weapon tier!");
}
break;
case '3':
int jewelry3 = ((randomNum1/3) - 1);
jewelry3 = jewelry3 < 0? 0 : jewelry3;
int emerald3 = (randomNum2 - 4);
emerald3 = emerald3 < 0? 0 : emerald3;
char weapon3 = 'y';
int wep3 = (randomNum3 -7);
wep3 = wep3 > 0? (weapon3 = 'y') : (weapon3 = 'n');
int weptier3 = (randomNum4/3);
weptier3 = weptier3 <= 0? 1 : weptier3;
System.out.println( "This grave needs " + jewelry3 + " piece(s) of jewelry and " + emerald3 + " emerald(s). " + "Does this need a weapon? " + weapon3 + ". " );
if (randomNum3 > 7)
{
System.out.println(weptier3 + " Is the weapon tier!");
}
else
{
System.out.println("There is no weapon tier!");
}
break;
default:
System.out.println( "Please input the correct loot level - 1, 2, 3 or J" );
}
}
}
Trying to isolate some rumors from the rumors thread on their own. I can get the first one, but any of them after that are a bit harder. If anyone wants to help, it would be handy if there were some rumors on the most recent page starting with "Rumor has it" and not just OOC stuff like. . . this. . .
I'm a man of my word. Here is the indecency you were promised.package me.[myname];
import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
public class JSoupContent {
public static void main(String[] args) throws IOException {
String url = "http://hollowworld.co.uk/threads/rumours-thread.20930/page-145";
Document document = Jsoup.connect(url).get();
String rumor1 = document.select("meta[name=description]").attr("content");
System.out.println(rumor1);
}
}
And finally, because this is the Game Development subforum, here is me messing around with Bukkit.package [myname];
public class Nood {
public static void main(String[] args) {
int yourAge = 18;
// Input your age before the semicolon
boolean no0ds;
if (yourAge >= 18) {
no0ds = true;
System.out.println("(.)(.)");
} else {
no0ds = false;
System.out.println("Get off my christian thread and go look at any other of the art threads on the forums!");
}
}
}
Your standard welcome message. Nothing new here.
A special message to a new player. You can't see it here but it also gives the player 32 bread.