Thread: Martin's Auto Donation System

Page 3 of 32 FirstFirst 1234513 ... LastLast
Results 21 to 30 of 313
  1. #21  
    Registered Member
    Join Date
    Dec 2010
    Age
    29
    Posts
    1,186
    Thanks given
    513
    Thanks received
    340
    Rep Power
    35
    this is what happens when i click pay via paypal

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'donate'@'localhost' (using password: YES) in /home/dxmscape/public_html/db.php on line 3

    Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/dxmscape/public_html/db.php on line 4

    but it redirects me to checkout..

    if someone could help me i'll defently rep.
    idk why im getting this errro
    Reply With Quote  
     

  2. #22  
    Registered Member pkersworld's Avatar
    Join Date
    Mar 2011
    Age
    26
    Posts
    667
    Thanks given
    3
    Thanks received
    21
    Rep Power
    4
    so awesome , i made the tut 100% and when i want to run the server

    i get this

    Code:
    Loaded WorldMap In (124 ms)...
    pkers world online!
    com.mysql.jdbc.CommunicationsException: Communications link failure due to under
    lying exception:
    
    ** BEGIN NESTED EXCEPTION **
    
    java.net.ConnectException
    MESSAGE: Connection refused: connect
    
    STACKTRACE:
    
    java.net.ConnectException: Connection refused: connect
            at java.net.PlainSocketImpl.socketConnect(Native Method)
            at java.net.PlainSocketImpl.doConnect(Unknown Source)
            at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
            at java.net.PlainSocketImpl.connect(Unknown Source)
            at java.net.SocksSocketImpl.connect(Unknown Source)
            at java.net.Socket.connect(Unknown Source)
            at java.net.Socket.connect(Unknown Source)
            at java.net.Socket.<init>(Unknown Source)
            at java.net.Socket.<init>(Unknown Source)
            at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.ja
    va:173)
            at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:267)
            at com.mysql.jdbc.Connection.createNewIO(Connection.java:2739)
            at com.mysql.jdbc.Connection.<init>(Connection.java:1553)
            at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
    :266)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at MadTurnipConnection.createConnection(MadTurnipConnection.java:11)
            at MadTurnipConnection.run(MadTurnipConnection.java:28)
    
    
    ** END NESTED EXCEPTION **
    
    
    
    Last packet sent to the server was 24 ms ago.
            at com.mysql.jdbc.Connection.createNewIO(Connection.java:2814)
            at com.mysql.jdbc.Connection.<init>(Connection.java:1553)
            at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
    :266)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at MadTurnipConnection.createConnection(MadTurnipConnection.java:11)
            at MadTurnipConnection.run(MadTurnipConnection.java:28)

    and then i tried to add highscores and it gives me errors too

    i have mysql remote

    i have a paid host with domain

    pkersworld.com


    and here donate shit

    http://pkersworld.com/donate/donate.php


    so can anybody help me?
    -Removed
    Reply With Quote  
     

  3. #23  
    Donate to Rune-Server
    Donate's Avatar
    Join Date
    May 2010
    Posts
    419
    Thanks given
    69
    Thanks received
    19
    Rep Power
    19
    Quote Originally Posted by Polar Bear View Post
    Or you could fix it? Learn something man..
    I already fixed it about 5 minutes after I replied the last time.
    Just said, because if he could fix it his thread, so everyone doesn't need to fix it.

    Quote Originally Posted by pkersworld View Post
    so awesome , i made the tut 100% and when i want to run the server

    i get this

    Code:
    Loaded WorldMap In (124 ms)...
    pkers world online!
    com.mysql.jdbc.CommunicationsException: Communications link failure due to under
    lying exception:
    
    ** BEGIN NESTED EXCEPTION **
    
    java.net.ConnectException
    MESSAGE: Connection refused: connect
    
    STACKTRACE:
    
    java.net.ConnectException: Connection refused: connect
            at java.net.PlainSocketImpl.socketConnect(Native Method)
            at java.net.PlainSocketImpl.doConnect(Unknown Source)
            at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
            at java.net.PlainSocketImpl.connect(Unknown Source)
            at java.net.SocksSocketImpl.connect(Unknown Source)
            at java.net.Socket.connect(Unknown Source)
            at java.net.Socket.connect(Unknown Source)
            at java.net.Socket.<init>(Unknown Source)
            at java.net.Socket.<init>(Unknown Source)
            at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.ja
    va:173)
            at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:267)
            at com.mysql.jdbc.Connection.createNewIO(Connection.java:2739)
            at com.mysql.jdbc.Connection.<init>(Connection.java:1553)
            at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
    :266)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at MadTurnipConnection.createConnection(MadTurnipConnection.java:11)
            at MadTurnipConnection.run(MadTurnipConnection.java:28)
    
    
    ** END NESTED EXCEPTION **
    
    
    
    Last packet sent to the server was 24 ms ago.
            at com.mysql.jdbc.Connection.createNewIO(Connection.java:2814)
            at com.mysql.jdbc.Connection.<init>(Connection.java:1553)
            at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
    :266)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at MadTurnipConnection.createConnection(MadTurnipConnection.java:11)
            at MadTurnipConnection.run(MadTurnipConnection.java:28)

    and then i tried to add highscores and it gives me errors too

    i have mysql remote

    i have a paid host with domain

    pkersworld.com


    and here donate shit

    http://pkersworld.com/donate/donate.php


    so can anybody help me?
    I didn't get my vote system to work so that it connects to my webhost, dunno about you and this donate system.

    Have you got VPS? You need it. Put XAMPP to it, if there isn't MySQL and the stuff needed to this donate system.

    Never host XAMPP on your own computer with server unless you have at least 100Mb upload and download speed. Most VPSs have at least 100Mb upload and download speed, so I recommend you to get one if you haven't already.

    Good luck.
    Thanks,

    Donate.

    I mean.

    Donate,

    thanks.
    Reply With Quote  
     

  4. #24  
    Registered Member

    Join Date
    Sep 2007
    Age
    32
    Posts
    2,396
    Thanks given
    5
    Thanks received
    436
    Rep Power
    902
    Quote Originally Posted by vanweele View Post
    this is what happens when i click pay via paypal

    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'donate'@'localhost' (using password: YES) in /home/dxmscape/public_html/db.php on line 3

    Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/dxmscape/public_html/db.php on line 4

    but it redirects me to checkout..

    if someone could help me i'll defently rep.
    idk why im getting this errro
    you didnt enter the login details correctly to the database in db.php, redo first few steps.

    and then i tried to add highscores and it gives me errors too

    i have mysql remote

    i have a paid host with domain

    pkersworld.com


    and here donate shit

    http://pkersworld.com/donate/donate.php


    so can anybody help me?
    open a support ticket with your webhost about remote mysql some require more. I've done so in the past and theyve told me the have extra firewalls that I cant even access for mysql so always ask if theres a problem!
    Hyperion V2 Martin's Updates.

    Scar says:
    i hate it when it hits your face
    Reply With Quote  
     

  5. #25  
    Registered Member
    Join Date
    Jul 2008
    Posts
    3,163
    Thanks given
    235
    Thanks received
    74
    Rep Power
    209
    Hey martin can u convert it for shard please?
    i will give u a little donation if i get it working
    nice relase!
    Reply With Quote  
     

  6. #26  
    q.q


    Join Date
    Dec 2010
    Posts
    6,519
    Thanks given
    1,072
    Thanks received
    3,535
    Rep Power
    4752
    Spoiler for Incase of deletey:
    Quote Originally Posted by Martin View Post
    Well i've had this too long, and its being sold left right and centre which is a bit unfair considering pretty much everyone has it. SO lets get going! (PS this has the dupe fixes)

    If you wish to send me some money feel free to at [email protected], all money I receive usually goes towards beer so its a great investment from your point of view, once you do that I usally come on drunk and send me my shit code, so its usually well worth it.

    Credits:
    Me
    Graham (For the default paypal ipn file)(Could never find the download)
    Sabsabionline (For leeching / selling it to yall without the dupe fixes )

    Few things to keep in mind, I wrote this a long time ago it was one of my first html / php scripts so its kinda shit , If you want my new and improved one visit this thread:

    Few things before you start, IF YOU USE A FREE WEBHOST THEY USUALLY DO NOT SUPPORT REMOTE MYSQL SO OPEN A SUPPORT TICKET BEFORE YOU COMPLAIN HERE.

    Website Side:

    OK there's a few php files to upload but lets start first. In this tutorial I'm going to use CPanel, its the biggest in web management so it should work for all of you.

    OK so login to your cpanel on your webhost, and go into "MySQL databases"
    In here we will create a new database.

    Look for the heading "Create New Database", below here type in your database name, usually something to do with donate, so type in donate and click "Create Database", Once done, click the "go back" button, and you should be back on the previous screen.

    Now scroll down to "MySQL Users", in here we will add a new mysql user (NOTE SOME PHP VERSIONS DON'T SUPPORT RANDOMLY GENERATED PASSWORDS, (i.e some symbols), So i recommend you set it yourself.

    Then click create user. And write down the username and password (preferably in real life in some kind of notepad as that cant usually be stolen + your friends are prob tards, so they wont have a clue what its for).The scroll down to "Add User To Database" here select your username, and add it to the database you created earlier. The next screen will ask about permissions, just tick all the boxes and click "OK".

    Ok now, we will go back to CPanel's main page. Here click into "PhpMyAdmin". Once youve logged into phpMyAdmin, On the left there is a list of all your databases. Click the database you created in the first step. Once in here click the "SQL" tab. This will bring up a dialog box, copy and paste the below code and click the "Go" button.

    Code:
    CREATE TABLE IF NOT EXISTS `donation` (
      `username` varchar(32) NOT NULL,
      `time` varchar(100) NOT NULL,
      `productid` varchar(100) NOT NULL,
      `price` decimal(10,0) NOT NULL,
      `tickets` int(11) NOT NULL,
      `index` int(11) NOT NULL AUTO_INCREMENT,
      PRIMARY KEY (`index`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
    Ok nearly done!!!! (With mysql)
    Now here is a zip file: http://rs2-server.com/downloads/payp...er-release.zip
    What you must do with this zip file, is upload it to your webhost. And extract it. (ITS BEST TO UPLOAD TO A DIRECTORY CALLED DONATE and extract in there)

    Once these files have been extracted we want to edit "db.php", In here we set our database setting from the first few steps. So replace
    USERNAME with your USERNAME
    PASSWORD with your PASSWORD
    DATABASE with your DATABASE

    simple enough. Now go back to your CPanel's main page, and click into "Remote MySQL". In here you MUST add your dedicated servers IP, or the hosters IP Address. If you don't do this, nothing will work.....

    Server Side
    Ok its simple enough. First we create a new class called MadTurnipConnection.java
    (IF YOUR USING PI, IT MUST NOT BE PUT IN "package server", so put it in "package server.util")

    Below is the following code for Project Insanity, If people want delta just request and ill post it.

    Code:
    package server.util;
    
    import java.sql.*;
    import server.model.players.Client;
    
    public class MadTurnipConnection extends Thread {
    
    	public static Connection con = null;
    	public static Statement stm;
    
    	public static void createConnection() {
    		try {
    			Class.forName("com.mysql.jdbc.Driver").newInstance();
    			con = DriverManager.getConnection("jdbc:mysql://website/database", "username", "password");
    			stm = con.createStatement();
    		} catch (Exception e) {
    			e.printStackTrace();
    			con = null;
    			stm = null;
    		}
    	}
    	
    	public MadTurnipConnection(){
    		
    	}
    	
    	public void run() {
    		while(true) {		
    			try {
    				if(con == null)
    					createConnection(); 
    				else
    					ping();
    				Thread.sleep(10000);//10 seconds
    			} catch (Exception e) {
    				e.printStackTrace();
    			}
    		}
    	}
    	
    	public static void ping(){
    		try {
    			String query = "SELECT * FROM donation WHERE username = 'null'";
    			query(query);
    		} catch (Exception e) {
    			e.printStackTrace();
    			con = null;
    			stm = null;
    		}
    	}
    	
    	public static void addDonateItems(final Client c,final String name){
    		if(con == null){
    			if(stm != null){
    				try {
    					stm = con.createStatement();
    				} catch(Exception e){
    					con = null;
    					stm = null;
    					//put a sendmessage here telling them to relog in 30 seconds
    					return;
    				}
    			} else {
    				//put a sendmessage here telling them to relog in 30 seconds
    				return;
    			}
    		}
    		new Thread(){
    			@Override
    			public void run()
    			{
    				try {
    					String name2 = name.replaceAll(" ","_");
    					String query = "SELECT * FROM donation WHERE username = '"+name2+"'";
    					ResultSet rs = query(query);
    					boolean b = false;
    					while(rs.next()){
    						int prod = Integer.parseInt(rs.getString("productid"));
    						int price = Integer.parseInt(rs.getString("price"));
    						if(prod == 1 && price == 3){
    							c.getItems().addItem(4151,1);
    							b = true;
    						} else if(prod == 2 && price == 6){
    							c.getItems().addItem(4151,1);
    							b = true;
    						} else if(prod == 3 && price == 9){
    							c.getItems().addItem(4151,1);
    							b = true;
    						}
    					}
    					if(b){
    						query("DELETE FROM `donation` WHERE `username` = '"+name2+"';");
    					}
    				} catch (Exception e) {
    					e.printStackTrace();
    					con = null;
    					stm = null;
    				}
    			}
    		}.start();
    	}
    	
    	public static ResultSet query(String s) throws SQLException {
    		try {
    			if (s.toLowerCase().startsWith("select")) {
    				ResultSet rs = stm.executeQuery(s);
    				return rs;
    			} else {
    				stm.executeUpdate(s);
    			}
    			return null;
    		} catch (Exception e) {
    			e.printStackTrace();
    			con = null;
    			stm = null;
    		}
    		return null;
    	}
    }
    If you use battlescape or delta change (also remove imports)


    to



    and

    to




    Again we must edit this file to the database details we made in the first few steps:
    So edit this line


    An example for rune-server could be



    Ok now open Server.java declare:

    public static MadTurnipConnection md;

    in your method
    below it add this:

    Code:
    md = new MadTurnipConnection();
    md.start();
    also import the file: import server.util.MadTurnipConnection;
    also do this in client.java.

    Now open client.java and find this method:
    Code:
    initialize()
    below it add

    Code:
    MadTurnipConnection.addDonateItems(this,playerName);

    OK YOUR ALL DONE!!!!! WOO!!!, but wait, thats if you want to send ME money, and only sell whips, for different prices. So read below if you want to add or customize the items!!!!

    Ok to create a new item you need 3 things:
    Item Name,
    Item Id,
    Price,
    ProductId,

    so for example, whip, 4151, $3, 4

    Now first open donate.php on your webhost and look for the following code:
    Code:
    <select name="prod">
    			<option value="1">Party Hats</option>
    				<option value="2">barrows</option>
    				<option value="3">bandos</option>
    			</select>
    in here we put 2 values, the productId, and the Item Name so for our whip we would do, (ProductID 4, Name: Whip)

    Code:
    <select name="prod">
    			<option value="1">Party Hats</option>
    				<option value="2">barrows</option>
    				<option value="3">bandos</option>
    <option value="4">Whip</option>
    			</select>
    We then must edit paypal.php (once opened search for)



    change this to your email (Or you can donate to me, I guarantee all donated money will go towards beer and writing more stupid stuff like this)

    then below it is

    Code:
    if($_GET['prod'] == 1)
    			$price = '3.00';
    		if($_GET['prod'] == 2)
    			$price = '6.00';
    		if($_GET['prod'] == 3)
    			$price = '9.00';
    here we use our ProductId, and Price. so for our whip it is

    Code:
    if($_GET['prod'] == 1)
    			$price = '3.00';
    		if($_GET['prod'] == 2)
    			$price = '6.00';
    		if($_GET['prod'] == 3)
    			$price = '9.00';
    if($_GET['prod'] == 4)
    			$price = '3.00';
    Now finaly we edit the serverside code in MadTurnipConnection. Scroll down to:

    Code:
    if(prod == 1 && price == 3){
    							c.getItems().addItem(4151,1);
    							b = true;
    						} else if(prod == 2 && price == 6){
    							c.getItems().addItem(4151,1);
    							b = true;
    						} else if(prod == 3 && price == 9){
    							c.getItems().addItem(4151,1);
    							b = true;
    						}
    here we use our, productId, Price, and itemId, so for a whip it is

    Code:
    if(prod == 1 && price == 3){
    							c.getItems().addItem(4151,1);
    							b = true;
    						} else if(prod == 2 && price == 6){
    							c.getItems().addItem(4151,1);
    							b = true;
    						} else if(prod == 3 && price == 9){
    							c.getItems().addItem(4151,1);
    							b = true;
    						} else if(prod == 4 && price == 3){
    							c.getItems().addItem(4151,1);
    							b = true; 
    						}
    Hopefully you learned how it works, I don't really recommend on using it as its done very badly but it works, so enjoy and stop letting all those noobs keep ripping you off!


    Awesome share, thanks. Just need my paypal account to be non-limited :crybaby:
    Reply With Quote  
     

  7. #27  
    Registered Member
    Join Date
    Jun 2011
    Posts
    476
    Thanks given
    57
    Thanks received
    43
    Rep Power
    17
    Noo why did you release
    Reply With Quote  
     

  8. #28  
    Registered Member

    Join Date
    Sep 2007
    Age
    32
    Posts
    2,396
    Thanks given
    5
    Thanks received
    436
    Rep Power
    902
    Quote Originally Posted by dani_gonzales View Post
    Hey martin can u convert it for shard please?
    i will give u a little donation if i get it working
    nice relase!
    sure
    Hyperion V2 Martin's Updates.

    Scar says:
    i hate it when it hits your face
    Reply With Quote  
     

  9. #29  
    Registered Member
    Join Date
    Oct 2010
    Posts
    560
    Thanks given
    85
    Thanks received
    21
    Rep Power
    16
    thanks you so much works perfect rep++

    Spoiler for Rs3 Account:
    Reply With Quote  
     

  10. #30  
    Super Donator


    Join Date
    Sep 2008
    Age
    30
    Posts
    1,894
    Thanks given
    677
    Thanks received
    776
    Rep Power
    456
    Nice.

    What about Plimus?
    Reply With Quote  
     

Page 3 of 32 FirstFirst 1234513 ... LastLast

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: 7
    Last Post: 06-17-2013, 11:23 PM
  2. Replies: 5
    Last Post: 07-13-2011, 08:15 PM
  3. [PI] $25 Auto Donation System
    By Harambe_ in forum Requests
    Replies: 4
    Last Post: 11-23-2010, 01:24 AM
  4. [PI] $25 Auto Donation System
    By Harambe_ in forum Help
    Replies: 0
    Last Post: 11-14-2010, 07:42 AM
  5. Auto Donation System
    By iColin in forum Help
    Replies: 2
    Last Post: 10-24-2010, 10:44 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
  •