mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-10 10:20:41 -07:00
Gave bots random names
This commit is contained in:
parent
3e8d244987
commit
b24957bd06
20 changed files with 3320 additions and 131 deletions
3177
Server/data/botdata/botnames.txt
Normal file
3177
Server/data/botdata/botnames.txt
Normal file
File diff suppressed because it is too large
Load diff
4
Server/data/botdata/getnames.sh
Executable file
4
Server/data/botdata/getnames.sh
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
for i in {6000..6500}
|
||||
do
|
||||
wget -O- "https://secure.runescape.com/m=hiscore_oldschool/overall.ws?table=0&page=$i" | grep user1= | sed 's/^.*user1=//'| sed 's/".*$//' | grep -v "Binary" >> botnames.txt
|
||||
done
|
||||
|
|
@ -21,11 +21,10 @@ public final class AIPBuilder {
|
|||
|
||||
/**
|
||||
* Creates a new artificial intelligent player.
|
||||
* @param name The name.
|
||||
* @return The AIPlayer object.
|
||||
*/
|
||||
public static AIPlayer create(String name, Location l) {
|
||||
return new AIPlayer(name, l);
|
||||
public static AIPlayer create(Location l) {
|
||||
return new AIPlayer(l);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -35,7 +34,7 @@ public final class AIPBuilder {
|
|||
* items, etc.
|
||||
*/
|
||||
public static AIPlayer copy(Player player) {
|
||||
return copy(player, player.getName(), player.getLocation());
|
||||
return copy(player, player.getLocation());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -46,19 +45,7 @@ public final class AIPBuilder {
|
|||
* items, etc.
|
||||
*/
|
||||
public static AIPlayer copy(Player player, Location l) {
|
||||
return copy(player, player.getName(), l);
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes an artificial intelligent copy of the player.
|
||||
* @param player The player.
|
||||
* @param name The AIP's name.
|
||||
* @param l The location the AIP should spawn on.
|
||||
* @return The artificial intelligent player with the same name, stats,
|
||||
* items, etc.
|
||||
*/
|
||||
public static AIPlayer copy(Player player, String name, Location l) {
|
||||
AIPlayer p = new AIPlayer(name, l);
|
||||
AIPlayer p = new AIPlayer(l);
|
||||
p.getSkills().copy(player.getSkills());
|
||||
p.getInventory().copy(player.getInventory());
|
||||
p.getEquipment().copy(player.getEquipment());
|
||||
|
|
@ -70,7 +57,7 @@ public final class AIPBuilder {
|
|||
|
||||
public static void RandomAfkPlayer(Location loc)
|
||||
{
|
||||
final AIPlayer bot = new AIPlayer("bottest", loc);
|
||||
final AIPlayer bot = new AIPlayer(loc);
|
||||
bot.getAppearance().setGender(RandomFunction.random(3) == 1 ? Gender.FEMALE : Gender.MALE);
|
||||
Repository.getPlayers().add(bot);
|
||||
bot.init();
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
package org.crandor.game.node.entity.player.ai;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.*;
|
||||
|
||||
import org.crandor.game.content.dialogue.DialoguePlugin;
|
||||
import org.crandor.game.content.global.tutorial.CharacterDesign;
|
||||
|
|
@ -66,16 +65,19 @@ public class AIPlayer extends Player {
|
|||
* The player controlling this AIP.
|
||||
*/
|
||||
private Player controler;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructs a new {@code AIPlayer} {@code Object}.
|
||||
* @param name The name of the AIP.
|
||||
* @param l The location.
|
||||
*/
|
||||
public AIPlayer(Location l) {
|
||||
this(retrieveRandomName(), l);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public AIPlayer(String name, Location l) {
|
||||
private AIPlayer(String name, Location l) {
|
||||
super(new PlayerDetails("/aip" + (currentUID + 1) + ":" + name));
|
||||
super.setLocation(startLocation = l);
|
||||
super.artificial = true;
|
||||
|
|
@ -84,6 +86,27 @@ public class AIPlayer extends Player {
|
|||
this.uid = currentUID++;
|
||||
}
|
||||
|
||||
public static String retrieveRandomName() //Reads a random line from the file O_O
|
||||
{
|
||||
String result = null;
|
||||
Random rand = new Random();
|
||||
int n = 0;
|
||||
try {
|
||||
for(Scanner sc = new Scanner(new File("./data/botdata/botnames.txt")); sc.hasNext(); )
|
||||
{
|
||||
++n;
|
||||
String line = sc.nextLine();
|
||||
if(rand.nextInt(n) == 0)
|
||||
result = line;
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
System.out.println("Missing botname.txt!");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
getProperties().setSpawnLocation(startLocation);
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@ import org.crandor.game.world.repository.Repository;
|
|||
public class GeneralBotCreator {
|
||||
|
||||
//org/crandor/net/packet/in/InteractionPacket.java <<< This is a very useful class for learning to code bots
|
||||
public GeneralBotCreator(String botName, Location loc, Script botScript)
|
||||
public GeneralBotCreator(Location loc, Script botScript)
|
||||
{
|
||||
botScript.bot = AIPBuilder.create(botName, loc);
|
||||
botScript.bot = AIPBuilder.create(loc);
|
||||
Repository.getPlayers().add(botScript.bot);
|
||||
botScript.init();
|
||||
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ public class PestControlTestBot extends PvMBots {
|
|||
GET_TO_PC
|
||||
}
|
||||
|
||||
public PestControlTestBot(String name, Location l) {
|
||||
super(name, legitimizeLocation(l));
|
||||
public PestControlTestBot(Location l) {
|
||||
super(legitimizeLocation(l));
|
||||
randomType = new Random().nextInt(100);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ public class DragonKiller extends PvMBots{
|
|||
|
||||
private int tick = 0;
|
||||
|
||||
public DragonKiller(String name, Location l) {
|
||||
super(name, l);
|
||||
public DragonKiller(Location l) {
|
||||
super(l);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ import org.crandor.game.world.map.Location;
|
|||
|
||||
public class GiantMoleBot extends PvMBots{
|
||||
|
||||
public GiantMoleBot(String name, Location l) {
|
||||
super(name, l);
|
||||
public GiantMoleBot(Location l) {
|
||||
super(l);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ import org.crandor.game.world.map.Location;
|
|||
|
||||
public class LowestBot extends PvMBots{
|
||||
|
||||
public LowestBot(String name, Location l) {
|
||||
super(name, l);
|
||||
public LowestBot(Location l) {
|
||||
super(l);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ public class NoobBot extends PvMBots{
|
|||
private int tick = 0;
|
||||
private int movetimer = 0;
|
||||
|
||||
public NoobBot(String name, Location l) {
|
||||
super(name, l);
|
||||
public NoobBot(Location l) {
|
||||
super(l);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ public class PvMBots extends AIPlayer {
|
|||
//Used so the bot doesn't spam actions
|
||||
private int tick = 0;
|
||||
|
||||
public PvMBots(String name, Location l) {
|
||||
super(name, l);
|
||||
public PvMBots(Location l) {
|
||||
super(l);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,34 +16,34 @@ import org.crandor.tools.RandomFunction;
|
|||
|
||||
public final class PvMBotsBuilder{
|
||||
|
||||
public static PestControlTestBot createPestControlTestBot(String name, Location l)
|
||||
public static PestControlTestBot createPestControlTestBot(Location l)
|
||||
{
|
||||
return new PestControlTestBot(name, l);
|
||||
return new PestControlTestBot(l);
|
||||
}
|
||||
|
||||
public static PvMBots create(String name, Location l)
|
||||
public static PvMBots create(Location l)
|
||||
{
|
||||
return new PvMBots(name, l);
|
||||
return new PvMBots(l);
|
||||
}
|
||||
|
||||
public static LowestBot createLowest(String name, Location l)
|
||||
public static LowestBot createLowest(Location l)
|
||||
{
|
||||
return new LowestBot(name, l);
|
||||
return new LowestBot(l);
|
||||
}
|
||||
|
||||
public static NoobBot createNoob(String name, Location l)
|
||||
public static NoobBot createNoob(Location l)
|
||||
{
|
||||
return new NoobBot(name, l);
|
||||
return new NoobBot(l);
|
||||
}
|
||||
|
||||
public static DragonKiller createDragonKiller(String name, Location l)
|
||||
public static DragonKiller createDragonKiller(Location l)
|
||||
{
|
||||
return new DragonKiller(name, l);
|
||||
return new DragonKiller(l);
|
||||
}
|
||||
|
||||
public static GiantMoleBot createGiantMoleBot(String name, Location l)
|
||||
public static GiantMoleBot createGiantMoleBot(Location l)
|
||||
{
|
||||
return new GiantMoleBot(name, l);
|
||||
return new GiantMoleBot(l);
|
||||
}
|
||||
|
||||
public static void generateGiantMoleBot(PvMBots p)
|
||||
|
|
@ -467,7 +467,7 @@ public final class PvMBotsBuilder{
|
|||
|
||||
public static void spawn(Location loc)
|
||||
{
|
||||
final PvMBots bot = PvMBotsBuilder.create("bottest", loc);
|
||||
final PvMBots bot = PvMBotsBuilder.create(loc);
|
||||
bot.getAppearance().setGender(RandomFunction.random(3) == 1 ? Gender.FEMALE : Gender.MALE);
|
||||
Repository.getPlayers().add(bot);
|
||||
bot.init();
|
||||
|
|
@ -475,7 +475,7 @@ public final class PvMBotsBuilder{
|
|||
|
||||
public static void spawnPestControlTestBot(Location loc)
|
||||
{
|
||||
final PestControlTestBot bot = PvMBotsBuilder.createPestControlTestBot("PestBot", loc);
|
||||
final PestControlTestBot bot = PvMBotsBuilder.createPestControlTestBot(loc);
|
||||
bot.getAppearance().setGender(RandomFunction.random(3) == 1 ? Gender.FEMALE : Gender.MALE);
|
||||
Repository.getPlayers().add(bot);
|
||||
bot.init();
|
||||
|
|
@ -485,7 +485,7 @@ public final class PvMBotsBuilder{
|
|||
|
||||
public static void spawnLowest(Location loc)
|
||||
{
|
||||
final LowestBot bot = PvMBotsBuilder.createLowest("bottest", loc);
|
||||
final LowestBot bot = PvMBotsBuilder.createLowest(loc);
|
||||
bot.getAppearance().setGender(RandomFunction.random(3) == 1 ? Gender.FEMALE : Gender.MALE);
|
||||
Repository.getPlayers().add(bot);
|
||||
bot.init();
|
||||
|
|
@ -495,7 +495,7 @@ public final class PvMBotsBuilder{
|
|||
|
||||
public static void spawnNoob(Location loc)
|
||||
{
|
||||
final NoobBot bot = PvMBotsBuilder.createNoob("bottest", loc);
|
||||
final NoobBot bot = PvMBotsBuilder.createNoob(loc);
|
||||
bot.getAppearance().setGender(RandomFunction.random(3) == 1 ? Gender.FEMALE : Gender.MALE);
|
||||
Repository.getPlayers().add(bot);
|
||||
bot.init();
|
||||
|
|
@ -505,7 +505,7 @@ public final class PvMBotsBuilder{
|
|||
|
||||
public static void spawnDragonKiller(Location loc)
|
||||
{
|
||||
final DragonKiller bot = PvMBotsBuilder.createDragonKiller("bottest", loc);
|
||||
final DragonKiller bot = PvMBotsBuilder.createDragonKiller(loc);
|
||||
bot.getAppearance().setGender(RandomFunction.random(3) == 1 ? Gender.FEMALE : Gender.MALE);
|
||||
Repository.getPlayers().add(bot);
|
||||
bot.init();
|
||||
|
|
@ -515,7 +515,7 @@ public final class PvMBotsBuilder{
|
|||
|
||||
public static void spawnGiantMoleBot(Location loc)
|
||||
{
|
||||
final GiantMoleBot bot = PvMBotsBuilder.createGiantMoleBot("bottest", new Location(0, 0));
|
||||
final GiantMoleBot bot = PvMBotsBuilder.createGiantMoleBot(new Location(0, 0));
|
||||
bot.teleport(loc);
|
||||
bot.getAppearance().setGender(RandomFunction.random(3) == 1 ? Gender.FEMALE : Gender.MALE);
|
||||
Repository.getPlayers().add(bot);
|
||||
|
|
|
|||
|
|
@ -19,17 +19,17 @@ public class SkillingBot extends AIPlayer{
|
|||
private int skill;
|
||||
private int interactionRange;
|
||||
|
||||
public SkillingBot(String name, Location l)
|
||||
public SkillingBot(Location l)
|
||||
{
|
||||
super(name, l);
|
||||
super(l);
|
||||
this.fromWhereDoIdrop = 0;
|
||||
this.interactionRange = 15;
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public SkillingBot(String name, Location l, int skill, ArrayList<Integer> entrys)
|
||||
public SkillingBot(Location l, int skill, ArrayList<Integer> entrys)
|
||||
{
|
||||
super(name, l);
|
||||
super(l);
|
||||
this.skill = skill;
|
||||
this.fromWhereDoIdrop = 0;
|
||||
this.interactNodeIds = entrys;
|
||||
|
|
@ -75,7 +75,7 @@ public class SkillingBot extends AIPlayer{
|
|||
}
|
||||
|
||||
if (node == null) {
|
||||
System.out.println("Object not found " + this.skill);
|
||||
System.out.println("SkillingBot.java: Object not found " + this.skill);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,14 +14,14 @@ import org.crandor.tools.RandomFunction;
|
|||
|
||||
public final class SkillingBotsBuilder extends AIPlayer {
|
||||
|
||||
public SkillingBotsBuilder(String name, Location l) {
|
||||
super(name, l);
|
||||
public SkillingBotsBuilder(Location l) {
|
||||
super(l);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
private static SkillingBot generateMiningBot(String name, Location loc, ArrayList<Integer> entrys)
|
||||
private static SkillingBot generateMiningBot(Location loc, ArrayList<Integer> entrys)
|
||||
{
|
||||
SkillingBot bot = new SkillingBot(name, loc, Skills.MINING, entrys);
|
||||
SkillingBot bot = new SkillingBot(loc, Skills.MINING, entrys);
|
||||
bot.getAppearance().setGender(RandomFunction.random(3) == 1 ? Gender.FEMALE : Gender.MALE);
|
||||
Repository.getPlayers().add(bot);
|
||||
bot.init();
|
||||
|
|
@ -29,9 +29,9 @@ public final class SkillingBotsBuilder extends AIPlayer {
|
|||
return bot;
|
||||
}
|
||||
|
||||
private static SkillingBot generateWoodcuttingBot(String name, Location loc, ArrayList<Integer> entrys)
|
||||
private static SkillingBot generateWoodcuttingBot(Location loc, ArrayList<Integer> entrys)
|
||||
{
|
||||
SkillingBot bot = new SkillingBot(name, loc, Skills.WOODCUTTING, entrys);
|
||||
SkillingBot bot = new SkillingBot(loc, Skills.WOODCUTTING, entrys);
|
||||
bot.getAppearance().setGender(RandomFunction.random(3) == 1 ? Gender.FEMALE : Gender.MALE);
|
||||
Repository.getPlayers().add(bot);
|
||||
bot.init();
|
||||
|
|
@ -39,9 +39,9 @@ public final class SkillingBotsBuilder extends AIPlayer {
|
|||
return bot;
|
||||
}
|
||||
|
||||
private static SkillingBot generateFishingBot(String name, Location loc, ArrayList<Integer> entrys)
|
||||
private static SkillingBot generateFishingBot(Location loc, ArrayList<Integer> entrys)
|
||||
{
|
||||
SkillingBot bot = new SkillingBot(name, loc, Skills.FISHING, entrys);
|
||||
SkillingBot bot = new SkillingBot(loc, Skills.FISHING, entrys);
|
||||
bot.getAppearance().setGender(RandomFunction.random(3) == 1 ? Gender.FEMALE : Gender.MALE);
|
||||
CharacterDesign.randomize(bot, false);
|
||||
Repository.getPlayers().add(bot);
|
||||
|
|
@ -49,109 +49,109 @@ public final class SkillingBotsBuilder extends AIPlayer {
|
|||
return bot;
|
||||
}
|
||||
|
||||
public static void spawnClayBotVarrock(String name, Location loc)
|
||||
public static void spawnClayBotVarrock(Location loc)
|
||||
{
|
||||
ArrayList<Integer> entrys = new ArrayList<Integer>();
|
||||
entrys.add(15503);
|
||||
entrys.add(15505);
|
||||
|
||||
SkillingBot bot = generateMiningBot(name, loc, entrys);
|
||||
SkillingBot bot = generateMiningBot(loc, entrys);
|
||||
|
||||
bot.getSkills().setLevel(Skills.MINING, 10);
|
||||
}
|
||||
|
||||
public static void spawnIronBotVarrock(String name, Location loc)
|
||||
public static void spawnIronBotVarrock(Location loc)
|
||||
{
|
||||
ArrayList<Integer> entrys = new ArrayList<Integer>();
|
||||
entrys.add(11954);
|
||||
entrys.add(11955);
|
||||
entrys.add(11956);
|
||||
|
||||
SkillingBot bot = generateMiningBot(name, loc, entrys);
|
||||
SkillingBot bot = generateMiningBot(loc, entrys);
|
||||
|
||||
bot.getSkills().setLevel(Skills.MINING, 25);
|
||||
}
|
||||
|
||||
public static void spawnSilverBotVarrock(String name, Location loc)
|
||||
public static void spawnSilverBotVarrock(Location loc)
|
||||
{
|
||||
ArrayList<Integer> entrys = new ArrayList<Integer>();
|
||||
entrys.add(11948);
|
||||
entrys.add(11949);
|
||||
entrys.add(11950);
|
||||
|
||||
SkillingBot bot = generateMiningBot(name, loc, entrys);
|
||||
SkillingBot bot = generateMiningBot(loc, entrys);
|
||||
|
||||
bot.getSkills().setLevel(Skills.MINING, 30);
|
||||
}
|
||||
|
||||
public static void spawnTinBotVarrock(String name, Location loc)
|
||||
public static void spawnTinBotVarrock(Location loc)
|
||||
{
|
||||
ArrayList<Integer> entrys = new ArrayList<Integer>();
|
||||
entrys.add(11957);
|
||||
entrys.add(11959);
|
||||
entrys.add(11958);
|
||||
|
||||
SkillingBot bot = generateMiningBot(name, loc, entrys);
|
||||
SkillingBot bot = generateMiningBot(loc, entrys);
|
||||
|
||||
bot.getSkills().setLevel(Skills.MINING, 5);
|
||||
}
|
||||
|
||||
public static void spawnTinBotLumbridge(String name, Location loc)
|
||||
public static void spawnTinBotLumbridge(Location loc)
|
||||
{
|
||||
ArrayList<Integer> entrys = new ArrayList<Integer>();
|
||||
entrys.add(11933);
|
||||
entrys.add(11934);
|
||||
entrys.add(11935);
|
||||
|
||||
SkillingBot bot = generateMiningBot(name, loc, entrys);
|
||||
SkillingBot bot = generateMiningBot(loc, entrys);
|
||||
|
||||
bot.getSkills().setLevel(Skills.MINING, 5);
|
||||
}
|
||||
|
||||
public static void spawnCopperBotLumbridge(String name, Location loc)
|
||||
public static void spawnCopperBotLumbridge(Location loc)
|
||||
{
|
||||
ArrayList<Integer> entrys = new ArrayList<Integer>();
|
||||
entrys.add(11936);
|
||||
entrys.add(11937);
|
||||
entrys.add(11938);
|
||||
|
||||
SkillingBot bot = generateMiningBot(name, loc, entrys);
|
||||
SkillingBot bot = generateMiningBot(loc, entrys);
|
||||
|
||||
bot.getSkills().setLevel(Skills.MINING, 5);
|
||||
}
|
||||
|
||||
public static void spawnOakTreeBotLumbridge(String name, Location loc)
|
||||
public static void spawnOakTreeBotLumbridge(Location loc)
|
||||
{
|
||||
ArrayList<Integer> entrys = new ArrayList<Integer>();
|
||||
entrys.add(1281);
|
||||
entrys.add(1278);
|
||||
entrys.add(1276);
|
||||
|
||||
SkillingBot bot = generateWoodcuttingBot(name, loc, entrys);
|
||||
SkillingBot bot = generateWoodcuttingBot(loc, entrys);
|
||||
|
||||
bot.getSkills().setLevel(Skills.WOODCUTTING, 25);
|
||||
bot.setInteractionRange(25);
|
||||
}
|
||||
|
||||
public static void spawnDeadTreeBotLumbridge(String name, Location loc)
|
||||
public static void spawnDeadTreeBotLumbridge(Location loc)
|
||||
{
|
||||
ArrayList<Integer> entrys = new ArrayList<Integer>();
|
||||
entrys.add(1282);
|
||||
entrys.add(1286);
|
||||
|
||||
SkillingBot bot = generateWoodcuttingBot(name, loc, entrys);
|
||||
SkillingBot bot = generateWoodcuttingBot(loc, entrys);
|
||||
|
||||
bot.getSkills().setLevel(Skills.WOODCUTTING, 25);
|
||||
bot.setInteractionRange(15);
|
||||
}
|
||||
|
||||
public static void spawnShrimpFisherLumbridge(String name, Location loc)
|
||||
public static void spawnShrimpFisherLumbridge(Location loc)
|
||||
{
|
||||
ArrayList<Integer> entrys = new ArrayList<Integer>();
|
||||
entrys.add(323);
|
||||
entrys.add(326);
|
||||
|
||||
SkillingBot bot = generateFishingBot(name, loc, entrys);
|
||||
SkillingBot bot = generateFishingBot(loc, entrys);
|
||||
|
||||
bot.getInventory().add(new Item(303));
|
||||
// don't drop net
|
||||
|
|
@ -161,12 +161,12 @@ public final class SkillingBotsBuilder extends AIPlayer {
|
|||
bot.setInteractionRange(25);
|
||||
}
|
||||
|
||||
public static void spawnTroutLumbridge(String name, Location loc)
|
||||
public static void spawnTroutLumbridge(Location loc)
|
||||
{
|
||||
ArrayList<Integer> entrys = new ArrayList<Integer>();
|
||||
entrys.add(310);
|
||||
|
||||
SkillingBot bot = generateFishingBot(name, loc, entrys);
|
||||
SkillingBot bot = generateFishingBot(loc, entrys);
|
||||
|
||||
bot.getInventory().add(new Item(309));
|
||||
bot.getInventory().add(new Item(314, 20000));
|
||||
|
|
@ -180,30 +180,30 @@ public final class SkillingBotsBuilder extends AIPlayer {
|
|||
public static void immersiveSpawnsSkillingBots()
|
||||
{
|
||||
// Varrock Mine
|
||||
SkillingBotsBuilder.spawnClayBotVarrock("clay", new Location(3181, 3368));
|
||||
SkillingBotsBuilder.spawnSilverBotVarrock("silver", new Location(3181, 3368));
|
||||
SkillingBotsBuilder.spawnIronBotVarrock("iron", new Location(3181, 3368));
|
||||
SkillingBotsBuilder.spawnTinBotVarrock("tin", new Location(3181, 3368));
|
||||
SkillingBotsBuilder.spawnClayBotVarrock(new Location(3181, 3368));
|
||||
SkillingBotsBuilder.spawnSilverBotVarrock(new Location(3181, 3368));
|
||||
SkillingBotsBuilder.spawnIronBotVarrock(new Location(3181, 3368));
|
||||
SkillingBotsBuilder.spawnTinBotVarrock(new Location(3181, 3368));
|
||||
|
||||
// Lumbridge woodcutting
|
||||
spawnOakTreeBotLumbridge("Bot", new Location(3227, 3243));
|
||||
spawnOakTreeBotLumbridge("Bot", new Location(3186, 3251));
|
||||
spawnOakTreeBotLumbridge("Bot", new Location(3188, 3223));
|
||||
spawnOakTreeBotLumbridge("Bot", new Location(3162, 3222));
|
||||
spawnOakTreeBotLumbridge("Bot", new Location(3162, 3219));
|
||||
spawnOakTreeBotLumbridge("Bot", new Location(3152, 3228));
|
||||
spawnOakTreeBotLumbridge("Bot", new Location(3146, 3244));
|
||||
spawnDeadTreeBotLumbridge("Bot", new Location(3247, 3240));
|
||||
spawnOakTreeBotLumbridge(new Location(3227, 3243));
|
||||
spawnOakTreeBotLumbridge(new Location(3186, 3251));
|
||||
spawnOakTreeBotLumbridge(new Location(3188, 3223));
|
||||
spawnOakTreeBotLumbridge(new Location(3162, 3222));
|
||||
spawnOakTreeBotLumbridge(new Location(3162, 3219));
|
||||
spawnOakTreeBotLumbridge(new Location(3152, 3228));
|
||||
spawnOakTreeBotLumbridge(new Location(3146, 3244));
|
||||
spawnDeadTreeBotLumbridge(new Location(3247, 3240));
|
||||
|
||||
// Lumbridge mining
|
||||
spawnTinBotLumbridge("Bot", new Location(3224, 3147));
|
||||
spawnCopperBotLumbridge("Bot", new Location(3224, 3147));
|
||||
spawnTinBotLumbridge(new Location(3224, 3147));
|
||||
spawnCopperBotLumbridge(new Location(3224, 3147));
|
||||
|
||||
// Lumbridge Fishing
|
||||
spawnShrimpFisherLumbridge("Bot", new Location(3242, 3151));
|
||||
spawnShrimpFisherLumbridge("Bot", new Location(3238, 3148));
|
||||
spawnShrimpFisherLumbridge("Bot", new Location(3245, 3161));
|
||||
spawnTroutLumbridge("Bot", new Location(3241, 3242));
|
||||
spawnShrimpFisherLumbridge(new Location(3242, 3151));
|
||||
spawnShrimpFisherLumbridge(new Location(3238, 3148));
|
||||
spawnShrimpFisherLumbridge(new Location(3245, 3161));
|
||||
spawnTroutLumbridge(new Location(3241, 3242));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ import org.crandor.tools.RandomFunction;
|
|||
|
||||
public final class PvPBotsBuilder{
|
||||
|
||||
public static WildernessBot create(String name, Location l)
|
||||
public static WildernessBot create(Location l)
|
||||
{
|
||||
return new WildernessBot(name, l);
|
||||
return new WildernessBot(l);
|
||||
}
|
||||
|
||||
public static void generateClass(WildernessBot p) {
|
||||
|
|
@ -515,7 +515,7 @@ public final class PvPBotsBuilder{
|
|||
|
||||
public static void spawn(Location loc)
|
||||
{
|
||||
final WildernessBot bot = PvPBotsBuilder.create("bottest", new Location(0, 0));
|
||||
final WildernessBot bot = PvPBotsBuilder.create(new Location(0, 0));
|
||||
bot.teleport(loc);
|
||||
bot.getAppearance().setGender(RandomFunction.random(3) == 1 ? Gender.FEMALE : Gender.MALE);
|
||||
Repository.getPlayers().add(bot);
|
||||
|
|
|
|||
|
|
@ -21,16 +21,16 @@ import org.crandor.tools.RandomFunction;
|
|||
|
||||
public class WildernessBot extends AIPlayer {
|
||||
|
||||
public WildernessBot(String name, Location l) {
|
||||
super(name, l);
|
||||
public WildernessBot(Location l) {
|
||||
super(l);
|
||||
this.specWeapon = 1215;
|
||||
this.normalWeapon = 4151;
|
||||
this.getInventory().add(new Item(specWeapon));
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public WildernessBot(String name, Location l, int normalWeaponId, int specWeaponId) {
|
||||
super(name, l);
|
||||
public WildernessBot(Location l, int normalWeaponId, int specWeaponId) {
|
||||
super(l);
|
||||
this.specWeapon = specWeaponId;
|
||||
this.normalWeapon = normalWeaponId;
|
||||
this.getInventory().add(new Item(specWeaponId));
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ public final class MusicPlayer implements SavingModule {
|
|||
public void unlock(int id, boolean play) {
|
||||
MusicEntry entry = MusicEntry.forId(id);
|
||||
if (entry == null) {
|
||||
System.out.println("Could not find entry for id " + id + "!");
|
||||
System.out.println("Could not find music entry for id " + id + "!");
|
||||
return;
|
||||
}
|
||||
if (!unlocked.containsKey(entry.getIndex())) {
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public final class ScriptCompiler {
|
|||
try {
|
||||
GameWorld.prompt(false);
|
||||
ScriptContext context = parseRaw(new File("./scripts/dialogue/test.asc"));
|
||||
AIPlayer player = AIPBuilder.create("roar", null);
|
||||
AIPlayer player = AIPBuilder.create(null);
|
||||
context.execute(player);
|
||||
ScriptManager.run(context, player);
|
||||
} catch (Throwable e) {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public final class PluginTest {
|
|||
|
||||
public static void main(String[] args) throws Throwable {
|
||||
GameWorld.prompt(false);
|
||||
Player player = AIPBuilder.create("testharhar", Location.create(3222, 3217, 0));
|
||||
Player player = AIPBuilder.create(Location.create(3222, 3217, 0));
|
||||
player.init();
|
||||
int objectCount = 0;
|
||||
int npcCount = 0;
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ public final class AIPCommandPlugin extends CommandPlugin {
|
|||
return true;
|
||||
case "aip":
|
||||
name = args.length < 2 ? player.getName() : args[1];
|
||||
AIPlayer p = AIPBuilder.copy(player, name, player.getLocation().transform(0, 1, 0));
|
||||
AIPlayer p = AIPBuilder.copy(player, player.getLocation().transform(0, 1, 0));
|
||||
Repository.getPlayers().add(p);
|
||||
p.init();
|
||||
|
||||
|
|
@ -145,8 +145,7 @@ public final class AIPCommandPlugin extends CommandPlugin {
|
|||
player.setAttribute("aip_legion", PVPAIPActions.pvp_players = new ArrayList<>());
|
||||
}
|
||||
for (int i = 0; i < size; i++) {
|
||||
String aipName = PVPAIPBuilderUtils.names[i];
|
||||
final AIPlayer aip = AIPBuilder.create(aipName, generateLocation(player));
|
||||
final AIPlayer aip = AIPBuilder.create( generateLocation(player));
|
||||
aip.setControler(player);
|
||||
aip.getAppearance().setGender(RandomFunction.random(3) == 1 ? Gender.FEMALE : Gender.MALE);
|
||||
Repository.getPlayers().add(aip);
|
||||
|
|
@ -168,8 +167,7 @@ public final class AIPCommandPlugin extends CommandPlugin {
|
|||
player.setAttribute("aip_legion", ResourceAIPActions.resource_players = new ArrayList<>());
|
||||
}
|
||||
for (int i = 0; i < size; i++) {
|
||||
String aipName = PVPAIPBuilderUtils.names[i];
|
||||
final AIPlayer aip = AIPBuilder.create(aipName, generateLocation(player));
|
||||
final AIPlayer aip = AIPBuilder.create(generateLocation(player));
|
||||
aip.setControler(player);
|
||||
aip.getAppearance().setGender(RandomFunction.random(3) == 1 ? Gender.FEMALE : Gender.MALE);
|
||||
Repository.getPlayers().add(aip);
|
||||
|
|
@ -180,7 +178,6 @@ public final class AIPCommandPlugin extends CommandPlugin {
|
|||
aip.setAttribute("aip_legion", ResourceAIPActions.resource_players);
|
||||
}
|
||||
ResourceAIPActions.resource_players.add(aip);
|
||||
last = aip;
|
||||
}
|
||||
return true;
|
||||
case "syncresource":
|
||||
|
|
@ -221,13 +218,13 @@ public final class AIPCommandPlugin extends CommandPlugin {
|
|||
ResourceAIPManager.get().immerseWorld();
|
||||
return true;
|
||||
case "fishtest":
|
||||
SkillingBotsBuilder.spawnTroutLumbridge("Bot", new Location(3241, 3242));
|
||||
SkillingBotsBuilder.spawnTroutLumbridge(new Location(3241, 3242));
|
||||
return true;
|
||||
case "varrockminebots":
|
||||
SkillingBotsBuilder.spawnClayBotVarrock("clay", new Location(3181, 3368));
|
||||
SkillingBotsBuilder.spawnSilverBotVarrock("silver", new Location(3181, 3368));
|
||||
SkillingBotsBuilder.spawnIronBotVarrock("iron", new Location(3181, 3368));
|
||||
SkillingBotsBuilder.spawnTinBotVarrock("tin", new Location(3181, 3368));
|
||||
SkillingBotsBuilder.spawnClayBotVarrock(new Location(3181, 3368));
|
||||
SkillingBotsBuilder.spawnSilverBotVarrock(new Location(3181, 3368));
|
||||
SkillingBotsBuilder.spawnIronBotVarrock(new Location(3181, 3368));
|
||||
SkillingBotsBuilder.spawnTinBotVarrock(new Location(3181, 3368));
|
||||
return true;
|
||||
case "pvpbot":
|
||||
PvPBotsBuilder.spawn(player.getLocation());
|
||||
|
|
@ -252,6 +249,7 @@ public final class AIPCommandPlugin extends CommandPlugin {
|
|||
case "pest-test":
|
||||
case "test-pest":
|
||||
case "pesttest":
|
||||
player.sendMessage("Spawning some bots I think");
|
||||
int arg2;
|
||||
try {
|
||||
arg2 = Integer.parseInt(args[1]);
|
||||
|
|
@ -283,10 +281,10 @@ public final class AIPCommandPlugin extends CommandPlugin {
|
|||
Start regular bots
|
||||
*/
|
||||
case "manthiev":
|
||||
new GeneralBotCreator("Bot", player.getLocation(), new ManThiever());
|
||||
new GeneralBotCreator(player.getLocation(), new ManThiever());
|
||||
break;
|
||||
case "fish":
|
||||
new GeneralBotCreator("Fisher", Location.create(2805, 3435, 0), new LobsterCatcher());
|
||||
new GeneralBotCreator(Location.create(2805, 3435, 0), new LobsterCatcher());
|
||||
break;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue