Thread: Error when attempting to attack npc

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 Error when attempting to attack npc 
    Donator

    Join Date
    Nov 2012
    Posts
    790
    Thanks given
    47
    Thanks received
    42
    Rep Power
    17
    When im trying to attack a npc i get this on the cmd and my server crashes :/ will rep+ for a fiix


    Code:
    java.util.NoSuchElementException: No line found
            at java.util.Scanner.nextLine(Scanner.java:1585)
            at server.model.npcs.NPCDrops.loadDrops(NPCDrops.java:37)
            at server.model.npcs.NPCDrops.<init>(NPCDrops.java:15)
            at server.Server.<clinit>(Server.java:71)
    [23/01/13 12:02]: Initializing start up...
    [23/01/13 12:02]: Loading scripts...
    [23/01/13 12:02]: Loaded 12 scripts!
    [23/01/13 12:02]: EvoScape successfully started, current server port:43594
    [23/01/13 12:02]: [REGISTERED]: Kyle
    [23/01/13 12:02]: Exception in thread "main" [23/01/13 12:02]: java.lang.Error:
    Unresolved compilation problems:
            usingBow cannot be resolved to a variable
            usingCross cannot be resolved to a variable
            usingOtherRangeWeapons cannot be resolved to a variable
            i cannot be resolved to a variable
    
    [23/01/13 12:02]:       at server.model.players.CombatAssistant.checkMagicReqs(C
    ombatAssistant.java:3494)
    [23/01/13 12:02]:       at server.model.players.CombatAssistant.attackNpc(Combat
    Assistant.java:136)
    [23/01/13 12:02]:       at server.model.players.packets.ClickNPC.processPacket(C
    lickNPC.java:99)
    [23/01/13 12:02]:       at server.model.players.PacketHandler.processPacket(Pack
    etHandler.java:138)
    [23/01/13 12:02]:       at server.model.players.Client.processQueuedPackets(Clie
    nt.java:1011)
    [23/01/13 12:02]:       at server.model.players.PlayerHandler.process(PlayerHand
    ler.java:135)
    [23/01/13 12:02]:       at server.Server.main(Server.java:155)
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Feb 2010
    Posts
    3,187
    Thanks given
    1,124
    Thanks received
    834
    Discord
    View profile
    Rep Power
    1514
    Several problems; the configuration parser is failing to find an element in the spawn configuration and you have unresolved variables (variables that are not declared).

    Can you please paste the code on line 3494 (and a hundred or so lines preceding it) in the combat assistant class so I can help you fix it.
    Reply With Quote  
     

  3. #3  
    Donator

    Join Date
    Nov 2012
    Posts
    790
    Thanks given
    47
    Thanks received
    42
    Rep Power
    17
    Quote Originally Posted by Fire Cape View Post
    Several problems; the configuration parser is failing to find an element in the spawn configuration and you have unresolved variables (variables that are not declared).

    Can you please paste the code on line 3494 (and a hundred or so lines preceding it) in the combat assistant class so I can help you fix it.
    Code:
    		if(usingBow && usingCross && c.usingMagic && usingOtherRangeWeapons) {
    					c.getPA().followPlayer();
    					c.stopMovement();
    		} else {
    					c.followId = 0;
    					c.followId2 = i;
    		}
    Heres my whole combatassisant.java
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Feb 2010
    Posts
    3,187
    Thanks given
    1,124
    Thanks received
    834
    Discord
    View profile
    Rep Power
    1514
    Quote Originally Posted by Relentless View Post
    Code:
    		if(usingBow && usingCross && c.usingMagic && usingOtherRangeWeapons) {
    					c.getPA().followPlayer();
    					c.stopMovement();
    		} else {
    					c.followId = 0;
    					c.followId2 = i;
    		}
    Heres my whole combatassisant.java
    [Only registered and activated users can see links. ]
    try:
    Code:
    		if(c.usingBow && c.usingCross && c.usingMagic && c.usingOtherRangeWeapons) {
    					c.getPA().followPlayer();
    					c.stopMovement();
    		} else {
    					c.followId = 0;
    					c.followId2 = i;
    		}
    Reply With Quote  
     

  5. #5  
    Donator

    Join Date
    Nov 2012
    Posts
    790
    Thanks given
    47
    Thanks received
    42
    Rep Power
    17
    Quote Originally Posted by Fire Cape View Post
    try:
    Code:
    		if(c.usingBow && c.usingCross && c.usingMagic && c.usingOtherRangeWeapons) {
    					c.getPA().followPlayer();
    					c.stopMovement();
    		} else {
    					c.followId = 0;
    					c.followId2 = i;
    		}
    Code:
    src\server\model\players\CombatAssistant.java:3494: error: cannot find symbol
                    if(c.usingBow && c.usingCross && c.usingMagic && c.usingOtherRan
    geWeapons) {
                                      ^
      symbol:   variable usingCross
      location: variable c of type Client
    src\server\model\players\CombatAssistant.java:3494: error: cannot find symbol
                    if(c.usingBow && c.usingCross && c.usingMagic && c.usingOtherRan
    geWeapons) {
                                                                      ^
      symbol:   variable usingOtherRangeWeapons
      location: variable c of type Client
    src\server\model\players\CombatAssistant.java:3499: error: cannot find symbol
                                            c.followId2 = i;
                                                          ^
      symbol:   variable i
      location: class CombatAssistant
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    3 errors
    Press any key to continue . . .
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Feb 2010
    Posts
    3,187
    Thanks given
    1,124
    Thanks received
    834
    Discord
    View profile
    Rep Power
    1514
    Quote Originally Posted by Relentless View Post
    Code:
    src\server\model\players\CombatAssistant.java:3494: error: cannot find symbol
                    if(c.usingBow && c.usingCross && c.usingMagic && c.usingOtherRan
    geWeapons) {
                                      ^
      symbol:   variable usingCross
      location: variable c of type Client
    src\server\model\players\CombatAssistant.java:3494: error: cannot find symbol
                    if(c.usingBow && c.usingCross && c.usingMagic && c.usingOtherRan
    geWeapons) {
                                                                      ^
      symbol:   variable usingOtherRangeWeapons
      location: variable c of type Client
    src\server\model\players\CombatAssistant.java:3499: error: cannot find symbol
                                            c.followId2 = i;
                                                          ^
      symbol:   variable i
      location: class CombatAssistant
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    3 errors
    Press any key to continue . . .
    my bad try:
    Code:
    if(c.usingBow && usingCross && c.usingMagic && usingOtherRangeWeapons) {
    					c.getPA().followPlayer();
    					c.stopMovement();
    		} else {
    					c.followId = 0;
    					c.followId2 = 0; // this should be i but it's not declared
    		}
    Reply With Quote  
     

  7. #7  
    Donator

    Join Date
    Nov 2012
    Posts
    790
    Thanks given
    47
    Thanks received
    42
    Rep Power
    17
    Quote Originally Posted by Fire Cape View Post
    my bad try:
    Code:
    if(c.usingBow && usingCross && c.usingMagic && usingOtherRangeWeapons) {
    					c.getPA().followPlayer();
    					c.stopMovement();
    		} else {
    					c.followId = 0;
    					c.followId2 = 0; // this should be i but it's not declared
    		}
    Code:
    src\server\model\players\CombatAssistant.java:3494: error: cannot find symbol
                    if(c.usingBow && usingCross && c.usingMagic && usingOtherRangeWe
    apons) {
                                     ^
      symbol:   variable usingCross
      location: class CombatAssistant
    src\server\model\players\CombatAssistant.java:3494: error: cannot find symbol
                    if(c.usingBow && usingCross && c.usingMagic && usingOtherRangeWe
    apons) {
                                                                   ^
      symbol:   variable usingOtherRangeWeapons
      location: class CombatAssistant
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 errors
    Press any key to continue . . .
    Reply With Quote  
     

  8. #8  
    Registered Member

    Join Date
    Feb 2010
    Posts
    3,187
    Thanks given
    1,124
    Thanks received
    834
    Discord
    View profile
    Rep Power
    1514
    Quote Originally Posted by Relentless View Post
    Code:
    src\server\model\players\CombatAssistant.java:3494: error: cannot find symbol
                    if(c.usingBow && usingCross && c.usingMagic && usingOtherRangeWe
    apons) {
                                     ^
      symbol:   variable usingCross
      location: class CombatAssistant
    src\server\model\players\CombatAssistant.java:3494: error: cannot find symbol
                    if(c.usingBow && usingCross && c.usingMagic && usingOtherRangeWe
    apons) {
                                                                   ^
      symbol:   variable usingOtherRangeWeapons
      location: class CombatAssistant
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 errors
    Press any key to continue . . .
    The problem is those two variables are only declared under attacknpc and attackplayer.
    Reply With Quote  
     

  9. #9  
    Donator

    Join Date
    Nov 2012
    Posts
    790
    Thanks given
    47
    Thanks received
    42
    Rep Power
    17
    Quote Originally Posted by Fire Cape View Post
    The problem is those two variables are only declared under attacknpc and attackplayer.
    Add my skype? kyle.talbot4 or my teamveiwer
    798 638 173
    7938
    Reply With Quote  
     

  10. #10  
    Donator

    Join Date
    Nov 2012
    Posts
    790
    Thanks given
    47
    Thanks received
    42
    Rep Power
    17
    ? ? ?
    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. Replies: 6
    Last Post: 12-27-2012, 05:11 PM
  2. Attempting GWD errors
    By Diverse Reality in forum Help
    Replies: 0
    Last Post: 04-07-2011, 05:27 AM
  3. attempting to learn java
    By Simon in forum Application Development
    Replies: 3
    Last Post: 01-09-2010, 11:39 PM
  4. Attempting to make you a GameFrame?
    By Muffins in forum Graphics
    Replies: 2
    Last Post: 07-19-2008, 02:00 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
  •