kilermage 0 Newbie Poster

Thanks for all the help guys, I was able to figure it out.

kilermage 0 Newbie Poster

ok how would I go along of adding them ?

kilermage 0 Newbie Poster

Ok here I uploaded the imports of client.java and from Commands.java along w. the setup of folders and files.

kilermage 0 Newbie Poster

Thanks a lot, what its doing is calling the line like ex: parseincomingpackets(); but its not in the file, its in the client.java so I get it up to be called like

public void example(client c) {
c.parseincomingpackets();}

and in the client.java file its written like ex:

public void example2() {
src.handling.example(this);
}

and the imports are this ex:

import src.*;
import java.io.*;
import java.util.StringTokenizer;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.security.*;
import src.client;

I uploaded a pic to better explain what im trying to say. EDIT: Btw what you see in the pic is line 19, the first error that is in the problems tab and pretty much all the errors are exactly the same.

kilermage 0 Newbie Poster

Thats the problems tab you requested.

kilermage 0 Newbie Poster

Well I normally run the program through a .bat and I wanted to see how it'll run on the Eclipse, but that's what appears when I run it through there.

EDIT: Also the line thats highlighted in the pic is the line that calls out the error.

kilermage 0 Newbie Poster

Click Here

This is what I get when I run the code. Please help me fix this.

EDIT: A lot has changed since 2008 so idk how to upload the image so I just made a link for it.

kilermage 0 Newbie Poster

Thanks I already solved this problem.

kilermage 0 Newbie Poster

Im trying to make the run.bat file read the .class files from the folder classes/src. But before I didn't package my .java files and the created .class files were found in /classes. But now that I packaged my .java files, the newly created .class files are being read from inside the folder classes/src. And when I take them out from there I get an error.

this is what I have in the run.bat

@echo off
title Run

java -Xmx500M -cp .;./classes/; server

pause

How can I make it read from classes/src?

kilermage 0 Newbie Poster
Running Compiler
--------------------------------------
server.java:52: cannot access handling.Handlers.CommandManager
bad class file: .\handling\Handlers\CommandManager.java
file does not contain class handling.Handlers.CommandManager
Please remove or make sure it appears in the correct subdirectory of the classpath.
        public static CommandManager CommandManager = null;
                      ^
Press any key to continue . . .

What I did was I tried to package the file CommandManager. I fixed the other errors and this is the only error idk how to fix. Can someone help?

kilermage 0 Newbie Poster

oh wow. Thanks, it fixed the nullpointer error.

kilermage 0 Newbie Poster

I didn't do

c = new client()

Here is NPCDialogue class.

import java.io.*;
import java.util.StringTokenizer;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.security.*;

public class NPCDialogue {

public client c;
public Player P;

