Thread: Else code spamming chatbox :p

Results 1 to 5 of 5
  1. #1 Else code spamming chatbox :p 
    Registered Member

    Join Date
    Aug 2009
    Posts
    101
    Thanks given
    0
    Thanks received
    0
    Rep Power
    103
    }
    if((itemUsed== 227 && useWith == 269) || (itemUsed == 269 && useWith == 227)) {
    if(playerLevel[15] >= 75)
    addSkillXP(1000,15);
    deleteItem(227, getItemSlot(227),1);
    deleteItem(269, getItemSlot(269),1);
    setAnimation(3283);
    addItem(111,1);
    sendMessage("You mix the ingredients and create a Unfinished Torstol Potion.");
    } else {
    sendMessage("You need a higher herblore level to do this");
    }
    if((itemUsed== 111 && useWith == 245) || (itemUsed == 245 && useWith == 111)) {
    if(playerLevel[15] >= 75)
    addSkillXP(1000,15);
    deleteItem(111, getItemSlot(111),1);
    deleteItem(245, getItemSlot(245),1);
    setAnimation(3283);
    addItem(5940,1);
    sendMessage("You mix the ingredients and create a Weapon Poison(S)");
    } else {
    sendMessage("You need a higher herblore level to do this");
    }


    Thats what im using atm (Obv more code above it)
    they all follow the same syntax- no matter what when i create a pot then it sends 22 messages saying you need a higher herblore lvl? I suppose this is a simple fix but can anyone help?
    Reply With Quote  
     

  2. #2  
    Registered Member xxlukexx's Avatar
    Join Date
    Jan 2009
    Age
    29
    Posts
    103
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    try:

    Code:
    if((itemUsed== 227 && useWith == 269) || (itemUsed == 269 && useWith == 227)) {
    if(playerLevel[15] >= 75) {
    addSkillXP(1000,15);
    deleteItem(227, getItemSlot(227),1);
    deleteItem(269, getItemSlot(269),1);
    setAnimation(3283);
    addItem(111,1);
    sendMessage("You mix the ingredients and create a Unfinished Torstol Potion.");
    } else {
    sendMessage("You need a higher herblore level to do this");
    }
    }
    Code:
    if((itemUsed== 111 && useWith == 245) || (itemUsed == 245 && useWith == 111)) {
    if(playerLevel[15] >= 75) {
    addSkillXP(1000,15);
    deleteItem(111, getItemSlot(111),1);
    deleteItem(245, getItemSlot(245),1);
    setAnimation(3283);
    addItem(5940,1);
    sendMessage("You mix the ingredients and create a Weapon Poison(S)");
    } else {
    sendMessage("You need a higher herblore level to do this");
    }
    }
    idk if its right.
    Reply With Quote  
     

  3. #3  
    Community Veteran

    Dexter Morgan's Avatar
    Join Date
    Nov 2008
    Age
    28
    Posts
    4,419
    Thanks given
    1,184
    Thanks received
    757
    Rep Power
    3098
    Code:
    	if((itemUsed== 227 && useWith == 269) || (itemUsed == 269 && useWith == 227)) {
    		if(playerLevel[15] >= 75) {
    			addSkillXP(1000,15);
    			deleteItem(227, getItemSlot(227),1);
    			deleteItem(269, getItemSlot(269),1);
    			setAnimation(3283);
    			addItem(111,1);
    			sendMessage("You mix the ingredients and create a Unfinished Torstol Potion.");
    		} else {
    			sendMessage("You need a higher herblore level to do this");
    		}
    	} else if((itemUsed== 111 && useWith == 245) || (itemUsed == 245 && useWith == 111)) {
    		if(playerLevel[15] >= 75) 
    			addSkillXP(1000,15);
    			deleteItem(111, getItemSlot(111),1);
    			deleteItem(245, getItemSlot(245),1);
    			setAnimation(3283);
    			addItem(5940,1);
    			sendMessage("You mix the ingredients and create a Weapon Poison(S)");
    		} else {
    			sendMessage("You need a higher herblore level to do this");
    		}
    	}
    You forgot couple of braces.
    Reply With Quote  
     

  4. #4  
    Registered Member xxlukexx's Avatar
    Join Date
    Jan 2009
    Age
    29
    Posts
    103
    Thanks given
    0
    Thanks received
    0
    Rep Power
    1
    Quote Originally Posted by 2012 View Post
    Code:
    	if((itemUsed== 227 && useWith == 269) || (itemUsed == 269 && useWith == 227)) {
    		if(playerLevel[15] >= 75) {
    			addSkillXP(1000,15);
    			deleteItem(227, getItemSlot(227),1);
    			deleteItem(269, getItemSlot(269),1);
    			setAnimation(3283);
    			addItem(111,1);
    			sendMessage("You mix the ingredients and create a Unfinished Torstol Potion.");
    		} else {
    			sendMessage("You need a higher herblore level to do this");
    		}
    	} else if((itemUsed== 111 && useWith == 245) || (itemUsed == 245 && useWith == 111)) {
    		if(playerLevel[15] >= 75) 
    			addSkillXP(1000,15);
    			deleteItem(111, getItemSlot(111),1);
    			deleteItem(245, getItemSlot(245),1);
    			setAnimation(3283);
    			addItem(5940,1);
    			sendMessage("You mix the ingredients and create a Weapon Poison(S)");
    		} else {
    			sendMessage("You need a higher herblore level to do this");
    		}
    	}
    You forgot couple of braces.
    brackets* and i think you did as well.
    Reply With Quote  
     

  5. #5  
    Registered Member

    Join Date
    Sep 2008
    Posts
    2,219
    Thanks given
    148
    Thanks received
    204
    Rep Power
    1570
    Code:
    	if (itemUsed== 227 && useWith == 269 || itemUsed == 269 && useWith == 227) {
    		if(playerLevel[15] < 75) {
    			sendMessage("You need a Herblore level of 75 to mix this.");
    			return;
    		}
    		addSkillXP(1000,15);
    		deleteItem(227, getItemSlot(227),1);
    		deleteItem(269, getItemSlot(269),1);
    		setAnimation(3283);
    		addItem(111,1);
    		sendMessage("You mix the ingredients and create a Unfinished Torstol Potion.");
    	} else if (itemUsed== 111 && useWith == 245 || itemUsed == 245 && useWith == 111) {
    		if(playerLevel[15] < 75) {
    			sendMessage("You need a Herblore level of 75 to mix this.");
    			return;
    		} 
    		addSkillXP(1000,15);
    		deleteItem(111, getItemSlot(111),1);
    		deleteItem(245, getItemSlot(245),1);
    		setAnimation(3283);
    		addItem(5940,1);
    		sendMessage("You mix the ingredients and create a Weapon Poison(S).");
    	}



    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

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