Are you using an event, if so you need to stop it upon depleting the rock of resource.
If no post your class so we can see code.
|
|
Alright so I attempt to mine a rock, and also while my character is swinging the pickaxe around trying to mine it, I right click on the rock. Once my character successfully mined the ore, I just finish my right click by attempting to mine the rock again 9while it's empty). My character will then start mining the rock EVEN THOUGH it's empty, and not refilled. Does anyone know a fix for that please?
Are you using an event, if so you need to stop it upon depleting the rock of resource.
If no post your class so we can see code.
Is this what you mean?
Code:CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() { @Override public void execute(CycleEventContainer container) { c.getItems().addItem(1436, 1); c.sendMessage("You manage to mine some "+ c.getItems().getItemName(1436).toLowerCase()+"."); c.getPA().addSkillXP(5 * MINING_XP, c.playerMining); c.startAnimation(getAnimation(c)); if(!hasPickaxe(c)) { c.sendMessage("You need a Mining pickaxe which you need a Mining level to use."); resetMining(c); container.stop(); } if(!c.stopPlayerSkill) { resetMining(c); container.stop(); } if(!noInventorySpace(c, "mining")) { resetMining(c); container.stop(); } } @Override public void stop() { } }, 2); }
Code:CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() { @Override public void execute(CycleEventContainer container) { c.getItems().addItem(1436, 1); c.sendMessage("You manage to mine some "+ c.getItems().getItemName(1436).toLowerCase()+"."); c.getPA().addSkillXP(5 * MINING_XP, c.playerMining); c.startAnimation(getAnimation(c)); <--- Stop the event here and see what happens. if(!hasPickaxe(c)) { c.sendMessage("You need a Mining pickaxe which you need a Mining level to use."); resetMining(c); container.stop(); } if(!c.stopPlayerSkill) { resetMining(c); container.stop(); } if(!noInventorySpace(c, "mining")) { resetMining(c); container.stop(); } } @Override public void stop() { } }, 2); }
Still occuring =\
Post your full mining class becuase what you posted was for rune ess and that should be a continuous event till you walk away because it has unlimited resources.
My bad about the rune ess, here's the good one
If it's still not good I will paste the whole mining classCode:public static void attemptData(final Client c, final int object, final int obX, final int obY) { if(!noInventorySpace(c, "mining")) { resetMining(c); return; } if(!hasRequiredLevel(c, 14, getLevelReq(c, object), "mining", "mine here")) { return; } if(!hasPickaxe(c)) { c.sendMessage("You need a Mining pickaxe which you need a Mining level to use."); return; } c.sendMessage("You swing your pick at the rock."); if(c.playerSkilling[14]) { return; } c.playerSkilling[14] = true; c.stopPlayerSkill = true; c.startAnimation(getAnimation(c)); for(int i = 0; i < data.length; i++) { if(object == data[i][0]) { c.playerSkillProp[14][0] = data[i][1]; c.playerSkillProp[14][1] = data[i][3]; c.startAnimation(getAnimation(c)); CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() { @Override public void execute(CycleEventContainer container) { if(c.playerSkillProp[14][0] > 0) { c.getItems().addItem(c.playerSkillProp[14][0], 1); c.sendMessage("You manage to mine some "+ c.getItems().getItemName(c.playerSkillProp[14][0]).toLowerCase()+"."); } if(c.playerSkillProp[14][1] > 0) { c.getPA().addSkillXP(c.playerSkillProp[14][1] * MINING_XP, c.playerMining); Server.objectHandler.createAnObject(c, 451, obX, obY); } if(!hasPickaxe(c)) { c.sendMessage("You need a Mining pickaxe which you need a Mining level to use."); resetMining(c); container.stop(); } if(!c.stopPlayerSkill) { resetMining(c); container.stop(); } if(!noInventorySpace(c, "mining")) { resetMining(c); container.stop(); } resetMining(c); container.stop(); } @Override public void stop() { } }, getTimer(c, object)); CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() { @Override public void execute(CycleEventContainer container) { Server.objectHandler.createAnObject(c, object, obX, obY); container.stop(); } @Override public void stop() { } }, getTimer(c, object) + getRespawnTime(c, object)); CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() { @Override public void execute(CycleEventContainer container) { if(c.playerSkilling[14]) { c.startAnimation(getAnimation(c)); } if(!c.stopPlayerSkill || !c.playerSkilling[14]) { resetMining(c); container.stop(); } } @Override public void stop() { } }, 15); } } }
Wow that just a big mess.
Why are you running 2 events?
Yeah I know it is, it was like that lol, been trying to fix this right click problem but without luck =\
bump
| « PI - How to add a timer at fletching bows | [PI] Quest Tab » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |