Thread: [HELP] 718 Toolbelt ERROR Please Help! 718 [HELP]

Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1 [HELP] 718 Toolbelt ERROR Please Help! 718 [HELP] 
    Registered Member
    Join Date
    Jul 2016
    Posts
    25
    Thanks given
    0
    Thanks received
    1
    Rep Power
    11
    Hey Runeserver.
    I have come across an error within my toolbelt. I have my items in my toolbelt and when it comes to: FLETCHING, CUTTING GEMS, WOODCUTTING and MINING; even though my tools are in its place, It tells me : "you dont have the required items to do this." Is there anyone that can help me fix this and make it so everything is working fine? Here is my Toolbelt.java
    Code:
    package com.rs.game.player.content;
    
    import java.io.Serializable;
    import java.util.HashMap;
    import java.util.Map;
    
    import com.rs.game.item.Item;
    import com.rs.game.player.Player;
    
    /**
     * Handles a {@link Player}'s toolbelt.
     * 
     * @author Thomas Le Godais
     * 
     */
    public class ToolBelt implements Serializable {
    
    	private static final long serialVersionUID = 7706200801855080675L;
    	private transient Player player;
    
    	private static final int[] TOOLBELT_ITEMS = new int[] { 946, 1735, 1595, 1755, 1599, 1597, 1733, 1592, 5523, 13431, 307, 309, 311, 301, 303, 1265, 2347, 1351, 590, -1, 8794, 4, 9434, 11065, 1785, 2976, 1594, 5343, 5325, 5341, 5329, 233, 952, 305, 975, 11323, 2575, 2576, 13153, 10150 };
    	private static final int[] CONFIG_IDS = new int[] { 2438, 2439 };
    
    	private Map<Integer, Boolean> items;
    
    	public ToolBelt(Player player) {
    		this.player = player;
    	}
    
    	public void refresh() {
    		if (items == null) {
    			items = new HashMap<Integer, Boolean>();
    			for (int itemId : TOOLBELT_ITEMS) {
    				items.put(itemId, false);
    			}
    		}
    		int[] configValue = new int[CONFIG_IDS.length];
    		for (int i = 0; i < TOOLBELT_ITEMS.length; i++) {
    			if (items.get(TOOLBELT_ITEMS[i]) == null) {
    				continue;
    			}
    			boolean inToolbelt = items.get(TOOLBELT_ITEMS[i]);
    			if (!inToolbelt) {
    				continue;
    			}
    			int index = (i / 20);
    			configValue[index] |= 1 << (i - (index * 20));
    		}
    		for (int i = 0; i < CONFIG_IDS.length; i++) {
    			if (configValue[i] == 0) {
    				continue;
    			}
    			player.getPackets().sendConfig(CONFIG_IDS[i], configValue[i]);
    		}
    	}
    
    	public boolean addItem(Item item) {
    		if (items.get(item.getId()) == null) {
    			return false;
    		}
    		if (items.get(item.getId())) {
    			player.sendMessage("This item is already in your toolbelt.");
    			return false;
    		}
    		items.put(item.getId(), true);
    		player.sendMessage("You add the " + item.getName() + " to your toolbelt.");
    		refresh();
    		return true;
    	}
    
    	public boolean contains(int itemId) {
    		if (items.get(itemId) == null) {
    			return false;
    		}
    		return items.get(itemId);
    	}
    
    	public void setPlayer(Player player) {
    		this.player = player;
    	}
    }
    If I am required to post more code, please let me know and help me fix this! Thanks!
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    May 2013
    Age
    27
    Posts
    414
    Thanks given
    215
    Thanks received
    200
    Rep Power
    137
    Are you checking for the required tool in the toolbelt in the class that handles the skill your training?
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jul 2016
    Posts
    25
    Thanks given
    0
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by ReverendDread View Post
    Are you checking for the required tool in the toolbelt in the class that handles the skill your training?
    Don't know, I'm new to this. All I know is that I cannot mine,woodcut, craft and cut gems even though I have all the tools in my belt. "you dont have the required items to do this " that is the message i get.
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    May 2013
    Age
    27
    Posts
    414
    Thanks given
    215
    Thanks received
    200
    Rep Power
    137
    Post your Fletching class and ill explain it to ya.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Jul 2016
    Posts
    25
    Thanks given
    0
    Thanks received
    1
    Rep Power
    11
    Code:
    package com.rs.game.player.actions;
    
    import java.util.HashMap;
    import java.util.Map;
    
    import com.rs.cache.loaders.ItemDefinitions;
    import com.rs.game.Animation;
    import com.rs.game.Graphics;
    import com.rs.game.item.Item;
    import com.rs.game.player.Player;
    import com.rs.game.player.Skills;
    
    public class Fletching extends Action {
    
    	public static final int KNIFE = 946;
    	public static final int CHISLE = 1755;
    	public static final int BOW_STRING = 1777;
    	public static final int CROSSBOW_STRING = 9438;
    
    	public static enum Fletch {
    
    		/**
    		 * (u)'s and completed bows
    		 */
    
    		REGULAR_BOW(1511, 946, new int[] { 52, 50, 48, 9440 }, new int[] { 1, 5, 10, 9 }, new double[] { 0.33, 5, 10, 6 }, new Animation(6702)),
    
    		STRUNG_SHORT_BOW(50, 1777, new int[] { 841 }, new int[] { 5 }, new double[] { 5 }, new Animation(6678)),
    
    		STRUNG_LONG_BOW(48, 1777, new int[] { 839 }, new int[] { 10 }, new double[] { 10 }, new Animation(6684)),
    
    		OAK_BOW(1521, 946, new int[] { 54, 56, 9442 }, new int[] { 20, 25, 24 }, new double[] { 16.5, 25, 16 }, new Animation(6702)),
    
    		STRUNG_OAK_SHORT_BOW(54, 1777, new int[] { 843 }, new int[] { 20 }, new double[] { 16.5 }, new Animation(6679)),
    
    		STRUNG_OAK_LONG_BOW(56, 1777, new int[] { 845 }, new int[] { 25 }, new double[] { 25 }, new Animation(6685)),
    
    		WILLOW_BOW(1519, 946, new int[] { 60, 58, 9444 }, new int[] { 35, 40, 39 }, new double[] { 33.3, 41.5, 22 }, new Animation(6702)),
    
    		STRUNG_WILLOW_SHORT_BOW(60, 1777, new int[] { 849 }, new int[] { 35 }, new double[] { 33.3 }, new Animation(6680)),
    
    		STRUNG_WILLOW_LONG_BOW(58, 1777, new int[] { 847 }, new int[] { 40 }, new double[] { 41.5 }, new Animation(6686)),
    
    		MAPLE_BOW(1517, 946, new int[] { 64, 62, 9448 }, new int[] { 50, 55, 54 }, new double[] { 50, 58.3, 32 }, new Animation(6702)),
    
    		STRUNG_MAPLE_SHORT_BOW(64, 1777, new int[] { 853 }, new int[] { 50 }, new double[] { 50 }, new Animation(6681)),
    
    		STRUNG_MAPLE_LONG_BOW(62, 1777, new int[] { 851 }, new int[] { 55 }, new double[] { 58.3 }, new Animation(6687)),
    
    		YEW_BOW(1515, 946, new int[] { 68, 66, 9452 }, new int[] { 65, 70, 69 }, new double[] { 67.5, 75, 50 }, new Animation(6702)),
    
    		STRUNG_YEW_SHORT_BOW(68, 1777, new int[] { 857 }, new int[] { 65 }, new double[] { 67.5 }, new Animation(6682)),
    
    		STRUNG_YEW_LONG_BOW(66, 1777, new int[] { 855 }, new int[] { 70 }, new double[] { 75 }, new Animation(6688)),
    
    		MAGIC_BOW(1513, 946, new int[] { 72, 70 }, new int[] { 80, 85 }, new double[] { 83.25, 91.5 }, new Animation(6702)),
    
    		STRUNG_MAGIC_SHORT_BOW(72, 1777, new int[] { 861 }, new int[] { 80 }, new double[] { 83.25 }, new Animation(6683)),
    
    		STRUNG_MAGIC_LONG_BOW(70, 1777, new int[] { 859 }, new int[] { 85 }, new double[] { 91.5 }, new Animation(6689)),
    
    		/**
    		 * Crossbows
    		 */
    
    		U_BRONZE_CBOW(9440, 9420, new int[] { 9454 }, new int[] { 9 }, new double[] { 6 }, new Animation(-1)),
    
    		U_IRON_CBOW(9444, 9423, new int[] { 9457 }, new int[] { 39 }, new double[] { 22 }, new Animation(-1)),
    
    		U_BLURITE_CBOW(9442, 9422, new int[] { 9456 }, new int[] { 24 }, new double[] { 16 }, new Animation(-1)),
    
    		U_STEEL_CBOW(9446, 9425, new int[] { 9459 }, new int[] { 46 }, new double[] { 27 }, new Animation(-1)),
    
    		U_MITHRIL_CBOW(9448, 9427, new int[] { 9461 }, new int[] { 54 }, new double[] { 32 }, new Animation(-1)),
    
    		U_ADAMANT_CBOW(9450, 9429, new int[] { 9463 }, new int[] { 61 }, new double[] { 41 }, new Animation(-1)),
    
    		U_RUNITE_CBOW(9452, 9431, new int[] { 9465 }, new int[] { 69 }, new double[] { 50 }, new Animation(-1)),
    
    		BRONZE_CBOW(9454, 9438, new int[] { 9174 }, new int[] { 9 }, new double[] { 6.0 }, new Animation(6671)),
    
    		IRON_CBOW(9457, 9438, new int[] { 9177 }, new int[] { 39 }, new double[] { 22 }, new Animation(6673)),
    
    		STEEL_CBOW(9459, 9438, new int[] { 9465 }, new int[] { 46 }, new double[] { 27 }, new Animation(6674)),
    
    		BLURITE_CBOW(9456, 9438, new int[] { 9176 }, new int[] { 24 }, new double[] { 16 }, new Animation(6672)),
    
    		MITHRIL_CBOW(9461, 9438, new int[] { 9181 }, new int[] { 52 }, new double[] { 32 }, new Animation(6675)),
    
    		ADAMANT_CBOW(9463, 9438, new int[] { 9183 }, new int[] { 61 }, new double[] { 41 }, new Animation(6676)),
    
    		RUNITE_CBOW(9465, 9438, new int[] { 9185 }, new int[] { 69 }, new double[] { 50 }, new Animation(6677)),
    
    		/**
    		 * Arrows
    		 */
    		HEADLESS_ARROWS(52, 314, new int[] { 53 }, new int[] { 1 }, new double[] { 1 }, new Animation(6702)),
    
    		BRONZE_ARROWS(39, 53, new int[] { 882 }, new int[] { 1 }, new double[] { 0.4 }, new Animation(6072)),
    
    		IRON_ARROWS(40, 53, new int[] { 884 }, new int[] { 15 }, new double[] { 3.8 }, new Animation(6072)),
    
    		STEEL_ARROWS(41, 53, new int[] { 886 }, new int[] { 30 }, new double[] { 6.3 }, new Animation(6702)),
    
    		MITHRIL_ARROWS(42, 53, new int[] { 888 }, new int[] { 45 }, new double[] { 8.8 }, new Animation(6702)),
    
    		ADAMANT_ARROWS(43, 53, new int[] { 890 }, new int[] { 60 }, new double[] { 11.3 }, new Animation(6702)),
    
    		RUNITE_ARROWS(44, 53, new int[] { 892 }, new int[] { 75 }, new double[] { 13.8 }, new Animation(6702)),
    
    		DRAGON_ARROWS(11237, 53, new int[] { 11212 }, new int[] { 90 }, new double[] { 16.3 }, new Animation(6702)),
    
    		/**
    		 * Bolts
    		 */
    		BRONZE_BOLT(9375, 314, new int[] { 877 }, new int[] { 9 }, new double[] { 0.5 }, new Animation(6702)),
    
    		IRON_BOLT(9337, 314, new int[] { 9140 }, new int[] { 39 }, new double[] { 1.5 }, new Animation(6702)),
    
    		STEEL_BOLT(9339, 314, new int[] { 9141 }, new int[] { 46 }, new double[] { 3.5 }, new Animation(6702)),
    
    		MITHRIL_BOLT(9379, 314, new int[] { 9142 }, new int[] { 54 }, new double[] { 5 }, new Animation(6702)),
    
    		ADAMANT_BOLT(9380, 314, new int[] { 9143 }, new int[] { 61 }, new double[] { 7 }, new Animation(6702)),
    
    		RUNITE_BOLT(9381, 314, new int[] { 9144 }, new int[] { 69 }, new double[] { 10 }, new Animation(6702)),
    
    		OPAL_BOLTS(45, 877, new int[] { 879 }, new int[] { 11 }, new double[] { 1.6 }, new Animation(6702)),
    
    		BLURITE_BOLTS(9376, 314, new int[] { 9139 }, new int[] { 24 }, new double[] { 1 }, new Animation(6702)),
    
    		JADE_BOLTS(9187, 9376, new int[] { 9335 }, new int[] { 26 }, new double[] { 2.4 }, new Animation(6702)),
    
    		PEARL_BOLTS(46, 9140, new int[] { 880 }, new int[] { 41 }, new double[] { 3.2 }, new Animation(67026702)),
    
    		SILVER_BOLTS(9382, 314, new int[] { 9145 }, new int[] { 43 }, new double[] { 2.5 }, new Animation(-1)),
    
    		RED_TOPAZ_BOLTS(9188, 9141, new int[] { 9336 }, new int[] { 48 }, new double[] { 3.9 }, new Animation(6702)),
    
    		BARBED_BOLTS(47, 877, new int[] { 881 }, new int[] { 51 }, new double[] { 9.5 }, new Animation(6702)),
    
    		SAPPHIRE_BOLTS(9189, 9142, new int[] { 9337 }, new int[] { 56 }, new double[] { 2.4 }, new Animation(6702)),
    
    		EMERALD_BOLTS(9187, 9376, new int[] { 9335 }, new int[] { 26 }, new double[] { 4.7 }, new Animation(6702)),
    
    		RUBY_BOLTS(9191, 9143, new int[] { 9339 }, new int[] { 63 }, new double[] { 6.3 }, new Animation(6702)),
    
    		DIAMOND_BOLTS(9192, 9143, new int[] { 9340 }, new int[] { 65 }, new double[] { 7 }, new Animation(6702)),
    
    		DRAGON_BOLTS(9193, 9144, new int[] { 9341 }, new int[] { 71 }, new double[] { 8.2 }, new Animation(6702)),
    
    		ONYX_BOLTS(9194, 9144, new int[] { 9342 }, new int[] { 73 }, new double[] { 9.4 }, new Animation(6702)),
    
    		/*
    		 * Darts
    		 */
    
    		BRONZE_DART(819, 314, new int[] { 806 }, new int[] { 1 }, new double[] { 0.8 }, new Animation(-1)),
    
    		IRON_DART(820, 314, new int[] { 807 }, new int[] { 22 }, new double[] { 1 }, new Animation(-1)),
    
    		STEEL_DART(821, 314, new int[] { 808 }, new int[] { 37 }, new double[] { 1.7 }, new Animation(-1)),
    
    		MITHRIL_DART(822, 314, new int[] { 809 }, new int[] { 52 }, new double[] { 4 }, new Animation(-1)),
    
    		ADAMANT_DART(823, 314, new int[] { 810 }, new int[] { 67 }, new double[] { 7.6 }, new Animation(-1)),
    
    		RUNITE_DART(824, 314, new int[] { 811 }, new int[] { 81 }, new double[] { 12.2 }, new Animation(-1)),
    
    		DRAGON_DART(11232, 314, new int[] { 11230 }, new int[] { 95 }, new double[] { 18.4 }, new Animation(-1));
    
    		private static Map<Integer, Fletch> fletching = new HashMap<Integer, Fletch>();
    
    		public static Fletch forId(int id) {
    			return fletching.get(id);
    		}
    
    		static {
    			for (Fletch fletch : Fletch.values())
    				fletching.put(fletch.id, fletch);
    		}
    
    		private int[] product, level;
    		private int id, selected;
    		private double[] xp;
    		private Animation anim;
    
    		private Fletch(int id, int selected, int[] product, int level[], double[] xp, Animation anim) {
    			this.id = id;
    			this.product = product;
    			this.selected = selected;
    			this.xp = xp;
    			this.anim = anim;
    			this.level = level;
    		}
    
    		public int getId() {
    			return id;
    		}
    
    		public int getSelected() {
    			return selected;
    		}
    
    		public int[] getProduct() {
    			return product;
    		}
    
    		public int[] getLevel() {
    			return level;
    		}
    
    		public double[] getXp() {
    			return xp;
    		}
    
    		public Animation getAnim() {
    			return anim;
    		}
    	}
    
    	private Fletch fletch;
    	private int option;
    	private int ticks;
    
    	public Fletching(Fletch fletch, int option, int ticks) {
    		this.fletch = fletch;
    		this.option = option;
    		this.ticks = ticks;
    	}
    
    	@Override
    	public boolean start(Player player) {
    		if (option >= fletch.getProduct().length)
    			return false;
    		if (!process(player))
    			return false;
    		player.getPackets().sendGameMessage("You attempt to create a " + new Item(fletch.getProduct()[option]).getDefinitions().getName().replace("(u)", "") + "...", true);
    		return true;
    	}
    
    	@Override
    	public boolean process(Player player) {
    		if (ticks <= 0)
    			return false;
    		if (!player.getInventory().containsItem(fletch.getId(), 1) || !player.getInventory().containsItem(fletch.getSelected(), 1))
    			return false;
    		if (player.getSkills().getLevel(Skills.FLETCHING) < fletch.getLevel()[option]) {
    			player.getDialogueManager().startDialogue("SimpleMessage", "You need a level of " + fletch.getLevel() + " to fletch this.");
    			return false;
    		}
    		return true;
    	}
    
    	// fixed by dragonkk as always
    	public static boolean maxMakeQuantityTen(Fletch fletch) {
    		return fletch.getSelected() == 314 || ItemDefinitions.getItemDefinitions(fletch.getSelected()).getName().toLowerCase().contains("dart");
    	}
    
    	@Override
    	public int processWithDelay(Player player) {
    		ticks--;
    		int amount = maxMakeQuantityTen(fletch) ? 15 : 1;
    		if (player.KarateFletching == true) {
    			player.setNextAnimation(new Animation(17299));
    			player.setNextGraphics(new Graphics(3300));
    			player.getInventory().deleteItem(fletch.getId(), fletch.getProduct()[option] == 52 ? 1 : amount);
    		} else {
    			player.setNextAnimation(fletch.getAnim());
    			player.getInventory().deleteItem(fletch.getId(), fletch.getProduct()[option] == 52 ? 1 : amount);
    		}
    		if (fletch.getSelected() != KNIFE && fletch.getSelected() != CHISLE)
    			player.getInventory().deleteItem(fletch.getSelected(), amount);
    		player.getInventory().addItem(fletch.getProduct()[option], amount);
    		player.getPackets().sendGameMessage(
    				"You successfully create a "
    						+ new Item(fletch.getProduct()[option])
    								.getDefinitions().getName().replace("(u)", "")
    						+ ".", true);
    		player.getSkills().addXp(Skills.FLETCHING,
    				fletch.getXp()[option] * amount);
    		player.getPackets().sendGameMessage(
    				"You attempt to create a "
    						+ new Item(fletch.getProduct()[option])
    								.getDefinitions().getName().replace("(u)", ""),
    				true);
    		return 1;
    	}
    
    	@Override
    	public void stop(final Player player) {
    		setActionDelay(player, 3);
    	}
    
    	public static Fletch isFletching(Item first, Item second) {
    		Fletch fletch = Fletch.forId(first.getId());
    		int selected;
    		if (fletch != null)
    			selected = second.getId();
    		else {
    			fletch = Fletch.forId(second.getId());
    			selected = first.getId();
    		}
    		return fletch != null && fletch.getSelected() == selected ? fletch : null;
    	}
    }
    Quote Originally Posted by ReverendDread View Post
    Post your Fletching class and ill explain it to ya.
    Posted
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    May 2013
    Age
    27
    Posts
    414
    Thanks given
    215
    Thanks received
    200
    Rep Power
    137
    Theres a check for a knife in FletchingDialogue.java its in there. I have to leave to go do something today, sorry.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Jul 2016
    Posts
    25
    Thanks given
    0
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by ReverendDread View Post
    Theres a check for a knife in FletchingDialogue.java its in there. I have to leave to go do something today, sorry.
    not quite sure what that means sorry
    Reply With Quote  
     

  8. #8  
    Registered Member

    Join Date
    May 2013
    Age
    27
    Posts
    414
    Thanks given
    215
    Thanks received
    200
    Rep Power
    137
    Quote Originally Posted by brucejenner View Post
    not quite sure what that means sorry
    Just pm me so we don't spam up this thread.
    Reply With Quote  
     

  9. #9  
    Registered Member

    Join Date
    Sep 2014
    Posts
    300
    Thanks given
    122
    Thanks received
    91
    Rep Power
    158
    In your Woodcutting.java, checkAll() method, where it checks for your hatchet, change the "if (player.getInventory().contains(XXX)" to "if (player.getInventory().containsItemToolBelt(XXX)". Make changes like this to other classes that handles the actions.
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Jul 2016
    Posts
    25
    Thanks given
    0
    Thanks received
    1
    Rep Power
    11
    Quote Originally Posted by Banners View Post
    In your Woodcutting.java, checkAll() method, where it checks for your hatchet, change the "if (player.getInventory().contains(XXX)" to "if (player.getInventory().containsItemToolBelt(XXX)". Make changes like this to other classes that handles the actions.


    thanks, but now it is telling me that "you don't have the required level to use that axe." what now?

    Edit: solvedd woocutting
    Last edited by brucejenner; 03-03-2017 at 04:41 AM. Reason: ed
    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. 718 client error please help
    By lucasned in forum Help
    Replies: 0
    Last Post: 01-20-2014, 06:59 AM
  2. Help on this error please {718}
    By _Patrick_ in forum Help
    Replies: 4
    Last Post: 07-02-2013, 07:55 PM
  3. 718 compiller error. please help
    By JackDaRipper in forum Help
    Replies: 2
    Last Post: 06-11-2013, 05:19 AM
  4. hey guys 718 webcleint error, please help me :)
    By Simplicity-X in forum Help
    Replies: 0
    Last Post: 04-27-2013, 02:40 PM
  5. 718 1 Error please help!
    By 'Brad in forum Help
    Replies: 4
    Last Post: 09-24-2012, 04:43 AM
Tags for this Thread

View Tag Cloud

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