Thread: [718] RuneTopList Voting Script v3

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1 [718] RuneTopList Voting Script v3 
    Owner of Ateria™
    Join Date
    Jul 2013
    Posts
    392
    Thanks given
    36
    Thanks received
    12
    Rep Power
    10
    So i've been working on this command for about an hour now and i've literally tried everything, changed the locations of different things and everything else but i keep getting errors.
    I followed this tutorial part of the way through but did most of the stuff on my own as the tutorial was for pi - i've semi converted the command into 718 but i'm not sure if i have fully
    [Only registered and activated users can see links. ]
    Here's an image of the errors and below is the code if someone could help at all i would rep++



    Code:
    		if (cmd[0].equals("claimvote") || cmd[0].equals("claim") || cmd[0].equals("check")) {
                RuneTopList.checkRewards((player.getUsername().toLowerCase().replaceAll(" ", "_")), new VoteRewardCallback() {
                	@Override
                	public void callback (Object obj) {
                		if (getVoteRewards().size() == 0) {
                			player.getPackets().sendGameMessage("It appears that you haven't voted or there's been a database error.");
                		} else {
            				//TODO: Should check if there is enough space to add items in inventory, if not then bank
            				for(VoteReward reward : getVoteRewards()){
            					switch (reward.getRewardid()) {//find reward id in the vote4reward control panel at runtoplist.com/YOUR_SERVERUSERNAME/cp
                                    case 56:
                                        player.getInventory().addItem(995 , 2500000);
                                        break;
                                    //add more here
                                    default:
                                      player.getPackets().sendGameMessage("Reward not found. Please contact staff.");
                                        break;
                                }
            				}
                            player.getPackets().sendGameMessage("Thank you for voting.");
                		    for (Player players : World.getPlayers()) {
                				if (players == null)
                					continue;
                				players.getPackets().sendGameMessage("<col=FF0000> " + player.getUsername() + " has just voted and claimed their reward! Type ::vote for a reward!");	
                		    }
                		    
                		}
                	}
                }
    		}
    Reply With Quote  
     

  2. #2  
    Registered Member
    medic's Avatar
    Join Date
    Sep 2013
    Posts
    1,584
    Thanks given
    821
    Thanks received
    560
    Rep Power
    1129




    Reply With Quote  
     

  3. #3  
    Owner of Ateria™
    Join Date
    Jul 2013
    Posts
    392
    Thanks given
    36
    Thanks received
    12
    Rep Power
    10
    Quote Originally Posted by medic View Post




    I did that and it gave me the exact same error just for the next line so i did it on the next line too and it still said the same error..
    Reply With Quote  
     

  4. #4  
    Owner of Ateria™
    Join Date
    Jul 2013
    Posts
    392
    Thanks given
    36
    Thanks received
    12
    Rep Power
    10
    Quote Originally Posted by medic View Post


    look here: (i've even saved the file and refreshed the workspace

    Reply With Quote  
     

  5. #5  
    Registered Member
    medic's Avatar
    Join Date
    Sep 2013
    Posts
    1,584
    Thanks given
    821
    Thanks received
    560
    Rep Power
    1129
    Quote Originally Posted by NexusRS View Post
    I did that and it gave me the exact same error just for the next line so i did it on the next line too and it still said the same error..
    Code:
    		if (cmd[0].equals("claimvote") || cmd[0].equals("claim") || cmd[0].equals("check")) {
                RuneTopList.checkRewards((player.getUsername().toLowerCase().replaceAll(" ", "_")), new VoteRewardCallback() {
                	@Override
                	public void callback (Object obj) {
                		if (getVoteRewards().size() == 0) {
                			player.getPackets().sendGameMessage("It appears that you haven't voted or there's been a database error.");
                		} else {
            				//TODO: Should check if there is enough space to add items in inventory, if not then bank
            				for(VoteReward reward : getVoteRewards()){
            					switch (reward.getRewardid()) {//find reward id in the vote4reward control panel at runtoplist.com/YOUR_SERVERUSERNAME/cp
                                    case 56:
                                        player.getInventory().addItem(995 , 2500000);
                                        break;
                                    //add more here
                                    default:
                                      player.getPackets().sendGameMessage("Reward not found. Please contact staff.");
                                        break;
                                }
            				}
                            player.getPackets().sendGameMessage("Thank you for voting.");
                		    for (Player players : World.getPlayers()) {
                				if (players == null)
                					continue;
                				players.getPackets().sendGameMessage("<col=FF0000> " + player.getUsername() + " has just voted and claimed their reward! Type ::vote for a reward!");	
         				}
    				}
    			}
    			
    		}
    	});
    }
    try this


    Reply With Quote  
     

  6. #6  
    Owner of Ateria™
    Join Date
    Jul 2013
    Posts
    392
    Thanks given
    36
    Thanks received
    12
    Rep Power
    10
    Quote Originally Posted by medic View Post
    Code:
    		if (cmd[0].equals("claimvote") || cmd[0].equals("claim") || cmd[0].equals("check")) {
                RuneTopList.checkRewards((player.getUsername().toLowerCase().replaceAll(" ", "_")), new VoteRewardCallback() {
                	@Override
                	public void callback (Object obj) {
                		if (getVoteRewards().size() == 0) {
                			player.getPackets().sendGameMessage("It appears that you haven't voted or there's been a database error.");
                		} else {
            				//TODO: Should check if there is enough space to add items in inventory, if not then bank
            				for(VoteReward reward : getVoteRewards()){
            					switch (reward.getRewardid()) {//find reward id in the vote4reward control panel at runtoplist.com/YOUR_SERVERUSERNAME/cp
                                    case 56:
                                        player.getInventory().addItem(995 , 2500000);
                                        break;
                                    //add more here
                                    default:
                                      player.getPackets().sendGameMessage("Reward not found. Please contact staff.");
                                        break;
                                }
            				}
                            player.getPackets().sendGameMessage("Thank you for voting.");
                		    for (Player players : World.getPlayers()) {
                				if (players == null)
                					continue;
                				players.getPackets().sendGameMessage("<col=FF0000> " + player.getUsername() + " has just voted and claimed their reward! Type ::vote for a reward!");	
         				}
    				}
    			}
    			
    		}
    	});
    }
    try this

    Had a bracket too many so took it off and changed it to look like this:

    Code:
    		if (cmd[0].equals("claimvote") || cmd[0].equals("claim") || cmd[0].equals("check")) {
                RuneTopList.checkRewards((player.getUsername().toLowerCase().replaceAll(" ", "_")), new VoteRewardCallback() {
                	@Override
                	public void callback (Object obj) {
                		if (getVoteRewards().size() == 0) {
                			player.getPackets().sendGameMessage("It appears that you haven't voted or there's been a database error.");
                		} else {
            				//TODO: Should check if there is enough space to add items in inventory, if not then bank
            				for(VoteReward reward : getVoteRewards()){
            					switch (reward.getRewardid()) {//find reward id in the vote4reward control panel at runtoplist.com/YOUR_SERVERUSERNAME/cp
                                    case 56:
                                        player.getInventory().addItem(995 , 2500000);
                                        break;
                                    //add more here
                                    default:
                                      player.getPackets().sendGameMessage("Reward not found. Please contact staff.");
                                        break;
                                }
            				}
                            player.getPackets().sendGameMessage("Thank you for voting.");
                		    for (Player players : World.getPlayers()) {
                				if (players == null)
                					continue;
                				players.getPackets().sendGameMessage("<col=FF0000> " + player.getUsername() + " has just voted and claimed their reward! Type ::vote for a reward!");	
         				}
    				}
    			}
    			
    		});
    	}
    Thanks for the help. Repped ya
    Reply With Quote  
     

  7. #7  
    Owner of Ateria™
    Join Date
    Jul 2013
    Posts
    392
    Thanks given
    36
    Thanks received
    12
    Rep Power
    10
    Quote Originally Posted by medic View Post
    Code:
    		if (cmd[0].equals("claimvote") || cmd[0].equals("claim") || cmd[0].equals("check")) {
                RuneTopList.checkRewards((player.getUsername().toLowerCase().replaceAll(" ", "_")), new VoteRewardCallback() {
                	@Override
                	public void callback (Object obj) {
                		if (getVoteRewards().size() == 0) {
                			player.getPackets().sendGameMessage("It appears that you haven't voted or there's been a database error.");
                		} else {
            				//TODO: Should check if there is enough space to add items in inventory, if not then bank
            				for(VoteReward reward : getVoteRewards()){
            					switch (reward.getRewardid()) {//find reward id in the vote4reward control panel at runtoplist.com/YOUR_SERVERUSERNAME/cp
                                    case 56:
                                        player.getInventory().addItem(995 , 2500000);
                                        break;
                                    //add more here
                                    default:
                                      player.getPackets().sendGameMessage("Reward not found. Please contact staff.");
                                        break;
                                }
            				}
                            player.getPackets().sendGameMessage("Thank you for voting.");
                		    for (Player players : World.getPlayers()) {
                				if (players == null)
                					continue;
                				players.getPackets().sendGameMessage("<col=FF0000> " + player.getUsername() + " has just voted and claimed their reward! Type ::vote for a reward!");	
         				}
    				}
    			}
    			
    		}
    	});
    }
    try this
    Nvm when i tried starting the server it gave me this error: [Only registered and activated users can see links. ]

    then when i leave the command in, none of the commands in Regular.java work.
    Reply With Quote  
     

  8. #8  
    Registered Member

    Join Date
    Feb 2013
    Posts
    4,417
    Thanks given
    59
    Thanks received
    478
    Rep Power
    138
    Quote Originally Posted by NexusRS View Post
    Nvm when i tried starting the server it gave me this error: [Only registered and activated users can see links. ]

    then when i leave the command in, none of the commands in Regular.java work.
    Because you clearly didn't import the jar file..
    Reply With Quote  
     

  9. #9  
    Owner of Ateria™
    Join Date
    Jul 2013
    Posts
    392
    Thanks given
    36
    Thanks received
    12
    Rep Power
    10
    Quote Originally Posted by Datbeastmayne View Post
    Because you clearly didn't import the jar file..
    Sorry i'm stupid, tried this vote thing that many times that i thought it was still there, must have deleted it from there when i last tried it.
    Reply With Quote  
     

  10. #10  
    Owner of Ateria™
    Join Date
    Jul 2013
    Posts
    392
    Thanks given
    36
    Thanks received
    12
    Rep Power
    10
    Quote Originally Posted by Datbeastmayne View Post
    Because you clearly didn't import the jar file..
    Ok so i've imported them but now when i try to claim the reward on an account i know i voted on 6 hours ago it says :

    then it follows it by this:

    Im positive that i put the correct Key and Username in.
    Reply With Quote  
     

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. RuneTopList Voting Script V3
    By Danny RTL in forum Tutorials
    Replies: 41
    Last Post: 11-13-2015, 05:04 AM
  2. [UPDATED - MAY 2014]RuneTopList Voting Script V3
    By Danny RTL in forum Tutorials
    Replies: 60
    Last Post: 03-31-2015, 07:23 PM
  3. Replies: 1
    Last Post: 06-05-2014, 06:12 AM
  4. RuneTopList Voting Script V1 (Vote4Items)
    By Danny RTL in forum Tutorials
    Replies: 180
    Last Post: 06-14-2012, 07:11 PM
  5. Replies: 3
    Last Post: 01-03-2012, 02:43 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •