Thread: Think You can Fix This command?

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 Think You can Fix This command? 
    Registered Member
    Join Date
    Apr 2009
    Posts
    79
    Thanks given
    0
    Thanks received
    0
    Rep Power
    5
    Ok I have tried everything I can think of to get this command to work. No matter what I do I cannot fix it. So here comes your chance to fix it and be rewarded with rep+.

    Some quick info about server. RichScape Based. Trying to edit a Delta command into command.java in Richscape v4 base.

    Here is Starting code

    Code:
    if(command.startsWith("newnpc") && playerRights > 2){
                    try 
    					{
                        int newNPC = Integer.parseInt(command.substring(7));
                        if (newNPC >= 0)
    						{
    		server.npcHandler.spawnANPC(newNPC, absX, absY, heightLevel);
    					} else {
    						sM("No such NPC.");
    					}
    				} catch(Exception e) {
    					sM("Wrong Syntax! Use as ::newnpc 1");
    				}
    			int npcid = Integer.parseInt(command.substring(7));
    			int absx = absX;
    			int absy = absY;
    appendToAutoSpawn2(npcid, absx, absy, absX + 2, absY + 2, absX - 2, absY - 2);
    sM("Npc added.");
    sM("AbsX: "+absX+" AbsY: "+absY+"");
    }
    Here is code with what I KNOW has to be changed.

    Code:
    if(command.startsWith("newnpc") && playerRights > 2){
                    try 
    					{
                        int newNPC = Integer.parseInt(command.substring(7));
                        if (newNPC >= 0)
    						{
    		server.npcHandler.spawnANPC(newNPC, absX, absY, heightLevel);
    					} else {
    						Send("No such NPC.");
    					}
    				} catch(Exception e) {
    					sM("Wrong Syntax! Use as ::newnpc 1");
    				}
    			int npcid = Integer.parseInt(command.substring(7));
    			int absx = absX;
    			int absy = absY;
    appendToAutoSpawn2(npcid, absx, absy, absX + 2, absY + 2, absX - 2, absY - 2);
    Send("Npc added.");
    Send("AbsX: "+absX+" AbsY: "+absY+"");
    }
    I know a few other things that need to be changed but best leave it so Im not mistaken.

    Here is a working sample code from the same Java file for referance.

    Code:
    if (c.Rights > 1) {
    			if(cmd.equalsIgnoreCase("master")) {
    				for(int i = 0; i < 24; i++) {
    					c.addSkillXP(15000000, i);
    				}
    			}
    			if (cmd.equalsIgnoreCase("pure")) {
    				c.addSkillXP(15000000, 0); //attack
    				c.addSkillXP(0, 1); //defense
    				c.addSkillXP(15000000, 2); //strength
    				c.addSkillXP(15000000, 3); //hitpoints
    				c.addSkillXP(15000000, 4); //range
    				c.addSkillXP(0, 5); //prayer
    				c.addSkillXP(15000000, 6); //mage
    				c.Send(""+ c.playerName +" is now a pure!"); 
    			}
    If you still dont get what I am asking. I am trying to get the original code working on my server without any errors. If someone knows the fix please try to post the new code and/or post how I should fix it. Thanks in advance to the genious that can help.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    May 2009
    Posts
    44
    Thanks given
    0
    Thanks received
    1
    Rep Power
    5
    /sigh change command.startsWith to cmd.startsWith. Maybe if you read the code you might find the problem.

    Make sure you have the appendToAutospawn2() in your server aswell.
    Reply With Quote  
     

  3. #3  
    cheesegromit
    Guest
    Quote Originally Posted by Shinto-Ken View Post
    /sigh change command.startsWith to cmd.startsWith. Maybe if you read the code you might find the problem.

    Make sure you have the appendToAutospawn2() in your server aswell.
    he said its impossible to figure out LOL
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Apr 2009
    Posts
    79
    Thanks given
    0
    Thanks received
    0
    Rep Power
    5
    Quote Originally Posted by Shinto-Ken View Post
    /sigh change command.startsWith to cmd.startsWith. Maybe if you read the code you might find the problem.

    Make sure you have the appendToAutospawn2() in your server aswell.
    I have done both, and have it not working still. Thanks alot for the response though. I was just thinking, I dont think I had the AppendToAutospawn there once I figured out the cmd.startsWith
    Let me try once more with both commands and try again.

    Again thanks a bunch for response

    ---------- Post added at 11:54 PM ---------- Previous post was at 11:53 PM ----------

    Quote Originally Posted by cheesegromit View Post
    he said its impossible to figure out LOL
    Just said that to get some help = )
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    May 2009
    Posts
    44
    Thanks given
    0
    Thanks received
    1
    Rep Power
    5
    Quote Originally Posted by cheesegromit View Post
    he said its impossible to figure out LOL
    Dis cmd 2 prolar fer anywun. It might actually help if he posted errors from his compile.bat though >.>
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Apr 2009
    Posts
    79
    Thanks given
    0
    Thanks received
    0
    Rep Power
    5
    I really keep getting dif compiler results so check this out and mabey recode what needs to be coded? Also mabey this is supposed to go into a designated section for command.java?

    Code:
    if (c.Rights > 1) {
    if(cmd.startsWith("newnpc")) {
                    try 
    					{
                        int newNPC = Integer.parseInt(command.substring(7));
                        if (newNPC >= 0)
    						{
    		server.npcHandler.spawnANPC(newNPC, absX, absY, heightLevel);
    					} else {
    						Send("No such NPC.");
    					}
    				} catch(Exception e) {
    					Send("Wrong Syntax! Use as ::newnpc 1");
    				}
    			int npcid = Integer.parseInt(command.substring(7));
    			int absx = absX;
    			int absy = absY;
    appendToAutoSpawn2(npcid, absx, absy, absX + 2, absY + 2, absX - 2, absY - 2);
    Send("Npc added.");
    Send("AbsX: "+absX+" AbsY: "+absY+"");
    }
    Anything I have coded wrong or need to delete or modify?
    Reply With Quote  
     

  7. #7  
    Austin_
    Guest
    How u gunna rep som1 when you have 0 rep? Rofls...
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    May 2009
    Posts
    44
    Thanks given
    0
    Thanks received
    1
    Rep Power
    5
    I can't help until you post the errors.
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Apr 2009
    Posts
    79
    Thanks given
    0
    Thanks received
    0
    Rep Power
    5
    Here is my current error reading
    Code:
    Locating Java please Wait
    .\Command.java:83: cannot find symbol
    symbol  : variable command
    location: class Command
                        int newNPC = Integer.parseInt(command.substring(7));
                                                      ^
    .\Command.java:86: cannot find symbol
    symbol  : variable absX
    location: class Command
                    server.npcHandler.spawnANPC(newNPC, absX, absY, heightLevel);
                                                        ^
    .\Command.java:86: cannot find symbol
    symbol  : variable absY
    location: class Command
                    server.npcHandler.spawnANPC(newNPC, absX, absY, heightLevel);
                                                              ^
    .\Command.java:86: cannot find symbol
    symbol  : variable heightLevel
    location: class Command
                    server.npcHandler.spawnANPC(newNPC, absX, absY, heightLevel);
                                                                    ^
    .\Command.java:86: package server does not exist
                    server.npcHandler.spawnANPC(newNPC, absX, absY, heightLevel);
                          ^
    .\Command.java:88: cannot find symbol
    symbol  : method Send(java.lang.String)
    location: class Command
                                                    Send("No such NPC.");
                                                    ^
    .\Command.java:91: cannot find symbol
    symbol  : method Send(java.lang.String)
    location: class Command
                                            Send("Wrong Syntax! Use as ::newnpc 1");
    
                                            ^
    .\Command.java:93: cannot find symbol
    symbol  : variable command
    location: class Command
                            int npcid = Integer.parseInt(command.substring(7));
                                                         ^
    .\Command.java:94: cannot find symbol
    symbol  : variable absX
    location: class Command
                            int absx = absX;
                                       ^
    .\Command.java:95: cannot find symbol
    symbol  : variable absY
    location: class Command
                            int absy = absY;
                                       ^
    .\Command.java:96: cannot find symbol
    symbol  : variable absX
    location: class Command
    appendToAutoSpawn2(npcid, absx, absy, absX + 2, absY + 2, absX - 2, absY - 2);
                                          ^
    .\Command.java:96: cannot find symbol
    symbol  : variable absY
    location: class Command
    appendToAutoSpawn2(npcid, absx, absy, absX + 2, absY + 2, absX - 2, absY - 2);
                                                    ^
    .\Command.java:96: cannot find symbol
    symbol  : variable absX
    location: class Command
    appendToAutoSpawn2(npcid, absx, absy, absX + 2, absY + 2, absX - 2, absY - 2);
                                                              ^
    .\Command.java:96: cannot find symbol
    symbol  : variable absY
    location: class Command
    appendToAutoSpawn2(npcid, absx, absy, absX + 2, absY + 2, absX - 2, absY - 2);
                                                                        ^
    .\Command.java:96: cannot find symbol
    symbol  : method appendToAutoSpawn2(int,int,int,<nulltype>,<nulltype>,int,int)
    location: class Command
    appendToAutoSpawn2(npcid, absx, absy, absX + 2, absY + 2, absX - 2, absY - 2);
    ^
    .\Command.java:97: cannot find symbol
    symbol  : method Send(java.lang.String)
    location: class Command
    Send("Npc added.");
    ^
    .\Command.java:98: cannot find symbol
    symbol  : variable absX
    location: class Command
    Send("AbsX: "+absX+" AbsY: "+absY+"");
                  ^
    .\Command.java:98: cannot find symbol
    symbol  : variable absY
    location: class Command
    Send("AbsX: "+absX+" AbsY: "+absY+"");
                                 ^
    .\Command.java:98: cannot find symbol
    symbol  : method Send(java.lang.String)
    location: class Command
    Send("AbsX: "+absX+" AbsY: "+absY+"");
    ^
    19 errors
    Finished Compiling Fatalx Please run server Alex we are all waiting here -.-
    Proatrix Loves you = )
    All credits to Proatrix W00T
    Press any key to continue . . .
    Reply With Quote  
     

  10. #10  
    Teh l337
    Jdiddy's Avatar
    Join Date
    Nov 2007
    Age
    31
    Posts
    2,026
    Thanks given
    262
    Thanks received
    56
    Rep Power
    3567
    Yes



    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •