[ECON/MISC] SimpleATM v2.4 - ATM signs for all major economy plugins. [Permissions] [1185]

Discussion in 'Inactive/Unsupported Plugins' started by runesmacher, Aug 13, 2011.

  1. Offline

    chernobyl360

    @Juze
    @EvilSeph
    @ChrizC
    @Plague

    Balatant copy of @ChrizC's Atm Plugin. this plugin is split down more. to make it simple....

    the dead give away was his OP



    LOOK AT @ChrizC'S POST!!!!!

    SimpleATM BlockLIstener...


    Code:
    package Runesmacher.SimpleATM;
    
    import com.nijiko.permissions.PermissionHandler;
    import org.bukkit.ChatColor;
    import org.bukkit.entity.Player;
    import org.bukkit.event.block.BlockListener;
    import org.bukkit.event.block.SignChangeEvent;
    
    public class SimpleATMBlockListener extends BlockListener
    {
      private final SimpleATM plugin;
      Player player;
      int isActive;
    
      public SimpleATMBlockListener(SimpleATM instance)
      {
        this.plugin = instance;
      }
    
      public void onSignChange(SignChangeEvent event)
      {
        this.player = event.getPlayer();
        if (event.getLine(1).equals("[ATM]"))
          if ((SimpleATM.permissionHandler != null) && (SimpleATM.permissionHandler.has(this.player, "SimpleATM.place"))) {
            event.setLine(1, ChatColor.GOLD + "[ATM]");
            this.player.sendMessage(ChatColor.GREEN + "ATM created");
          } else if (SimpleATM.permissionHandler == null) {
            event.setLine(1, ChatColor.GOLD + "[ATM]");
            this.player.sendMessage(ChatColor.GREEN + "ATM created");
          } else {
            this.player.sendMessage(ChatColor.RED + "You do not have permission to make an ATM.");
            event.setLine(0, "");
            event.setLine(1, "");
            event.setLine(2, "");
            event.setLine(3, "");
          }
      }
    }
    @ChrizC Block Listener.


    Code:
    package me.ChrizC.ATM;
    
    import org.bukkit.event.block.BlockListener;
    import org.bukkit.event.block.SignChangeEvent;
    import org.bukkit.entity.Player;
    import org.bukkit.ChatColor;
    
    public class ATMBlockListener extends BlockListener {
        private final ATM plugin;
        Player player;
        int isActive;
    
        public ATMBlockListener(ATM instance) {
            plugin = instance;
        }
    
        @Override
        public void onSignChange (SignChangeEvent event) {
            player = event.getPlayer();
            if (plugin.Method.hasBanks() == true) {
                if (event.getLine(0).equals("[ATM]")) {
                    if (event.getLine(1).equals("Personal")) {
                        if (event.getLine(2).length() > 0) {
                            if (plugin.Method.hasBankAccount(event.getLine(2), player.getName()) == true) {
                                if (plugin.permissionHandler != null && plugin.permissionHandler.has(player, "atm.place.Personal")) {
                                    event.setLine(3, ChatColor.AQUA + "[Active]");
                                    event.setLine(1, player.getName());
                                } else if (plugin.permissionHandler == null) {
                                    event.setLine(3, ChatColor.AQUA + "[Active]");
                                    event.setLine(1, player.getName());
                                }
                            }
                        }
                    } else if (event.getLine(1).equals("Global")) {
                        if (event.getLine(2).length() > 0) {
                            if (plugin.permissionHandler != null && plugin.permissionHandler.has(player, "atm.place.Global")) {
                                if (plugin.Method.hasBank(event.getLine(2))) {
                                    event.setLine(3, ChatColor.YELLOW + "[Active]");
                                } else if (event.getLine(2).equals("[Private]")) {
                                    event.setLine(3, ChatColor.YELLOW + "[Active]");
                                }
                            } else if (player.isOp() == true) {
                                if (plugin.Method.hasBank(event.getLine(2))) {
                                    event.setLine(3, ChatColor.YELLOW + "[Active]");
                                }
                            }
                        }
                    } else if (event.getLine(1).equals("Private")) {
                        if (plugin.permissionHandler != null && plugin.permissionHandler.has(player, "atm.place.Private")) {
                            if (plugin.Method.hasAccount(player.getName())) {
                                event.setLine(2, player.getName());
                                event.setLine(3, ChatColor.LIGHT_PURPLE + "[Active]");
                            }
                        } else if (plugin.permissionHandler == null) {
                            if (plugin.Method.hasAccount(player.getName())) {
                                event.setLine(2, player.getName());
                                event.setLine(3, ChatColor.LIGHT_PURPLE + "[Active]");
                            }
                        }
                    } else if (event.getLine(1).startsWith("Withdraw")) {
                        if (event.getLine(1).matches("^[A-Za-z0-9]+:[0-9]+$")) {
                            if (plugin.permissionHandler != null && plugin.permissionHandler.has(player, "atm.place.Withdraw")) {
                                if (plugin.Method.hasBank(event.getLine(2))) {
                                    event.setLine(3, ChatColor.GREEN + "[Active]");
                                }
                            } else if (plugin.permissionHandler == null) {
                                if (plugin.Method.hasBank(event.getLine(2))) {
                                    event.setLine(3, ChatColor.GREEN + "[Active]");
                                }
                            }
                        }
                    } else if (event.getLine(1).startsWith("Deposit")) {
                        if (event.getLine(1).matches("^[A-Za-z0-9]+:[0-9]+$")) {
                            if (plugin.permissionHandler != null && plugin.permissionHandler.has(player, "atm.place.Deposit")) {
                                if (plugin.Method.hasBank(event.getLine(2))) {
                                    event.setLine(3, ChatColor.GREEN + "[Active]");
                                }
                            } else if (plugin.permissionHandler == null) {
                                if (plugin.Method.hasBank(event.getLine(2))) {
                                    event.setLine(3, ChatColor.GREEN + "[Active]");
                                }
                            }
                        }
                    } else if (event.getLine(1).equals("Transfer")) {
                        if (plugin.permissionHandler != null && plugin.permissionHandler.has(player, "atm.place.Transfer")) {
                            if (event.getLine(2).matches("^[A-Za-z0-9]+:[0-9]+$")) {
                                String[] string = event.getLine(2).split(":");
                                if (plugin.Method.hasAccount(string[0])) {
                                    event.setLine(3, ChatColor.WHITE + "[Active]");
                                }
                            }
                        } else if (plugin.permissionHandler == null) {
                            if (event.getLine(2).matches("^[A-Za-z0-9]+:[0-9]+$")) {
                                String[] string = event.getLine(2).split(":");
                                if (plugin.Method.hasAccount(string[0])) {
                                    event.setLine(3, ChatColor.WHITE + "[Active]");
                                }
                            }
                        }
                    } else if (event.getLine(1).equals("BankTransfer")) {
                        if (plugin.permissionHandler != null && plugin.permissionHandler.has(player, "atm.place.BankTransfer")) {
                            if (event.getLine(3).matches("[0-9]*") && event.getLine(2).matches("^[A-Za-z0-9]+:[A-Za-z0-9]+$")) {
                                String[] string = event.getLine(2).split(":");
                                if (plugin.Method.hasBankAccount(string[1], string[0])) {
                                    System.out.println("yo");
                                    event.setLine(1, event.getLine(2));
                                    event.setLine(2, event.getLine(3));
                                    event.setLine(3, ChatColor.WHITE + "[Active]");
                                }
                            }
                        } else if (plugin.permissionHandler == null) {
                            if (event.getLine(3).matches("[0-9]*") && event.getLine(2).matches("^[A-Za-z0-9]+:[A-Za-z0-9]+$")) {
                                String[] string = event.getLine(2).split(":");
                                if (plugin.Method.hasBankAccount(string[1], string[0])) {
    
                                    event.setLine(1, event.getLine(2));
                                    event.setLine(2, event.getLine(3));
                                    event.setLine(3, ChatColor.WHITE + "[Active]");
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    
    @RightLegRed
    take a look at this please.....

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  2. Offline

    Tauryuu

    I'm sure this plugin did take some code snippets from other plugins, but it functions differently than ChrizC's ATM plugin.

    Can you add support for different items and possibly change the Permissions support to PermissionsBukkit?
     
  3. Offline

    ChrizC

    @chernobyl360 And there I had my hopes up that somebody had stolen one of my plugins!

    No, this in entirely different to my plugin:
    1) This plugin only supports iConomy.
    2) This plugin withdraws/disposits to/from your in-hand money to/from gold bars.
    3) The coding style is totally different.

    The OP is extremely similar to mine, but there's no law against that. In fact, I highly encourage it!
     
  4. Offline

    Plague

    Well there is the source code checking "ATM" ;) But yeah that just looks like a code snippet.
     
  5. Offline

    codename_B

    Code snippets == fine;

    Good to see someone using released source code the proper way :) good job @runesmacher - I hope to see many more plugins from you in future.
     
  6. First of all,

    This is my first plugin i created.
    I saw the plugin on a server but i could'nt find it so i made it myself.
    and yes, i have used @ChrizC ATM plugin as a startpoint to get me going.
    and i used his post as a template to make mine.
    (i'll ad an link to the original ATM plugin if that makes everybody feel better :p)
    i've never programed any plugins so i was looking to a simular plugin to make this.

    @Tauryuu
    i''l see what i can do but how i said i made this plugin for my own server so i could use it and decided to publish it.
    i will look into support to other permission plugins and other items in a config file.

    it wsa just a plugin i started but i'll try to devlop it more so it is a growing plugin
     
  7. Offline

    chernobyl360

  8. Offline

    Tauryuu

    @runesmacher Thanks for releasing it in the first place, and congratulations on your Plugin Developer status!

    I am looking for something like this, but couldn't find one until now. I'm hoping for more customizability on the items being converted, item required to withdraw the currency, and possibly an item you get when you deposit.

    I was going to ask for the source, but I don't think you'd do that.

    @chernobyl360 Were you trying to get him banned?
     
  9. Offline

    chernobyl360

    no, i noticed it was yet another suspicious plugin. but see if i used code snippets all the mods would of banned my ass. they give the new guy the right away.
     
  10. Can you specify what you want exactly and what items (or do you just want em all?)?
    and what items you would think you would get when deposit and you need when wirthdraw?

    I would like to keep the source completely mine but if you realy want it i can share with you
     
  11. Offline

    Tauryuu

    My server's currency would be Sugar. I want players to only be able to obtain their Sugar with Paper through these ATM, and when players deposit Sugar, they receive a piece of Paper to exchange it back in the future.

    If you didn't get that, it would be like this;

    Player has 10 Sugar.
    Player goes to Bank.
    Player exchanges 10 Sugar to it's digital alternative (1:1 ratio) and receive 10 Paper.
    ---Later that day---
    Player has 10 Paper, and 10 Digital Sugar (iConomy) money.
    Player goes to Bank.
    Player exchanges 10 Paper and receives 10 Sugar. His Digital Sugar is reduced by 10 (The Sugar he took out).
     
  12. Offline

    aperture mines

    NOOOOOO maczy why did u make it go public :(
     
  13. maczy?
     
  14. Offline

    chernobyl360

  15. possibly, but i'm sure i'm not that guy :p.
    i created this plugin myself
     
  16. Offline

    aperture mines

    hmm ok. well i got this plugin from maczydeco who says it was his. this was about a month ago.
     
  17. strange, i created this plugin like 2 days ago
     
  18. Offline

    aperture mines

    say mmhmmm so it just so happens to be the exact same thing as the one i have which was running perfectly with the same exact way of working as the one that i got from maczy a month ago??

    i would gladly email u a copy of the plugin to prove it, except i highly doubt that this is a different plugin. it's most likely identical and maczy just gave it to you

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  19. look I've never heard of maczy and created this plugin becous i saw it on a server, but it was never released.
    so i decide to make it myself. so i do believe that there is a plugin like mine made by another guy but this one is programmed by me personally for friends server.
     
  20. Offline

    chernobyl360

    @maczydeco do you know what there talking about?
     
  21. Minecraftworlds,
    i made this plugin after seeying it on the minecraftworlds server and decide to remake it so i could use it.
    since you guys didn't want to give it to me for my friend
     
  22. Offline

    Tauryuu

    @runesmacher Is my request a bit too hard to do? I could try to modify it, and give you my changes.
     
  23. No, i'm looking into it right now. but i think that it would possebly be an AdvancedATM cous i want to keep this one just simple.
    you need one with a config file and that is'nt the simple 1jar plugin anymore :p but i'll make it for you
     
    Tauryuu likes this.
  24. Offline

    Tauryuu

    Thank you so much! :D
     
  25. Offline

    maczydeco

    I made a plugin with the same name and features for the minecraftworlds server some time ago, and sent it to anyone who asked me, but hadn't released it yet due to a bug with inventory updates.
    I've looked at the code and it's laid out differently, and has some different features: this one uses Permissions, and mine logs transactions into BigBrother, I don't really see any problem here.
     
  26. Well i saw the plugin there and wanted to have it on a friends server, I asked Last_Exile but he said it wasn't released to public and i couldn't have it.
    So i decided to recreate it for my friends server and for public appear

    So i putted both developers in the credits for those who realy think that's necesary.
    also added the sugar editon for @Tauryuu Hope you like it.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  27. Offline

    Tauryuu

    Awesome! I'm pretty sure no one else would want Sugar as their currency, :p...
     
  28. yeah i made it for you only i gues :p but i will expand that one to accept multiple items
     
  29. Offline

    Tauryuu

    I found a glitch, people can't build if the plugin is installed. They can break though. It might be just the Sugar edition though.
     

Share This Page