Jump to content
  • 0

1 CLICK NPC BUY


IvanD

Question


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.03
  • Content Count:  110
  • Reputation:   0
  • Joined:  11/13/17
  • Last Seen:  

anyone got this script?

NPC chatbox says "B>red potions"

when you click npc you will automatically sell one by one the ID number 999...... and the npc limit is 1-1000 after that the player needs to wait 24hours

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  19
  • Reputation:   7
  • Joined:  08/05/16
  • Last Seen:  

Try this script I made (Is not tested so it could not work):

prontera,150,150,7	script	Quick Sell NPC#QSN1	815,{

    goto OnClick;
    end;

    OnInit:
        // = CONFIGURE YOUR NPC HERE ==========

        // Enter the Item ID the NPC will buy
        .buyItemID = 999;

        // If 1, the npc will buy all the item stack at once
        .buyAllItems = 0;
        
        // If .buyAllItems is 0, NPC will buy the quantity set here
        .buyQuantity = 1;

        // Show deal message: 1 or not: 0
        .showDealMessage = 1;

        // ====================================

        waitingroom "B>" + getitemname(.buyItemID),0;
    end;

    OnClick:
        if (countitem(.buyItemID))
        {
            .@itemPrice = getiteminfo(.buyItemID,1);

            if (.buyAllItems)
            {
                Zeny += .@itemPrice * countitem(.buyItemID);
                .@zenyEarned = .@itemPrice * countitem(.buyItemID);
                if (.showDealMessage) dispbottom "You sold " + countitem(.buyItemID) + " " + getitemname(.buyItemID) + " for " + callfunc("F_InsertComma",.@zenyEarned) + " Zeny.";
                delitem .buyItemID,countitem(.buyItemID);
            }
            else
            {
                if (.buyQuantity > 1 && countitem(.buyItemID) < .buyQuantity)
                {
                    Zeny += .@itemPrice * countitem(.buyItemID);
                    .@zenyEarned = .@itemPrice * countitem(.buyItemID);
                    if (.showDealMessage) dispbottom "You sold " + countitem(.buyItemID) + " " + getitemname(.buyItemID) + " for " + callfunc("F_InsertComma",.@zenyEarned) + " Zeny.";
                    delitem .buyItemID,countitem(.buyItemID);
                    
                }
                Zeny += .@itemPrice * .buyQuantity;
                .@zenyEarned = .@itemPrice * .buyQuantity;
                if (.showDealMessage) dispbottom "You sold " + .buyQuantity + " " + getitemname(.buyItemID) + " for " + callfunc("F_InsertComma",.@zenyEarned) + " Zeny.";
                delitem .buyItemID,.buyQuantity;
            }
        }
        else
        {
            dispbottom "Not enough items to sell.";
        }
    end;
}

 

Edited by Songbird
  • Upvote 2
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.01
  • Content Count:  24
  • Reputation:   3
  • Joined:  06/28/21
  • Last Seen:  

On 9/10/2020 at 1:46 AM, Songbird said:

Try this script I made (Is not tested so it could not work):


prontera,150,150,7	script	Quick Sell NPC#QSN1	815,{

    goto OnClick;
    end;

    OnInit:
        // = CONFIGURE YOUR NPC HERE ==========

        // Enter the Item ID the NPC will buy
        .buyItemID = 999;

        // If 1, the npc will buy all the item stack at once
        .buyAllItems = 0;
        
        // If .buyAllItems is 0, NPC will buy the quantity set here
        .buyQuantity = 1;

        // Show deal message: 1 or not: 0
        .showDealMessage = 1;

        // ====================================

        waitingroom "B>" + getitemname(.buyItemID),0;
    end;

    OnClick:
        if (countitem(.buyItemID))
        {
            .@itemPrice = getiteminfo(.buyItemID,1);

            if (.buyAllItems)
            {
                Zeny += .@itemPrice * countitem(.buyItemID);
                .@zenyEarned = .@itemPrice * countitem(.buyItemID);
                if (.showDealMessage) dispbottom "You sold " + countitem(.buyItemID) + " " + getitemname(.buyItemID) + " for " + callfunc("F_InsertComma",.@zenyEarned) + " Zeny.";
                delitem .buyItemID,countitem(.buyItemID);
            }
            else
            {
                if (.buyQuantity > 1 && countitem(.buyItemID) < .buyQuantity)
                {
                    Zeny += .@itemPrice * countitem(.buyItemID);
                    .@zenyEarned = .@itemPrice * countitem(.buyItemID);
                    if (.showDealMessage) dispbottom "You sold " + countitem(.buyItemID) + " " + getitemname(.buyItemID) + " for " + callfunc("F_InsertComma",.@zenyEarned) + " Zeny.";
                    delitem .buyItemID,countitem(.buyItemID);
                    
                }
                Zeny += .@itemPrice * .buyQuantity;
                .@zenyEarned = .@itemPrice * .buyQuantity;
                if (.showDealMessage) dispbottom "You sold " + .buyQuantity + " " + getitemname(.buyItemID) + " for " + callfunc("F_InsertComma",.@zenyEarned) + " Zeny.";
                delitem .buyItemID,.buyQuantity;
            }
        }
        else
        {
            dispbottom "Not enough items to sell.";
        }
    end;
}

 

Thank you for this script

How to config muti item id and price.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...