Thread: [718] Errors in adding GTLvote

Results 1 to 7 of 7
  1. #1 [718] Errors in adding GTLvote 
    Donator

    Sir Lethal's Avatar
    Join Date
    Mar 2008
    Posts
    2,286
    Thanks given
    9
    Thanks received
    74
    Rep Power
    426
    I get this error

    Code:
    MainLoader cannot be resolved to a type	Launcher.java

    The code is this

    Code:
     	public static MainLoader vote = new MainLoader("ip", "dbname", "dbpw", "dbname");
    Can anyone help?
    Reply With Quote  
     

  2. #2  
    Donator

    Join Date
    Jan 2013
    Age
    30
    Posts
    122
    Thanks given
    5
    Thanks received
    12
    Rep Power
    22
    Check your Build Path and ensure the GTL jar is properly setup and imported into your Launcher class.
    Your problem might be that Launcher can't find the MainLoader class, and thus can't instantiate a new instance of it.
    Reply With Quote  
     

  3. #3  
    Donator

    Sir Lethal's Avatar
    Join Date
    Mar 2008
    Posts
    2,286
    Thanks given
    9
    Thanks received
    74
    Rep Power
    426
    Quote Originally Posted by Logical94 View Post
    Check your Build Path and ensure the GTL jar is properly setup and imported into your Launcher class.
    Your problem might be that Launcher can't find the MainLoader class, and thus can't instantiate a new instance of it.
    EDIT: I setup the GTL Jar in the build code thanks for the suggestion. It's still throwing the same error though

    EDIT2: Thanks, I figured it out! Also had to import it in that class. Thanks for the build suggestion I had no idea
    Reply With Quote  
     

  4. #4  
    Donator

    Sir Lethal's Avatar
    Join Date
    Mar 2008
    Posts
    2,286
    Thanks given
    9
    Thanks received
    74
    Rep Power
    426
    Got another error

    Description Resource Path Location Type
    Launcher cannot be resolved Regular.java src/com/rs/game/player/content/commands

    The code:
    Code:
     if (cmd[0].equals("claimvote") || cmd[0].equals("checkvote") || cmd[0].equals("reward") || cmd[0].equals("claim")) {
    			 try {
                     VoteReward reward = Launcher.vote.hasVoted(player.getUsername().toLowerCase().replaceAll(" ", "_"));
    Wouldn't let me edit my above post for some reason, said message was too short..
    Reply With Quote  
     

  5. #5  
    Donator

    Join Date
    Jan 2013
    Age
    30
    Posts
    122
    Thanks given
    5
    Thanks received
    12
    Rep Power
    22
    This is what I have used for the vote command:

    Code:
    if (cmd[0].equalsIgnoreCase("claim")) {
    				try {
    					VoteReward reward = Launcher.vote.hasVoted(player
    							.getUsername().toLowerCase().replaceAll(" ", "_"));
    					if (reward != null) {
    
    						for (Player players : World.getPlayers()) {
    							if (players != null) {
    								players.getPackets()
    										.sendGameMessage(
    												player.getUsername()
    														+ "<col=000079><img=4> HAS CLAIMED HIS/HER VOTE REWARD!!!!!!");
    							}
    
    						}
    Since your error is related to another class (Regular.java) as you have mentioned, I would suggest checking your formatting and ensuring all braces are properly closed. Braces that remain open can interfere with other code found in the same class, which may be invoking your Regular.java class.
    Reply With Quote  
     

  6. #6  
    Donator

    Sir Lethal's Avatar
    Join Date
    Mar 2008
    Posts
    2,286
    Thanks given
    9
    Thanks received
    74
    Rep Power
    426
    Thanks, I was able to figure it out now.
    Reply With Quote  
     

  7. #7  
    Registered Member

    Join Date
    Dec 2012
    Posts
    2,999
    Thanks given
    894
    Thanks received
    921
    Rep Power
    2555
    braces

    lol
    lol
    Attached image
    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: 4
    Last Post: 04-22-2012, 12:54 AM
  2. Replies: 18
    Last Post: 02-01-2012, 01:01 PM
  3. Replies: 30
    Last Post: 09-30-2010, 10:22 PM
  4. Replies: 0
    Last Post: 07-14-2010, 06:35 PM
  5. Error in Adding PlayerFollowing
    By danny94 in forum Help
    Replies: 2
    Last Post: 02-10-2010, 10: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
  •