Skip to main content

expected and another error

2 replies [Last post]
kilermage
Offline
Joined: 2007-12-24

I'm sort of new to java. I know how to fix some errors, just not " expected" and "class, interface, or enum expected" error. Someone help me please.

error:

theiving.java:3: expected
public void theiving(playerId) {
^
theiving.java:6: illegal start of expression
public void TheifStall2(String stallName, String message, int lvlReq, int XPamou
nt, int item, int itemAmount, int delay, int emote) {
^
theiving.java:156: illegal start of type
if ((c.objectID == 4462))
^
theiving.java:156: expected
if ((c.objectID == 4462))
^
theiving.java:174: illegal start of type
if ((c.objectID == 4463))
^
theiving.java:174: expected
if ((c.objectID == 4463))
^
theiving.java:193: illegal start of type
if (c.NPCID == 7) { //THEIVING farmer
^
theiving.java:193: expected
if (c.NPCID == 7) { //THEIVING farmer
^
theiving.java:200: illegal start of type
} else if (c.NPCID == 4) { //THEIVING woman
^
theiving.java:200: expected
} else if (c.NPCID == 4) { //THEIVING woman
^
theiving.java:207: illegal start of type
} else if (c.NPCID == 15) { //THEIVING warrior gaurd
^
theiving.java:207: expected
} else if (c.NPCID == 15) { //THEIVING warrior gaurd
^
theiving.java:214: illegal start of type
} else if (c.NPCID == 20) { //THEIVING pala
^
theiving.java:214: expected
} else if (c.NPCID == 20) { //THEIVING pala
^
theiving.java:225: class, interface, or enum expected
}→
^
Here is the class:

public class theiving {

public void theiving(playerId) {
client c = (client) server.playerHandler.players[playerId];
public int stealtimer;

public void TheifStall2(String stallName, String message, int lvlReq, int XPamount, int item, int itemAmount, int delay, int emote) {

if(c.playerLevel[17] >= lvlReq) {
c.setAnimation(emote);
c.sendMessage(message);
c.addItem(item, itemAmount);
c.addSkillXP(XPamount, 17);
c.actionTimer = delay;
}
else if(c.playerLevel[17] < lvlReq) {
c.sendMessage("You need a theiving level of "+lvlReq+" to theif from this stall.");
}
}
public void pickpocking() {
if(stealtimer <= 0 && c.EntangleDelay <= 0){
if(misc.random(6) <= 3) {
robman();
c.EntangleDelay = 4;
stealtimer = 15;
c.setAnimation(881);
c.updateRequired = true;
c.appearanceupdateRequired = true;
} else if (misc.random(6) >= 4) {
robmanfail();
c.stillgfx(348, c.absY, c.absX, 100);
c.setAnimation(424);
c.sendMessage("you failed to pick-pock him!");
}
} else if(stealtimer >= 1) {
c.sendMessage("Slow down!");
} else if(c.EntangleDelay >= 1) {
c.sendMessage("You can't pick-pock now because you are stunned!");
}
}
public void pickpocking2() {
if(stealtimer <= 0 && c.EntangleDelay <= 0){
if(misc.random(6) <= 3) {
robfarmer();
c.EntangleDelay = 4;
stealtimer = 20;
c.setAnimation(881);
c.updateRequired = true;
c.appearanceupdateRequired = true;
} else if (misc.random(6) >= 4) {
robmanfail();
c.stillgfx(348, c.absY, c.absX, 100);
c.setAnimation(424);
c.sendMessage("you failed to pick-pock her!");
}
} else if(stealtimer >= 1) {
c.sendMessage("Slow down!");
} else if(c.EntangleDelay >= 1) {
c.sendMessage("You can't pick-pock now because you are stunned!");
}
}
public void pickpocking3() {
if(stealtimer <= 0 && c.EntangleDelay <= 0){
if(misc.random(6) <= 3) {
robwoman();
c.EntangleDelay = 4;
stealtimer = 15;
c.setAnimation(881);
c.updateRequired = true;
c.appearanceupdateRequired = true;
} else if (misc.random(6) >= 4) {
robmanfail();
c.stillgfx(348, c.absY, c.absX, 100);
c.setAnimation(424);
c.sendMessage("you failed to pick-pock her!");
}
} else if(stealtimer >= 1) {
c.sendMessage("Slow down!");
} else if(c.EntangleDelay >= 1) {
c.sendMessage("You can't pick-pock now because you are stunned!");
}
}
public void pickpocking4() {
if(stealtimer <= 0 && c.EntangleDelay <= 0){
if(misc.random(6) <= 3) {
robpala();
c.EntangleDelay = 4;
stealtimer = 15;
c.setAnimation(881);
c.updateRequired = true;
c.appearanceupdateRequired = true;
} else if (misc.random(6) >= 4) {
robmanfail();
c.stillgfx(348, c.absY, c.absX, 100);
c.setAnimation(424);
c.sendMessage("you failed to pick-pock him!");
}
} else if(stealtimer >= 1) {
c.sendMessage("Slow down!");
} else if(c.EntangleDelay >= 1) {
c.sendMessage("You can't pick-pock now because you are stunned!");
}
}
public void robman()
{
c.sendMessage("You pickpocket the farmer");
c.addItem(995, 100);
c.addSkillXP(100, 17);
}
public void robmanfail()
{
c.EntangleDelay = 30;
}
public void thieffail()
{
c.EntangleDelay = 30;
}
public void robfarmer()
{
c.sendMessage("You pickpocket the herbalist");
c.addItem(Item.randomherb(), 1);
c.addSkillXP(200, 17);

}
public void robwoman()
{
c.sendMessage("You pickpocket the warrior woman");
c.addItem(Item.randomfarm(), misc.random(3));
c.addSkillXP(350, 17);

}
public void robpala()
{
c.sendMessage("You pickpocket the paladin guard");
c.addItem(Item.randomfly(), misc.random(12));
c.addSkillXP(550, 17);
}
//object stuff
if ((c.objectID == 4462))
{
if(c.actionTimer <= 0 && c.EntangleDelay <= 0) {
if(misc.random(4) <= 2) {
TheifStall2("table", "You Steal 50gp!", 1, 40, Item.randomarmour(), 50, 40, 0x340); // keep off plz ... i loot i
}else if (misc.random(4) >= 3) {
thieffail();
c.stillgfx(348, c.absY, c.absX, 100);
c.setAnimation(424);
c.sendMessage("you failed to steal from the table!");
}
} else if(c.actionTimer >= 1) {
//c.sendMessage("Slow down!");
} else if(c.EntangleDelay >= 1) {
c.sendMessage("You can't thief the table now because you are stunned!");
}
}
if ((c.objectID == 4463))
{
if(c.actionTimer <= 0 && c.EntangleDelay <= 0) {
if(misc.random(4) <= 1) {
TheifStall2("table", "You Steal 2 Rune Arrows", 1, 50, Item.randompot(), 2, 40, 0x340);
}else if (misc.random(4) >= 2) {
thieffail();
c.stillgfx(348, c.absY, c.absX, 100);
c.setAnimation(424);
c.sendMessage("you failed to steal from the table!");
}
} else if(c.actionTimer >= 1) {
//c.sendMessage("Slow down!");
} else if(c.EntangleDelay >= 1) {
c.sendMessage("You can't thief the table now because you are stunned!");
}
}
//end of object stuff
//npc stuff
if (c.NPCID == 7) { //THEIVING farmer
if(c.playerLevel[17] >= 30) {
c.PutNPCCoords = true;
pickpocking();
} else if(c.playerLevel[17] <= 29) {
c.sendMessage("You need a thieving lvl of 30 to pickpock the farmer");
}
} else if (c.NPCID == 4) { //THEIVING woman
if(c.playerLevel[17] >= 45) {
c.PutNPCCoords = true;
pickpocking2();
} else if(c.playerLevel[17] <= 44) {
c.sendMessage("You need a thieving lvl of 45 to pickpock the woman");
}
} else if (c.NPCID == 15) { //THEIVING warrior gaurd
if(c.playerLevel[17] >= 55) {
c.PutNPCCoords = true;
pickpocking3();
} else if(c.playerLevel[17] <= 54) {
c.sendMessage("You need a thieving lvl of 55 to pickpock the warrior woman");
}
} else if (c.NPCID == 20) { //THEIVING pala
if(c.playerLevel[17] >= 65) {
c.PutNPCCoords = true;
pickpocking4();
} else if(c.playerLevel[17] <= 64) {
c.sendMessage("You need a thieving lvl of 65 to pickpock the paladin guard");
}
//end of npc stuff

}
}
}

Those are the errors I get.... Please someone help me.

Message was edited by: kilermage

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gluk
Offline
Joined: 2009-04-20

Your error might have already a solution at this site: http://iderror.com/category/errors/java/

tarbo
Offline
Joined: 2006-12-18

It could be anything, from a mismatched brace to a missing declaration. Check the [url=http://java.sun.com/docs/books/tutorial/]Java Tutorial[/url] for basics, and consider using an IDE such as Eclipse, JBuilder, or NetBeans.