Results 1 to 9 of 9

Thread: Need help with medicine pouch changer

  1. #1
    iBot User Chudson's Avatar
    Join Date
    Nov 2014
    Posts
    82
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    24 Post(s)
    Reputation
    57
    Rep Power
    3

    Need help with medicine pouch changer

    Hello,

    i make a script for Swamp Trolls in Venore. 99% works fine.
    But i have a big problem with change a medicine pouch in NPC.
    Can someone help me with that?

    Script is >>here<<
    Last edited by Drakke; 01-10-2015 at 02:39 AM.

  2. #2
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    390 Post(s)
    Reputation
    366
    Rep Power
    10
    Quote Originally Posted by Chudson View Post
    Hello,

    i make a script for Swamp Trolls in Venore. 99% works fine.
    But i have a big problem with change a medicine pouch in NPC.
    Can someone help me with that?

    Script is >>here<<
    What exactly you need help with?
    I made a script for venore swamp trolls too, and change in the pouches.

    I'm guessing you can't use the belongings of a deceased or whatever the item is called?
    It's not in item.xml, so you need to use the itemid for it, same with most crap items you get from it such as cape, broken piggy bank etc you also need the itemid to toss it to the ground.

    Don't have the script here so can't show you my code for it ;p

  3. #3
    iBot User Chudson's Avatar
    Join Date
    Nov 2014
    Posts
    82
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    24 Post(s)
    Reputation
    57
    Rep Power
    3
    @Drakke, no, opening these things is not a problem, throwing garbage too.

    I have problem in looping action. As long as the medicine should be to exchange NPC will say "Sorry, you do not have"

    while NPC doeas dont say ("sorry, you dont..." then
    change medicine
    throw garbage
    move valuable loot
    end


  4. #4
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    390 Post(s)
    Reputation
    366
    Rep Power
    10
    I have it something like this, to do one thing at a time, but not hard to change so everything is in one go

    Lua Code:
     
    local valuables = {'names'}
    local trash = {most of them needs to be on id and not name}
     
     
    while itemcount('medicine pouch') > 0 do
    Say blabla
    Say blabla
    Useitem('id')
    end
     
    for i=1,#valuables do
    while itemcount(valuables[i],mainbp) > 0 do
    moveitems(valuables[i],lootbp,100)
    end
    end
     
    for j=1,#trash do
    while itemcount(trash[j]) > 0 do
    moveitems(trash[j],ground,100)
    end
    end

  5. #5
    iBot User Chudson's Avatar
    Join Date
    Nov 2014
    Posts
    82
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    24 Post(s)
    Reputation
    57
    Rep Power
    3
    @Drakke
    There is one problem with that action...
    Its stops when bot does not see a medicine in opened BP. When im backing from hunt i have ~30/40 of them.

    I try to make something like this...

    WPT
    Lua Code:
     
     
    local AAA = getsettings(blablabla)
    local BBB = AAA+0
     
    while BBB == 0 then 
    change medicine
    throw trash, etc
    end


    Action1 - blablabla
    Lua Code:
     
    0


    Action2 - Stop
    Lua Code:
     
    local AAA = getsettings(blablabla)
    local BBB = AAA+1
    getnewmessage
    if NPC says "sorry, you dont have" then
    setsettings('blablabla', BBB)
    end


    And WPT Afterall
    setsettings('blablabla', '0')

    but its very slow

  6. #6
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    390 Post(s)
    Reputation
    366
    Rep Power
    10
    Quote Originally Posted by Chudson View Post
    @Drakke
    There is one problem with that action...
    Its stops when bot does not see a medicine in opened BP. When im backing from hunt i have ~30/40 of them.

    I try to make something like this...

    WPT
    Lua Code:
     
     
    local AAA = getsettings(blablabla)
    local BBB = AAA+0
     
    while BBB == 0 then 
    change medicine
    throw trash, etc
    end


    Action1 - blablabla
    Lua Code:
     
    0


    Action2 - Stop
    Lua Code:
     
    local AAA = getsettings(blablabla)
    local BBB = AAA+1
    getnewmessage
    if NPC says "sorry, you dont have" then
    setsettings('blablabla', BBB)
    end


    And WPT Afterall
    setsettings('blablabla', '0')

    but its very slow
    You can make it in a whole loop

    for k=1,3 do -- 3 changed to how many bps you have
    everything here
    open new lootbp here
    end

  7. #7
    iBot User Chudson's Avatar
    Join Date
    Nov 2014
    Posts
    82
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    24 Post(s)
    Reputation
    57
    Rep Power
    3
    Quote Originally Posted by Drakke View Post
    You can make it in a whole loop

    for k=1,3 do -- 3 changed to how many bps you have
    everything here
    open new lootbp here
    end
    I will try it immediately.

  8. #8
    iBot User Chudson's Avatar
    Join Date
    Nov 2014
    Posts
    82
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    24 Post(s)
    Reputation
    57
    Rep Power
    3
    Thx, its working very well
    REP+

    SOLVED!

  9. #9
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    390 Post(s)
    Reputation
    366
    Rep Power
    10
    Quote Originally Posted by Chudson View Post
    Thx, its working very well
    REP+

    SOLVED!
    Glad I could help!

Posting Permissions

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