Results 1 to 5 of 5

Thread: How to add to buy HP in the waypoint?

  1. #1
    Normal User
    Join Date
    Mar 2013
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4

    How to add to buy HP in the waypoint?

    The waypoint to buy the potions of my script is this below, and I want to add him to buy HP potions too, but I don't know how, I configured the entire script, I'm just depending on this waypoint.



    if not islocation() then
    gotolabel(wpt.id-3)
    else

    while windowcount(MainBP) ~= 1 or windowcount() ~= 1 do
    closewindows()
    wait(400, 600)

    closewindows()
    wait(500, 1000)
    openitem(MainBP, 'back')
    wait(500, 1000)
    resizewindows()
    wait(500, 1000)
    end
    wait(500,900)
    sellflasks()
    wait(500,900)


    if (itemcount(SMPname) < SMPtobuy) then
    opentrade()
    wait(500, 1000)
    local SMPtobuy = SMPtobuy-itemcount(SMPname)
    while SMPtobuy> 0 do
    buyitems(SMPname, SMPtobuy)
    wait(250,500)
    SMPtobuy = SMPtobuy-100
    end
    end
    end
    npcsay('Bye')
    Last edited by pink_panther; 03-03-2014 at 10:24 PM.

  2. #2
    iBot User pink_panther's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    4,075
    Mentioned
    49 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    178 Post(s)
    Reputation
    309
    Rep Power
    10
    Quote Originally Posted by marcolp View Post
    The waypoint to buy the potions of my script is this below, and I want to add him to buy HP potions too, but I don't know how, I configured the entire script, I'm just depending on this waypoint.

    You wrote a whole script yourself, but cant figure out how to buy items?

    Im skeptical


    Use:
    buyitemsupto(string item, int amount, optional int currentamount)

  3. #3
    Normal User
    Join Date
    Mar 2013
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4
    Quote Originally Posted by pink_panther View Post
    You wrote a whole script yourself, but cant figure out how to buy items?

    Im skeptical


    Use:
    buyitemsupto(string item, int amount, optional int currentamount)

    I didn't make it, I'm just editing it. I don't understand a lot. Can you help me?

  4. #4
    iBot User pink_panther's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    4,075
    Mentioned
    49 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    178 Post(s)
    Reputation
    309
    Rep Power
    10
    You need something like this in your setup somewhere

    Lua Code:
    SMPname = "Mana potion"
    SMPtobuy = 100
     
    HPname = "Health Potion"
    HPtobuy = 25


    Then just do this

    Lua Code:
     
    if not islocation() then
    	gotolabel(wpt.id-3)
    else
     
    	while windowcount(MainBP) ~= 1 or windowcount() ~= 1 do
    		closewindows()
    		wait(400, 600)
    		closewindows()
    		wait(500, 1000)
    		openitem(MainBP, 'back')
    		wait(500, 1000)
    		resizewindows() 
    		wait(500, 1000)
    	end
     
    	wait(500,900)
    	sellflasks()
    	wait(500,900)
     
    	opentrade()
    	wait(500, 1000)
     
    	buyitemsupto(SMPname, SMPtobuy, itemcount(SMPname))
    	wait(500, 1000)
    	buyitemsupto(HPname, HPtobuy, itemcount(HPname))
    	wait(500, 1000)
    end
     
     
     
    npcsay('Bye')

  5. #5
    Normal User
    Join Date
    Mar 2013
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    4
    Thank you so much

Posting Permissions

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