Getting iConomy Balance?

Discussion in 'Plugin Development' started by WALK2222, May 31, 2013.

Thread Status:
Not open for further replies.
  1. Offline


    I am trying to extract requested user's iConomy balance. For some reason the code manages to run pretty far, but stops at a certain point.

    public static void getmoney(Player player, CommandSender sender, String target){
            // Location of file to read
            try {
                iconomyfile = new Scanner(new File("plugins/iConomy/"));
                System.out.println("Test 2");
            } catch (FileNotFoundException e) {
                System.out.println("iConomy most likely not installed!");
                String foundname =;
                String bal =;
                String status =;
                System.out.println("test 3");
                if(foundname == target){
                    bal =;
                    System.out.println("test 4");
                    System.out.println("Iconomy balance: "+bal);
                    sender.sendMessage(ChatColor.AQUA + "iConomy Balance: "+ ChatColor.GREEN + bal);
    (one of my methods..)

    I added some code to print to the console (to check where it ran to) and it managed to get to "test 3" before stopping. This must mean it is getting to found name, but isnt finding the specified name..

    The method is being called in the main class (on Command)

                Player player = Bukkit.getPlayer(sender.getName());
                if(args.length == 0){
                    //If no arguments were entered
                    player.sendMessage("Error: You must enter a username");
                    return false;
                }else if(args.length == 2){
                    if (args[0].equalsIgnoreCase("page-two")) {
                        //Get target player from variable
                        Player target = sender.getServer().getPlayer(args[1]);
                        if(target == null){
                            //If the player is offline
                            player.sendMessage("That person is NOT online!");
                            //If the player is online
                            //Start calling information methods for PAGE TWO
                            InformationRecieverTwo.getmoney(target, sender, label);
                        //If too many arguments were entered
                        player.sendMessage("Error:  You have entered incorrect parameters");
    Anyone have any idea on how I can fix this? Or even a more easier / efficient way to extract an iConomy balance?
  2. Offline


    Ultimate_n00b likes this.
  3. Offline


    Cool, thanks!
Thread Status:
Not open for further replies.

Share This Page