	public void UpdateNPCChat() {
		/*c.sendFrame126("", 4902);
		c.sendFrame126("", 4903);
		c.sendFrame126("", 4904);
		c.sendFrame126("", 4905);
		c.sendFrame126("", 4906);*/
		c.sendFrame126("", 976);
		switch (P.NpcDialogue) {
			case 1:
				/*c.sendFrame200(4901, 554);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4902);
				c.sendFrame126("Good day, how can I help you?", 4904);
				c.sendFrame75(P.NpcTalkTo, 4901);
				c.sendFrame164(4900);
				*/
				c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("Good day, how can I help you?", 4885);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				P.NpcDialogueSend = true;
				break;
			case 2:
				c.sendFrame171(1, 2465);
				c.sendFrame171(0, 2468);
				c.sendFrame126("What would you like to say?", 2460);
				c.sendFrame126("I'd like to access my bank account, please.", 2461);
				c.sendFrame126("I'd like to check my PIN settings.", 2462);
				c.sendFrame164(2459);
				P.NpcDialogueSend = true;
				break;
			case 3:
				c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("Do you want to buy some runes?", 4885);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				P.NpcDialogueSend = true;
				break;
			case 4:
				c.sendFrame171(1, 2465);
				c.sendFrame171(0, 2468);
				c.sendFrame126("Select an Option", 2460);
				c.sendFrame126("Yes please!", 2461);
				c.sendFrame126("Oh it's a rune shop. No thank you, then.", 2462);
				c.sendFrame164(2459);
				P.NpcDialogueSend = true;
				break;
			case 5:
				c.sendFrame200(615, 974);
				c.sendFrame126(P.playerName, 975);
				c.sendFrame126("Oh it's a rune shop. No thank you, then.", 976);
				c.sendFrame185(974);
				c.sendFrame164(973);
				P.NpcDialogueSend = true;
				break;
			case 6:
				c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("Well, if you find somone who does want runes, please", 4885);
				c.sendFrame126("send them my way.", 4886);
				c.sendFrame75(P.NpcTalkTo, 4883);
				c.sendFrame164(4882);
				P.NpcDialogueSend = true;
				break;
			case 7: /*NEED TO CHANGE FOR GUARD*/
				c.sendFrame200(4883, 591);
				c.sendFrame126(c.GetNpcName(P.NpcTalkTo), 4884);
				c.sendFrame126("Well, if you find somone who does want runes, please", 4885);
				c.sendFrame126("send them my way.", …
kilermage 0 Newbie Poster

Well c. calls for client.java

kilermage 0 Newbie Poster

I run the program, from what I see the game runs fine. Then when I click on the object that suppose to send a dialogue, it disconnects me and throws this error in the run.batch window.

Exception in thread "main" java.lang.NullPointerException
        at NPCDialogue.UpdateNPCChat(NPCDialogue.java:18)
        at client.process(client.java:8471)
        at PlayerHandler.process(PlayerHandler.java:137)
        at server.main(server.java:55)

Here is what I have in those files, I wont put the PlayerHandler.java or server.java because thats just calling the file NPCDialogue.java.

This is what is inside NPCDialogue.java.

public client c;
public Player P;

	public void UpdateNPCChat() {
		/*c.sendFrame126("", 4902);
		c.sendFrame126("", 4903);
		c.sendFrame126("", 4904);
		c.sendFrame126("", 4905);
		c.sendFrame126("", 4906);*/
That's line 18->		c.sendFrame126("", 976);
		switch (P.NpcDialogue) {
		}
	}

Note: I would of posted the entire void, but its too big.

This is what I have in Client.java.

if (NpcDialogue > 0 && NpcDialogueSend == false) {
This is line 8471->			server.NPCDialogue.UpdateNPCChat();
		}
public void sendFrame126(String s, int id) {
	if (id <= 20000) {
		if (InterfaceText[id] != null && InterfaceText[id].equals(s)) {
			return;
		} else {
			InterfaceText[id] = s;
		}
	}
		outStream.createFrameVarSizeWord(126);
		outStream.writeString(s);
		outStream.writeWordA(id);
		outStream.endFrameVarSizeWord();
		flushOutStream();
	}

--------------------------------------------------------------------------------------

This is another java.lang.nullpointer exception error I get. This happens when I click on the item I want to eat to heal myself.

java.lang.NullPointerException at CheckSkillHandler.CheckForSkillUse3(CheckSkillHandler.java:1382)
at PacketHandler.parseIncomingPackets(PacketHandler.java:800)
        at client.parseIncomingPackets(client.java:8526)
        at client.packetProcess(client.java:8510)
        at client.process(client.java:8480)
        at PlayerHandler.process(PlayerHandler.java:137)
        at server.main(server.java:55)
pimpscape Server [fatal] - exception

This is what I have for CheckSkillHandler.java.

case 385: //Shark
This is line 1382->				c.healing[1] = 20;
				c.healing[2] = 20;
				c.healing[3] = …
kilermage 0 Newbie Poster

I wrote up a CombatHandler class.

Here is what the begining:

public class CombatHandler extends client {

But when I compile I get this error:

Running Compiler
--------------------------------------
CombatHandler.java:3: cannot find symbol
symbol  : constructor client()
location: class client
public class CombatHandler extends client {
       ^
Note: stream.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
Press any key to continue . . .

Can anyone help?

kilermage 0 Newbie Poster

I found out that case 145 has more of { than }, but idk where to add the last }, If I just add it to the end of the code I get 100 errors. Case 117 is equal by { and }. So the problem is case 145. Can you find out where to add the final }?

kilermage 0 Newbie Poster

Ah Ok I get you.

kilermage 0 Newbie Poster

I don't get you.

kilermage 0 Newbie Poster

Yes it is, but the switch statement is huge I don't think it will can fit in this. But I will put the case before this one.

Case before case 117:

case 145: //remove item (opposite for wearing) - bank 1 item - value of item
interfaceID = inStream.readUnsignedWordA();
int removeSlot = inStream.readUnsignedWordA();
int removeID = inStream.readUnsignedWordA();

if (interfaceID == 1688) {
if (playerEquipment[removeSlot] == removeID) {
remove(removeID , removeSlot);
} else if (interfaceID == 5064) { //remove from bag to bank
bankItem(removeID , removeSlot, 1);
} else if (interfaceID == 5382) { //remove from bank
fromBank(removeID , removeSlot, 1);
} else if (interfaceID == 3322) { //remove from bag to trade window
if(removeID == 6556) {
sendMessage("You cannot trade this item.");
} else {
tradeItem(removeID , removeSlot, 1);
}
} else if (interfaceID == 3415) { //remove from trade window
fromTrade(removeID, removeSlot, 1);
} else if (interfaceID == 3823) { //Show value to sell items
if (Item.itemSellable[removeID] == false) {
sendMessage("I cannot sell "+GetItemName(removeID)+".");
} else {
boolean IsIn = false;
if (server.shopHandler.ShopSModifier[MyShopID] > 1) {
for (int j = 0; j <= server.shopHandler.ShopItemsStandard[MyShopID]; j++) {
if (removeID == (server.shopHandler.ShopItems[MyShopID][j] - 1)) {
IsIn = true;
break;
}
}
} else {
IsIn = true;
}
if (IsIn == false) {
sendMessage("You cannot sell "+GetItemName(removeID)+" in this store.");
} else {
int ShopValue = (int)Math.floor(GetItemShopValue(removeID, 1, removeSlot));
String ShopAdd = "";
if (ShopValue <= 1){
ShopValue = (int)Math.floor(GetItemShopValue(removeID, 0, removeSlot));
}
if (ShopValue >= 1000 && ShopValue …
kilermage 0 Newbie Poster

I get an error about "orphaned case". So this is the error. Can you help me on what I did wrong?

client.java: 8643: orphaned case
case 117: // bank 5 items - sell 1 item
^

This is the code:

case 117:	//bank 5 items - sell 1 item
interfaceID = inStream.readSignedWordBigEndianA();
removeID = inStream.readSignedWordBigEndianA();
removeSlot = inStream.readSignedWordBigEndian();

//println_debug("RemoveItem 5: "+removeID +" InterID: "+interfaceID +" slot: "+removeSlot );

if (interfaceID == 5064) { //remove from bag to bank
bankItem(removeID , removeSlot, 5);
} else if (interfaceID == 5382) { //remove from bank
fromBank(removeID , removeSlot, 5);
} else if (interfaceID == 3322) { //remove from bag to trade window
if(isUntradable(removeID))
sendMessage("You cannot trade this item"); 
else
tradeItem(removeID , removeSlot, 5);
} else if (interfaceID == 3415) { //remove from trade window
fromTrade(removeID, removeSlot, 5);
} else if (interfaceID == 3823) { //Show value to sell items
sellItem(removeID, removeSlot, 1);
} else if (interfaceID == 3900) { //Show value to buy items
buyItem(removeID, removeSlot, 1);
} 
break;
kilermage 0 Newbie Poster

I have fixed the errors and the handler works correctly. Thank you for those who tried to help, but a friend of mine helped me.

kilermage 0 Newbie Poster

I need help on these errors I get, I don't know how to fix them. Can someone help me please.
errors:
theiving.java:6: <identifier> expected
public void theiving(playerId) {
^
theiving.java:8: illegal start of expression
public int stealtimer;
^
theiving.java:143: illegal start of type
if ((c.objectID == 4462))
^
theiving.java:143: <identifier> expected
if ((c.objectID == 4462))
^
theiving.java:160: illegal start of type
if ((c.objectID == 4463))
^
theiving.java:160: <identifier> expected
if ((c.objectID == 4463))
^
theiving.java:179: illegal start of type
if (c.NPCID == 7) { //THEIVING farmer
^
theiving.java:179: <identifier> expected
if (c.NPCID == 7) { //THEIVING farmer
^
theiving.java:186: illegal start of type
} else if (c.NPCID == 4) { //THEIVING woman
^
theiving.java:186: <identifier> expected
} else if (c.NPCID == 4) { //THEIVING woman
^
theiving.java:193: illegal start of type
} else if (c.NPCID == 15) { //THEIVING warrior gaurd
^
theiving.java:193: <identifier> expected
} else if (c.NPCID == 15) { //THEIVING warrior gaurd
^
theiving.java:200: illegal start of type
} else if (c.NPCID == 20) { //THEIVING pala
^
theiving.java:200: <identifier> expected
} else if (c.NPCID == 20) { //THEIVING pala
^
theiving.java:211: class, interface, or enum expected
}→
^
class:

import java.io.*;
import java.util.*;

public class theiving {

public void theiving(playerId) …