Thread: visage command?

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1 visage command? 
    Donator

    Join Date
    Jul 2013
    Posts
    488
    Thanks given
    21
    Thanks received
    42
    Rep Power
    0
    [PI]
    How could i add command so a player could type ::visage and turn a visage into a dragonfire shield (with 99smithing)
    I will give rep++ and thanks!!
    Reply With Quote  
     

  2. #2  
    Registered Member
    Karma_K's Avatar
    Join Date
    Nov 2012
    Posts
    4,290
    Thanks given
    151
    Thanks received
    610
    Rep Power
    108
    Just add a command that checks if a person has a visage an anti shield and 99 smithing. If they have it, add dfs item and delete the visage and anti shield.
    Reply With Quote  
     

  3. #3  
    Naughty Toys
    Toys's Avatar
    Join Date
    Sep 2013
    Posts
    201
    Thanks given
    21
    Thanks received
    9
    Rep Power
    37
    Now, Im not the best at this, but I feel like it'd be something like this..

    Code:
    if (playerCommand.equalsIgnoreCase ("Visage")) {
    int skill = Interger.parseInt (args[1]);
    int level = Interger.parseInt(args[2]);
    if c.playerLevel [skill] = (level = 99);
    c.getItems().deleteItem(####, 1); //Visage ID
    c.getItems().addItem(####, 1); //dfs ID
    else if (level > 99) {
    c.sendMessage ("You need 99 smithing to create a dragonfire shield.");
    }
    }
    That obviously wont work, but if you can find someone to touch it up a bit I bet that'd be around how to do it.

    Sorry I can't help, but I tried eh.
    Reply With Quote  
     

  4. #4  
    Registered Member Nicholas's Avatar
    Join Date
    May 2011
    Age
    29
    Posts
    406
    Thanks given
    144
    Thanks received
    59
    Rep Power
    18
    Code:
            if (playerCommand.equalsIgnoreCase("visage")) {
                if (c.playerLevel[c.playerSmithing] >= 95) {
                    if (c.getItems().playerHasItem(11286, 1) && c.getItems().playerHasItem(1540, 1)) {
                        c.getItems().deleteItem(11286, 1);
                        c.getItems().deleteItem(1540, 1);
                        c.getItems().addItem(11284, 1);
                        c.getPA().addSkillXP(25000, c.playerSmithing);
                    } else {
                        c.sendMessage("You don't have enough materials.");
                    }
                } else {
                    c.sendMessage("You need a smithing level of 95 to make that.");
                }
            }


    R-S Admin Response  Albert Einstein
    If you can't explain it simply, you don't understand it well enough.
    Reply With Quote  
     

  5. #5  
    Naughty Toys
    Toys's Avatar
    Join Date
    Sep 2013
    Posts
    201
    Thanks given
    21
    Thanks received
    9
    Rep Power
    37
    Quote Originally Posted by Nicholas View Post
    Code:
            if (playerCommand.equalsIgnoreCase("visage")) {
                if (c.playerLevel[c.playerSmithing] >= 95) {
                    if (c.getItems().playerHasItem(11286, 1) && c.getItems().playerHasItem(1540, 1)) {
                        c.getItems().deleteItem(11286, 1540);
                        c.getItems().addItem(11284, 1);
                        c.getPA().addSkillXP(25000, c.playerSmithing);
                    } else {
                        c.sendMessage("You don't have enough materials.");
                    }
                } else {
                    c.sendMessage("You need a smithing level of 95 to make that.");
                }
            }
    I was pretty close :C
    Reply With Quote  
     

  6. #6  
    Registered Member
    Karma_K's Avatar
    Join Date
    Nov 2012
    Posts
    4,290
    Thanks given
    151
    Thanks received
    610
    Rep Power
    108
    Quote Originally Posted by Nicholas View Post
    Code:
            if (playerCommand.equalsIgnoreCase("visage")) {
                if (c.playerLevel[c.playerSmithing] >= 95) {
                    if (c.getItems().playerHasItem(11286, 1) && c.getItems().playerHasItem(1540, 1)) {
                        c.getItems().deleteItem(11286, 1540);
                        c.getItems().addItem(11284, 1);
                        c.getPA().addSkillXP(25000, c.playerSmithing);
                    } else {
                        c.sendMessage("You don't have enough materials.");
                    }
                } else {
                    c.sendMessage("You need a smithing level of 95 to make that.");
                }
            }
    Youre deleting 1540 of item 11286 lol.. Should be

    c.getItems().deleteItem(11286, 1);
    c.getItems().deleteItem(1540, 1);
    Reply With Quote  
     

  7. #7  
    Registered Member Nicholas's Avatar
    Join Date
    May 2011
    Age
    29
    Posts
    406
    Thanks given
    144
    Thanks received
    59
    Rep Power
    18
    Quote Originally Posted by Evion View Post
    I was pretty close :C
    This is your code

    Code:
    if (playerCommand.equalsIgnoreCase ("Visage")) {
    int skill = Interger.parseInt (args[1]);
    int level = Interger.parseInt(args[2]);
    if c.playerLevel [skill] = (level = 99);
    c.getItems().deleteItem(####, 1); //Visage ID
    c.getItems().addItem(####, 1); //dfs ID
    else if (level > 99) {
    c.sendMessage ("You need 99 smithing to create a dragonfire shield.");
    }
    }
    Now, with your command, this is how you would have to use it:

    Code:
    ::Visage 0 99
    due to these

    Code:
    int skill = Interger.parseInt (args[1]);
    int level = Interger.parseInt(args[2]);
    These are arguments for the command. Skill is the word after the command, level is the word after that.
    You're not checking whether the player has the correct smithing level, you're just checking whether they used ("::Visage SKILL LEVEL")
    Also, your if statements aren't if statements.
    And you're checking if the player has a level GREATER than 99 in order to send the 'you can't make this' message.

    Your code is nothing like mine >_<

    But props for trying


    R-S Admin Response  Albert Einstein
    If you can't explain it simply, you don't understand it well enough.
    Reply With Quote  
     

  8. #8  
    Registered Member Nicholas's Avatar
    Join Date
    May 2011
    Age
    29
    Posts
    406
    Thanks given
    144
    Thanks received
    59
    Rep Power
    18
    Quote Originally Posted by Karma_K View Post
    Youre deleting 1540 of item 11286 lol.. Should be

    c.getItems().deleteItem(11286, 1);
    c.getItems().deleteItem(1540, 1);
    Whoops, you're right. That's what I get for writing code in a quick reply xD


    R-S Admin Response  Albert Einstein
    If you can't explain it simply, you don't understand it well enough.
    Reply With Quote  
     

  9. Thankful user:


  10. #9  
    Naughty Toys
    Toys's Avatar
    Join Date
    Sep 2013
    Posts
    201
    Thanks given
    21
    Thanks received
    9
    Rep Power
    37
    Quote Originally Posted by Nicholas View Post
    This is your code

    Code:
    if (playerCommand.equalsIgnoreCase ("Visage")) {
    int skill = Interger.parseInt (args[1]);
    int level = Interger.parseInt(args[2]);
    if c.playerLevel [skill] = (level = 99);
    c.getItems().deleteItem(####, 1); //Visage ID
    c.getItems().addItem(####, 1); //dfs ID
    else if (level > 99) {
    c.sendMessage ("You need 99 smithing to create a dragonfire shield.");
    }
    }
    Now, with your command, this is how you would have to use it:

    Code:
    ::Visage 0 99
    due to these

    Code:
    int skill = Interger.parseInt (args[1]);
    int level = Interger.parseInt(args[2]);
    These are arguments for the command. Skill is the word after the command, level is the word after that.
    You're not checking whether the player has the correct smithing level, you're just checking whether they used ("::Visage SKILL LEVEL")
    Also, your if statements aren't if statements.
    And you're checking if the player has a level GREATER than 99 in order to send the 'you can't make this' message.

    Your code is nothing like mine >_<

    But props for trying
    Yeah, I didn't really know what to put for the smithing level check so I kinda winged it using a setlevel command. I gave it a shot :/ now I know how to base it from a stat w/ your command.
    Reply With Quote  
     

  11. #10  
    Registered Member Nicholas's Avatar
    Join Date
    May 2011
    Age
    29
    Posts
    406
    Thanks given
    144
    Thanks received
    59
    Rep Power
    18
    Quote Originally Posted by Evion View Post
    Yeah, I didn't really know what to put for the smithing level check so I kinda winged it using a setlevel command. I gave it a shot :/ now I know how to base it from a stat w/ your command.
    At least you're learning


    R-S Admin Response  Albert Einstein
    If you can't explain it simply, you don't understand it well enough.
    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. [458] Command List.
    By Impulser in forum RS2 Client
    Replies: 44
    Last Post: 06-11-2008, 08:17 PM
  2. ::pnpc command!
    By Pancakebuddy in forum Tutorials
    Replies: 7
    Last Post: 05-22-2007, 05:07 AM
  3. Loading Commands From Text File
    By ThatOneServer in forum Tutorials
    Replies: 2
    Last Post: 05-05-2007, 12:36 PM
  4. Tokenized Commands
    By ThatOneServer in forum Tutorials
    Replies: 1
    Last Post: 05-03-2007, 11:18 AM
  5. Console Commands
    By ZeroFreeze in forum Tutorials
    Replies: 7
    Last Post: 04-30-2007, 12:53 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •