Thread: Auto Donation Command

Results 1 to 5 of 5
  1. #1 Auto Donation Command 
    Registered Member
    Join Date
    May 2012
    Posts
    518
    Thanks given
    43
    Thanks received
    13
    Rep Power
    14
    Here is my current auto donation command:

    Code:
    if (playerCommand.equalsIgnoreCase("redeem")) {
    			if (System.currentTimeMillis() - c.lastButton < 10000) {
    
    			c.lastButton = System.currentTimeMillis();
    			c.sendMessage("You need to wait 30 seconds to do that agian.");
    			return;
    
    			} else {
    
    			c.lastButton = System.currentTimeMillis();
    			c.Donations();
    
    			}
    	   }
    Code:
    public void Donations() {
    		 MadTurnipConnection.addDonateItems(this,playerName );
    		 }

    Can someone edit it so that it thanks the person for donating, and if they didn't donate, it says "You have nothing to redeem"
    OFFERING GOOD SERVICES!
    http://www.rune-server.org/market/vi...aces-more.html
    Spoiler for My Vouches:
    Quote Originally Posted by Collin2234 View Post
    Vouch! He did my webclient, great work and a nice guy! Thanks.
    Quote Originally Posted by Clevv View Post
    Vouch for this guy. He went first. Well trusted and a nice guy.
    Quote Originally Posted by x25xquinton View Post
    VOUCH- He basically made my summoning interface for me, summoning tab witchever. Payed and went smooth.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Feb 2013
    Posts
    67
    Thanks given
    2
    Thanks received
    1
    Rep Power
    20
    if (playerCommand.equalsIgnoreCase("redeem")) {
    if (System.currentTimeMillis() - c.lastButton < 10000) {

    c.lastButton = System.currentTimeMillis();
    c.sendMessage("Thank you for donating .");
    return;

    } else {

    c.lastButton = System.currentTimeMillis();
    c.Donations();

    }
    }
    Reply With Quote  
     

  3. #3  
    Boy Wonder


    Join Date
    Mar 2012
    Posts
    849
    Thanks given
    139
    Thanks received
    80
    Rep Power
    99
    you have to edit your addDonateItems method to return a boolean, where it actually adds the items and deletes the user from the donation database make it return true, otherwise make it return false then just make your void donations() method look like this.

    Code:
    public void Donations() 
    {
    	if(MadTurnipConnection.addDonateItems(this,playerName )){
    		c.sendMessage("Thank you for donating to "+Config.SERVER_NAME+"!";
    	} else {
    		c.sendMessage("You did not donate, please go back and donate to redeem stuff!");
    	}
    }

    Quote Originally Posted by xslayer View Post
    if (playerCommand.equalsIgnoreCase("redeem")) {
    if (System.currentTimeMillis() - c.lastButton < 10000) {

    c.lastButton = System.currentTimeMillis();
    c.sendMessage("Thank you for donating .");
    return;

    } else {

    c.lastButton = System.currentTimeMillis();
    c.Donations();

    }
    }
    That is wrong..
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Feb 2013
    Posts
    67
    Thanks given
    2
    Thanks received
    1
    Rep Power
    20
    no it's not. re read
    Reply With Quote  
     

  5. #5  
    Boy Wonder


    Join Date
    Mar 2012
    Posts
    849
    Thanks given
    139
    Thanks received
    80
    Rep Power
    99
    Quote Originally Posted by xslayer View Post
    no it's not. re read
    Uh yes it is. Learn how to code... all you did was replace the text saying not to click within 30 seconds with thank you for donating. even if that was the right way to do it which it isn't it would go on the ELSE block of code, not the IF. So, yes, it is wrong.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 11
    Last Post: 05-04-2014, 12:09 AM
  2. Auto donation Command Error
    By Derron in forum Help
    Replies: 3
    Last Post: 08-25-2013, 12:19 PM
  3. request for auto donate and vote command
    By H1N1 in forum Requests
    Replies: 1
    Last Post: 10-06-2011, 09:11 AM
  4. A Command to get Item Donated [Auto Donation]
    By Xynasty in forum Requests
    Replies: 0
    Last Post: 06-18-2011, 03:56 PM
  5. Replies: 0
    Last Post: 05-30-2011, 03:33 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •