Thread: Mystery Box Compiling Errors !

Results 1 to 6 of 6
  1. #1 remove. 
    Donator

    Join Date
    Sep 2014
    Posts
    52
    Thanks given
    4
    Thanks received
    20
    Rep Power
    35
    remove.
    Reply With Quote  
     

  2. #2  
    'Slutty McFur'

    Owain's Avatar
    Join Date
    Sep 2014
    Age
    26
    Posts
    2,894
    Thanks given
    2,360
    Thanks received
    2,200
    Rep Power
    5000
    Use an IDE. Will save yourself and those trying to help you valuable time.


    Spoiler for wat:
    Attached image
    Attached image

    Attached image


    Reply With Quote  
     

  3. Thankful users:


  4. #3  
    Registered Member

    Join Date
    Jul 2013
    Posts
    119
    Thanks given
    12
    Thanks received
    50
    Rep Power
    83
    Replace player.getPackets() and player.sendMessage with p.getPackets() and p.sendMessage. Notice how there's no player variable (don't know what that means? Google variables)

    An anti-leach to prevent users from using an IDE? Got quite the imagination, my friend
    Reply With Quote  
     

  5. #4  
    Registered Member

    Join Date
    Jul 2013
    Posts
    119
    Thanks given
    12
    Thanks received
    50
    Rep Power
    83
    Quote Originally Posted by ZAcrofyse View Post
    Code:
    Compiling...
    src\com\rs\game\player\content\items\MysteryBox.java:30: error: method sendMessa
    ge in class WorldPacketsEncoder cannot be applied to given types;
                    p.getPackets().sendMessage("You open the box and find " + getGra
    mmar() + " " + getNameForItem() + ", awesome!");
                                  ^
      required: int,String,Player
      found: String
      reason: actual and formal argument lists differ in length
    src\com\rs\game\player\content\items\MysteryBox.java:38: error: method sendMessa
    ge in class WorldPacketsEncoder cannot be applied to given types;
                    p.getPackets().sendMessage("You open the box and find " + getGra
    mmar() + " " + getNameForItem() + ", excellent.");
                                  ^
      required: int,String,Player
      found: String
      reason: actual and formal argument lists differ in length
    src\com\rs\game\player\content\items\MysteryBox.java:47: error: method sendMessa
    ge in class WorldPacketsEncoder cannot be applied to given types;
                    p.getPackets().sendMessage("You open the box and find " + getGra
    mmar() + " " + getNameForItem() + ", not bad.");
                                  ^
      required: int,String,Player
      found: String
      reason: actual and formal argument lists differ in length
    src\com\rs\game\player\content\items\MysteryBox.java:55: error: method sendMessa
    ge in class WorldPacketsEncoder cannot be applied to given types;
                    p.getPackets().sendMessage((String) "You open the box and find "
     + (COMMON[r][0] == (995) ? c : getGrammar()) + " "
                                  ^
      required: int,String,Player
      found: String
      reason: actual and formal argument lists differ in length
    4 errors
    Press any key to continue . . .
    p.sendMessage, not p.getPackets().sendMessage. Change player.getPackets() to p.getPackets(), change player.sendMessage to p.sendMessage

    And it'll only work if your Player class has a sendMessage method declared
    Reply With Quote  
     

  6. Thankful user:


  7. #5  
    Ask me how I'm doing

    .NF.'s Avatar
    Join Date
    Aug 2015
    Age
    30
    Posts
    2,174
    Thanks given
    293
    Thanks received
    619
    Rep Power
    567
    Quote Originally Posted by ZAcrofyse View Post
    Code:
    Compiling...
    src\com\rs\game\player\content\items\MysteryBox.java:30: error: method sendMessa
    ge in class WorldPacketsEncoder cannot be applied to given types;
                    p.getPackets().sendMessage("You open the box and find " + getGra
    mmar() + " " + getNameForItem() + ", awesome!");
                                  ^
      required: int,String,Player
      found: String
      reason: actual and formal argument lists differ in length
    src\com\rs\game\player\content\items\MysteryBox.java:38: error: method sendMessa
    ge in class WorldPacketsEncoder cannot be applied to given types;
                    p.getPackets().sendMessage("You open the box and find " + getGra
    mmar() + " " + getNameForItem() + ", excellent.");
                                  ^
      required: int,String,Player
      found: String
      reason: actual and formal argument lists differ in length
    src\com\rs\game\player\content\items\MysteryBox.java:47: error: method sendMessa
    ge in class WorldPacketsEncoder cannot be applied to given types;
                    p.getPackets().sendMessage("You open the box and find " + getGra
    mmar() + " " + getNameForItem() + ", not bad.");
                                  ^
      required: int,String,Player
      found: String
      reason: actual and formal argument lists differ in length
    src\com\rs\game\player\content\items\MysteryBox.java:55: error: method sendMessa
    ge in class WorldPacketsEncoder cannot be applied to given types;
                    p.getPackets().sendMessage((String) "You open the box and find "
     + (COMMON[r][0] == (995) ? c : getGrammar()) + " "
                                  ^
      required: int,String,Player
      found: String
      reason: actual and formal argument lists differ in length
    4 errors
    Press any key to continue . . .
    do you see how he fixed it? its better to learn than just to be given answers
    Attached image
    Reply With Quote  
     

  8. #6  
    Registered Member
    Join Date
    Jan 2017
    Posts
    196
    Thanks given
    15
    Thanks received
    22
    Rep Power
    11
    Quote Originally Posted by ZAcrofyse View Post
    Works ! Thank you sir ! How can I rep you ?
    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: 2
    Last Post: 12-27-2012, 05:15 AM
  2. Replies: 23
    Last Post: 05-23-2012, 11:53 AM
  3. Basic Compile Errors
    By Daniel in forum Tutorials
    Replies: 4
    Last Post: 09-17-2007, 12:54 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
  •