Thread: [Delta]Crafting(Hide crafting included!!!!)

Results 1 to 10 of 10
  1. #1 [Delta]Crafting(Hide crafting included!!!!) 
    Registered Member Beershake's Avatar
    Join Date
    Mar 2011
    Age
    25
    Posts
    287
    Thanks given
    49
    Thanks received
    25
    Rep Power
    2
    I decided to release this because no delta has good crafting.
    It can b used for other server like BattleScape, Project Insanity(Most of them already has it),
    Dodians, Devolutions and others..

    Things you will need to complete this tutorial

    Knowledge: Copy/paste/Replace
    Difficult: 2/10
    Class Modified: client.java , clickingmost.java
    Class Created: Crafting.java

    Before doing anything Backup all your files in case of 100 errors

    First step:

    Open up you client.java and find

    Code:
    public void deleteItem(int id, int slot, int amount) {
    You Should See something like this:

    Code:
    
    	public void deleteItem(int id, int amount) {
    		deleteItem(id, GetItemSlot(id), amount);
    	}
    
    	public void deleteItem(int id, int slot, int amount) {
    		if ((slot > -1) && (slot < playerItems.length)) {
    			if ((playerItems[slot] - 1) == id) {
    				if (playerItemsN[slot] > amount) {
    					playerItemsN[slot] -= amount;
    				} else {
    					playerItemsN[slot] = 0;
    					playerItems[slot] = 0;
    				}
    				resetItems(3214);
    			}
    		} else {
    		}
    	}
    Replace it with theese :

    Code:
    
    	public void deleteItem(int id, int amount) {
    		deleteItem(id, GetItemSlot(id), amount);
    	}
    
    	public boolean deleteItem(int Id, int Slot, int Amount)
    	{
    		if (server.playerHandler.players[playerId] == null || disconnected || in == null || out == null)
    			return false;
    		if (Id < 0 || Amount < 0)
    			return false;
    		if (CurrentFrame != 5292 && CurrentFrame != 3824)
    		{
    			if (Id == 556 && playerEquipment[playerWeapon] == 1381)
    				return true;
    			else if (Id == 555 && playerEquipment[playerWeapon] == 1383)
    				return true;
    			else if (Id == 557 && playerEquipment[playerWeapon] == 1385)
    				return true;
    			else if (Id == 554 && (playerEquipment[playerWeapon] == 1387 || playerEquipment[playerWeapon] == 3053))
    				return true;
    			else if (Id == 555 && playerEquipment[playerWeapon] == 6563)
    				return true;
    			else if (Id == 557 && (playerEquipment[playerWeapon] == 6563 || playerEquipment[playerWeapon] == 3053))
    				return true;
    		}
    		if ((playerItems[Slot] == Id + 1) && (!Item.itemStackable[Id] && !Item.itemIsNote[Id]))
    		{
    			if (Amount == 1)
    			{
    				playerItems[Slot] = 0;
    				playerItemsN[Slot] = 0;
    				resetItems(3214);
    				return true;
    			}
    			else
    			{
    				for (int i = 0; i < 28; i++)
    				{
    					if (playerItems[i] == Id+1 && Amount != 0)
    					{
    						Amount--;
    						playerItems[i] = 0;
    						playerItemsN[i] = 0;
    						resetItems(3214);
    					}
    				}
    				if (Amount == 0)
    					return true;
    			}
    		}
    		if ((playerItems[Slot] == Id + 1) && (Item.itemStackable[Id] || Item.itemIsNote[Id]))
    		{
    			if (playerItemsN[Slot] > Amount)
    			{
    				playerItemsN[Slot] -= Amount;
    				resetItems(3214);
    				return true;
    			}
    			else
    			{
    				playerItemsN[Slot] = 0;
    				playerItems[Slot] = 0;
    				resetItems(3214);
    				return true;
    			}
    		}
    		return false;
    	}
    Theese method deletes item correctly.

    Step 2:

    Import theese to you client.java

    [/CODE]
    private Crafting crafting = new Crafting(this);
    public Crafting getCrafting() {
    return crafting;
    }
    [/CODE]

    Now Search for:

    Code:
    		case 53:
    and under

    Code:
    			if (!playerHasItem(itemUsed) || !playerHasItem(useWith)) {
    				break;
    			}
    			int otherItem = playerItems[usedWithSlot] - 1;
    add this :

    Code:
    		if (itemUsed == 1733 || useWith == 1733) {
    			getCrafting().handleLeather(itemUsed, useWith);
    		}
    Now search for :

    Code:
    		case 185:
    and under
    Code:
    				server.clickingMost.clicking(playerId);
    			switch (actionButtonId) {
    add theese:

    Code:
    case 34185: 
    case 34184: 
    case 34183: 
    case 34182: 
    case 34189: 
    case 34188: 
    case 34187: 
    case 34186: 
    case 34193: 
    case 34192: 
    case 34191: 
    case 34190:
    if (craftingLeather) {
    getCrafting().handleCraftingClick(actionButtonId);
    }
    break;
    Now Open clickingMost.java
    and search for following cases
    Code:
    case 34185: 
    case 34184: 
    case 34183: 
    case 34182: 
    case 34189: 
    case 34188: 
    case 34187: 
    case 34186: 
    case 34193: 
    case 34192: 
    case 34191: 
    case 34190:
    And remove it with everything it contains.

    Now close and save clickingMost.java

    Now create a new Class Called Crafting.java
    and insert this code inside:

    Code:
    
    public class Crafting {
    
    	private client c;
    	
    	public Crafting(client c) {
    		this.c = c;
    	}
    	
    	public int hideType = 0, makeId = 0, amount = 0, craftType = 0, exp = 0, index = 0;
    	public void resetCrafting() {
    		hideType = 0;
    		makeId = 0;
    		amount = 0;
    		c.craftingLeather = false;
    		craftType = 0;
    	}
    	
    	public void handleChisel(int id1, int id2) {
    		if (id1 == 1755)
    			cutGem(id2);
    		else
    			cutGem(id1);	
    	}
    	
    	public int[][] gems = {{1623,1727,1,50},{1621,1729,27,68},{1619,1725,34,85},{1617,1731,43,108},{1631,1712,55,138},{6571,6585,67,168}};	
    	public void cutGem(int id) {
    		for (int j = 0; j < gems.length; j++) {
    			if (gems[j][0] == id) {
    				if (c.playerLevel[c.playerCrafting] >= gems[j][2]) {
    					c.deleteItem(id, c.GetItemSlot(id),1);
    					c.addItem(gems[j][1], 1);
    					c.closeAll();
    					c.addSkillXP(gems[j][3] * 40, c.playerCrafting);
    					break;
    				}			
    			}		
    		}
    	}
    	
    	public void handleCraftingClick(int clickId) {
    		for (int j = 0; j < buttons.length; j++) {
    			if (buttons[j][0] == clickId) {
    				craftType = buttons[j][1];
    				amount = buttons[j][2];
    				checkRequirements();
    				break;
    			}
    		}	
    	}
    	
    	public void checkRequirements() {
    		for (int j = 0; j < expsAndLevels.length; j++) {
    			if (expsAndLevels[j][0] == hideType) {
    				if (c.playerLevel[c.playerCrafting] >= expsAndLevels[j][1]) {
    					if (c.playerHasItem(hideType, 1)) {
    						c.closeAll();
    						exp = expsAndLevels[j][2];
    						index = j;
    						craftHides(hideType);
    					}
    				} else {
    					c.closeAll();
    					c.sM("You need a crafting level of " + expsAndLevels[j][1] + " to craft this.");
    				}
    			}
    		}	
    	}
    	
    	public void craftHides(int id) {
    		for (int j = 0; j < amount; j++) {
    			if (!c.playerHasItem(id,craftType))
    				break;
    			c.deleteItem(id, c.GetItemSlot(id), craftType);
    			if (getItemToAdd() <= 0)
    				break;
    			c.addItem(getItemToAdd(), 1);
    			c.closeAll();
    			c.addSkillXP(exp * 50, c.playerCrafting);
    		}
    		resetCrafting();
    	}
    	
    	public int getItemToAdd() {
    		if (craftType == 1) {
    			return vambs[index];
    		} else if (craftType == 2) {
    			return chaps[index];
    		} else if (craftType == 3) {
    			return bodys[index];
    		}	
    		return -1;
    	}
    	
    	public int[] vambs = {1065,2487,2489,2491};
    	public int[] chaps = {1099,2493,2495,2497};
    	public int[] bodys = {1135,2499,2501,2503};
    	
    	
    	public void handleLeather(int item1, int item2) {
    		if (item1 == 1733) {
    			openLeather(item2);
    		} else {
    			openLeather(item1);
    		}
    	}
    	
    	public int[][] buttons = {{34185,1,1},{34184,1,5},{34183,1,10},{34182,1,27},{34189,2,1},{34188,2,5},{34187,2,10},{34186,2,27},{34193,3,1},{34192,3,5},{34191,3,10},{34190,3,27}};
    	
    	public int[][] expsAndLevels = {{1745,62,57},{2505,66,70},{2507,73,78},{2509,79,86}};
    	
    	
    	public void openLeather(int item) {
    		if (item == 1745) {
    			c.sendFrame164(8880); //green dhide
             	c.sendFrame126("What would you like to make?", 8879);
             	c.sendFrame246(8884, 250, 1099); // middle
         		c.sendFrame246(8883, 250, 1065); // left picture
         		c.sendFrame246(8885, 250, 1135); // right pic
         		c.sendFrame126("Vambs", 8889);
         		c.sendFrame126("Chaps", 8893);
         		c.sendFrame126("Body", 8897);
    			hideType = item;
    		} else if (item == 2505) {
            	c.sendFrame164(8880); //blue
             	c.sendFrame126("What would you like to make?", 8879);
             	c.sendFrame246(8884, 250, 2493); // middle
         		c.sendFrame246(8883, 250, 2487); // left picture
         		c.sendFrame246(8885, 250, 2499); // right pic
         		c.sendFrame126("Vambs", 8889);
         		c.sendFrame126("Chaps", 8893);
         		c.sendFrame126("Body", 8897);
    			hideType = item;			
    		} else if (item == 2507) {
    			c.sendFrame164(8880);
             	c.sendFrame126("What would you like to make?", 8879);
             	c.sendFrame246(8884, 250, 2495); // middle
         		c.sendFrame246(8883, 250, 2489); // left picture
         		c.sendFrame246(8885, 250, 2501); // right pic
         		c.sendFrame126("Vambs", 8889);
         		c.sendFrame126("Chaps", 8893);
         		c.sendFrame126("Body", 8897);
    			hideType = item;
    		} else if (item == 2509) {
    			c.sendFrame164(8880);
             	c.sendFrame126("What would you like to make?", 8879);
             	c.sendFrame246(8884, 250, 2497); // middle
         		c.sendFrame246(8883, 250, 2491); // left picture
         		c.sendFrame246(8885, 250, 2503); // right pic
         		c.sendFrame126("Vambs", 8889);
         		c.sendFrame126("Chaps", 8893);
         		c.sendFrame126("Body", 8897);
    			hideType = item;			
    		}
    		c.craftingLeather = true;
    	}
    
    }
    Now close and save Crafting.java

    and now youre done.
    Hope you liked this and use it.

    If you got any errors please post it.
    Here i will help you.

    Credits:

    65% Sanity
    35% BeerShake(Me)
    [Only registered and activated users can see links. ]


    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #2  
    Whatchu talkin bout willis?

    Gary's Avatar
    Join Date
    Sep 2008
    Posts
    4,165
    Thanks given
    690
    Thanks received
    646
    Rep Power
    3462
    Goodjob, im sure someone will find a use for this
    Ellie
    Sadly lost my beautiful ellie in july 2018 always going to miss you my girl
    Spoiler for sig too big:


    Reply With Quote  
     

  3. #3  
    Registered Member Beershake's Avatar
    Join Date
    Mar 2011
    Age
    25
    Posts
    287
    Thanks given
    49
    Thanks received
    25
    Rep Power
    2
    Ohh thanks by the way coming soon other delta skills
    [Only registered and activated users can see links. ]


    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Dec 2009
    Posts
    215
    Thanks given
    6
    Thanks received
    11
    Rep Power
    27
    We need more delta tutorials honestly, I'm making a RS 2006 remake off Delta.
    Reply With Quote  
     

  5. #5  
    Registered Member

    Join Date
    Sep 2011
    Posts
    1,140
    Thanks given
    385
    Thanks received
    398
    Rep Power
    474
    Quote Originally Posted by assaulth3ro911 View Post
    We need more delta tutorials honestly, I'm making a RS 2006 remake off Delta.
    No, we don't.
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Nov 2011
    Posts
    15
    Thanks given
    0
    Thanks received
    3
    Discord
    View profile
    Rep Power
    11
    Yes we do, come with 'em
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Aug 2010
    Posts
    12
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Sorry, I don't have many experiences with RSPS coding, I got the following errors:



    client.java19:class, interface, or enum expected
    private Crafting crafting = new Crafting(this);
    ^

    client.java20:class, interface, or enum expected
    public Crafting getCrafting() {
    ^

    client.java22:class, interface, or enum expected
    }
    ^



    You said 'import them', so I copied the code under the 'import' codes, which you can find on the top of client.java
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Dec 2011
    Posts
    3
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    I got 100'S Errors xD
    Reply With Quote  
     

  9. #9  
    Beast

    Join Date
    May 2010
    Posts
    301
    Thanks given
    6
    Thanks received
    27
    Rep Power
    40
    got lots of errors

    client.java:8929: error: deleteItem(int,int) is already defined in client
    public void deleteItem(int id, int amount) {
    ^
    client.java:8939: error: cannot find symbol
    if (CurrentFrame != 5292 && CurrentFrame != 3824)
    ^
    symbol: variable CurrentFrame
    location: class client
    client.java:8939: error: cannot find symbol
    if (CurrentFrame != 5292 && CurrentFrame != 3824)
    ^
    symbol: variable CurrentFrame
    location: class client
    client.java:15694: error: cannot find symbol
    if (craftingLeather) {
    ^
    symbol: variable craftingLeather
    location: class client
    client.java:17035: error: bad operand types for binary operator '&&'
    && (System.currentTimeMillis() - lastAction >= 1
    500)) {
    ^
    first type: Crafting
    second type: boolean
    client.java:17231: error: incompatible types
    crafting = false;
    ^
    required: Crafting
    found: boolean
    client.java:18752: error: incompatible types
    crafting = true;
    ^
    required: Crafting
    found: boolean
    client.java:18852: error: incompatible types
    crafting = true;
    ^
    required: Crafting
    found: boolean
    Crafting.java:14: error: cannot find symbol
    c.craftingLeather = false;
    ^
    symbol: variable craftingLeather
    location: variable c of type client
    Crafting.java:154: error: cannot find symbol
    c.craftingLeather = true;
    ^
    symbol: variable craftingLeather
    location: variable c of type client
    10 errors
    Finished!
    Press any key to continue . . .
    Reply With Quote  
     

  10. #10  
    Registered Member

    Join Date
    Aug 2010
    Age
    27
    Posts
    1,027
    Thanks given
    373
    Thanks received
    175
    Rep Power
    103
    Quote Originally Posted by slimjimm000 View Post
    got lots of errors

    client.java:8929: error: deleteItem(int,int) is already defined in client
    public void deleteItem(int id, int amount) {
    ^
    client.java:8939: error: cannot find symbol
    if (CurrentFrame != 5292 && CurrentFrame != 3824)
    ^
    symbol: variable CurrentFrame
    location: class client
    client.java:8939: error: cannot find symbol
    if (CurrentFrame != 5292 && CurrentFrame != 3824)
    ^
    symbol: variable CurrentFrame
    location: class client
    client.java:15694: error: cannot find symbol
    if (craftingLeather) {
    ^
    symbol: variable craftingLeather
    location: class client
    client.java:17035: error: bad operand types for binary operator '&&'
    && (System.currentTimeMillis() - lastAction >= 1
    500)) {
    ^
    first type: Crafting
    second type: boolean
    client.java:17231: error: incompatible types
    crafting = false;
    ^
    required: Crafting
    found: boolean
    client.java:18752: error: incompatible types
    crafting = true;
    ^
    required: Crafting
    found: boolean
    client.java:18852: error: incompatible types
    crafting = true;
    ^
    required: Crafting
    found: boolean
    Crafting.java:14: error: cannot find symbol
    c.craftingLeather = false;
    ^
    symbol: variable craftingLeather
    location: variable c of type client
    Crafting.java:154: error: cannot find symbol
    c.craftingLeather = true;
    ^
    symbol: variable craftingLeather
    location: variable c of type client
    10 errors
    Finished!
    Press any key to continue . . .
    If you actually READ the errors... you might be able to fix all of them already..

    Ill give you a hint
    already defined means you already have the method.

    As you probably replaced with your old crafting, you might wanna compare the variables.


    @ DeuX

    doesn't mean squat. Show the first
    Reply With Quote  
     


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. Requesting Leather Hide Crafting Emote
    By DTMF in forum Requests
    Replies: 5
    Last Post: 12-03-2009, 05:29 AM
  2. Ians D-Hide/Pottery Crafting Fix
    By Dennis in forum Tutorials
    Replies: 19
    Last Post: 05-08-2008, 09:30 PM
  3. Replies: 9
    Last Post: 09-25-2007, 11:34 PM
  4. Gem crafting remake of Cams hween crafting
    By ~Legend Rene in forum Tutorials
    Replies: 6
    Last Post: 09-23-2007, 11:36 PM
  5. Haloween Skeleton Armor Crafting + Pumpkin Crafting
    By Crazy Cam10 in forum Tutorials
    Replies: 15
    Last Post: 09-23-2007, 07:27 PM
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
  •