Thread: Gtl

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1 Gtl 
    Donator


    Join Date
    Aug 2012
    Posts
    2,462
    Thanks given
    312
    Thanks received
    459
    Rep Power
    457
    hey i did this http://www.rune-server.org/programmi...script-10.html

    but im on eclipse and i get the import errors saying i need the package or something....
    server.java

    import org.runetoplist.VoteChecker;

    public static VoteChecker voteChecker = new VoteChecker("url", "databse", "user", "pass"); <--- I did change them they are right in my files.

    commands.java

    import org.runetoplist.*;

    VoteReward reward = Server.voteChecker.getReward(c.playerName.replaceAll(" ", "_"));

    Everything that is red is the stuff that it says is wrong in eclipse. I get no errors in my compiler though.

    What am i missing?
    Attached image

    Attached image
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Dec 2011
    Posts
    1,615
    Thanks given
    1,971
    Thanks received
    819
    Rep Power
    1049
    You need to add the Jar library.

    Edit: Opening eclipse I figured I'd give you a more in-depth explanation.

    Right Click on your Project > Properties > Java Build Path > Libraries > Add External Jars > *browse around and click the Jar to import it*
    Reply With Quote  
     

  3. #3  
    Donator


    Join Date
    Aug 2012
    Posts
    2,462
    Thanks given
    312
    Thanks received
    459
    Rep Power
    457
    Quote Originally Posted by Murilirum View Post
    You need to add the Jar library.
    i already got the GTLVote.jar in my deps folder
    Attached image

    Attached image
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Dec 2011
    Posts
    1,615
    Thanks given
    1,971
    Thanks received
    819
    Rep Power
    1049
    Quote Originally Posted by Project Pk View Post
    i already got the GTLVote.jar in my deps folder
    Just because it's in deps doesn't mean it's being recognized or referenced by the IDE.
    Reply With Quote  
     

  5. #5  
    Donator


    Join Date
    Aug 2012
    Posts
    2,462
    Thanks given
    312
    Thanks received
    459
    Rep Power
    457
    So how do i fix this?
    Attached image

    Attached image
    Reply With Quote  
     

  6. #6  
    Donator


    Join Date
    Aug 2012
    Posts
    2,462
    Thanks given
    312
    Thanks received
    459
    Rep Power
    457
    Quote Originally Posted by Murilirum View Post
    Just because it's in deps doesn't mean it's being recognized or referenced by the IDE.
    I fixed the problem but now when i type ::check it says Sql Error
    Attached image

    Attached image
    Reply With Quote  
     

  7. #7  
    Donator


    Join Date
    Aug 2012
    Posts
    2,462
    Thanks given
    312
    Thanks received
    459
    Rep Power
    457
    nvm can someone just install this for me -_- i have it done on the website. just server part.
    Attached image

    Attached image
    Reply With Quote  
     

  8. #8  
    Registered Member

    Join Date
    Dec 2011
    Posts
    1,615
    Thanks given
    1,971
    Thanks received
    819
    Rep Power
    1049
    Quote Originally Posted by Project Pk View Post
    I fixed the problem but now when i type ::check it says Sql Error
    Screenshot the error?
    Reply With Quote  
     

  9. #9  
    Donator


    Join Date
    Aug 2012
    Posts
    2,462
    Thanks given
    312
    Thanks received
    459
    Rep Power
    457
    Quote Originally Posted by Murilirum View Post
    Screenshot the error?
    No its not cmd error it sends this message in game

    [GTL Vote] A SQL error has occured

    part of this commad

    Code:
    if (playerCommand.equalsIgnoreCase("check") || playerCommand.equalsIgnoreCase("reward")) {
                try {
                    VoteReward reward = Server.vote.hasVoted(c.playerName.replaceAll(" ", "_"));
                    if(reward != null){
                        switch(reward.getReward()){
                            case 0:
                               //rewards
                                break;
                            case 1:
                                                         //etc
                            
                            default:
                                c.sendMessage("Reward not found.");
                                break;
                        }
                        c.sendMessage("Thank you for voting.");
                    } else {
                        c.sendMessage("You have no items waiting for you.");
                    }
                } catch (Exception e){
                    c.sendMessage("[GTL Vote] A SQL error has occured.");
                }
            }
    Attached image

    Attached image
    Reply With Quote  
     

  10. #10  
    Banned

    Join Date
    Aug 2013
    Age
    27
    Posts
    1,128
    Thanks given
    373
    Thanks received
    754
    Rep Power
    0
    Quote Originally Posted by Project Pk View Post
    No its not cmd error it sends this message in game

    [GTL Vote] A SQL error has occured

    part of this commad

    Code:
    if (playerCommand.equalsIgnoreCase("check") || playerCommand.equalsIgnoreCase("reward")) {
                try {
                    VoteReward reward = Server.vote.hasVoted(c.playerName.replaceAll(" ", "_"));
                    if(reward != null){
                        switch(reward.getReward()){
                            case 0:
                               //rewards
                                break;
                            case 1:
                                                         //etc
                            
                            default:
                                c.sendMessage("Reward not found.");
                                break;
                        }
                        c.sendMessage("Thank you for voting.");
                    } else {
                        c.sendMessage("You have no items waiting for you.");
                    }
                } catch (Exception e){
                    c.sendMessage("[GTL Vote] A SQL error has occured.");
                }
            }
    I'll do for you in team viewer when i back from work.
    Reply With Quote  
     

  11. Thankful user:


Page 1 of 2 12 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: 19
    Last Post: 12-17-2013, 07:47 PM
  2. Gtl vote check help!
    By hipster in forum Help
    Replies: 0
    Last Post: 04-12-2013, 01:56 PM
  3. GTL Vote help.
    By ShotDown in forum Help
    Replies: 3
    Last Post: 03-17-2013, 01:08 AM
  4. GTL Vote Help [PI]
    By i am here in forum Help
    Replies: 2
    Last Post: 03-10-2013, 11:11 PM
  5. Replies: 0
    Last Post: 03-08-2013, 11:42 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
  •