Results 1 to 7 of 7

Thread: Action - talking to npc and move potions to bp?

  1. #1
    iBot User
    Join Date
    May 2012
    Posts
    334
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    48
    Rep Power
    5

    Action - talking to npc and move potions to bp?

    if not islocation() then gotolabel("PotionShop") else

    npcsay("hi")
    wait(300,450)
    npcsay("trade")
    wait(900,1350)

    while (itemcount(285)+itemcount(284)+itemcount(283)) > 9 do
    npcsay("vials")
    wait(300,450)
    npcsay("yes")
    wait(300,450)
    end

    buyitemsupto(nameMp,maxMp,itemcount(nameMp))
    wait(900,1350)

    buyitemsupto(nameRune2,maxRune2,itemcount(nameRune 2))
    wait(900,1350)

    end


    as topic says, i want the bot to move mana pots after buying 100 mp's, can someone write finish this code and give me it thanks.
    i want to move the manapotions to "SupplyBp". thanks

  2. #2
    Normal User Tomix's Avatar
    Join Date
    Aug 2012
    Posts
    78
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    36
    Rep Power
    5
    PHP Code:
    moveitems(nameMpmainbpSupplyBpmaxMpwait(1000
    not tested, try and say is it work

    mainbp is ofc. your back bp - change for yourself if it has different name in settings. You can try changing maxMp to the exact amount of mps.
    Last edited by Tomix; 01-26-2013 at 06:03 AM.

  3. #3
    Normal User Balbek's Avatar
    Join Date
    May 2012
    Location
    LDZ
    Posts
    554
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    4 Post(s)
    Reputation
    84
    Rep Power
    6
    PHP Code:
    local random_flask math.random(1,2)
    local flask_count = (itemcount(283) + itemcount(284) + itemcount(285))
    local current_mana itemcount(nameMp)

    -- [[ 
    selling flasks ]] 

    if 
    ischannel("NPCs"then
             npcsay
    ("hi")
             
    wait(500,900)
    else
             
    say("hi")
             
    wait(1200,1700)
    end
    if (random_flask == 1then   
         
    if flask_count 0 then
             npcsay
    ("vials")
             
    wait(300,700)
         
    end
         
    while flask_count do
             
    npcsay("yes")
             
    wait(200,500)
         
    flask_count = (itemcount(283) + itemcount(284) + itemcount(285))
         
    end
    else
         if 
    not tradeopen then
              npcsay
    ("trade")
              
    wait(1000,1300)
         
    end
         
    for 283285 do
              
    local count itemcount(i)
              while 
    count do
                    
    sellitems(icount)
                    
    wait(300,500)
                    
    count itemcount(i)
              
    end
         end
    end

    -- [[ buying mps ]] 

    mana_missing maxMp current_mana

    if not tradeopen then
           npcsay
    ("trade")
           
    wait(1000,1500)
    end
    while mana_missing do
           
    buyitems(nameMpmana_missing)
           
    wait(600,1000)
           
    moveitems(nameMp"all"SupplyBp100)
           
    wait(500,1000)
           
    mana_missing mana_missing 100
    end 

    if its not gonna work then go to help > debug and check if the bot returns any error
    Last edited by Balbek; 01-26-2013 at 07:00 AM.

  4. #4
    iBot User
    Join Date
    May 2012
    Posts
    334
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    48
    Rep Power
    5
    Quote Originally Posted by Balbek View Post
    PHP Code:
    local random_flask math.random(1,2)
    local flask_count = (itemcount(283) + itemcount(284) + itemcount(285))
    local current_mana itemcount(nameMp)

    -- [[ 
    selling flasks ]] 

    if 
    ischannel("NPCs"then
             npcsay
    ("hi")
             
    wait(500,900)
    else
             
    say("hi")
             
    wait(1200,1700)
    end
    if (random_flask == 1then   
         
    if flask_count 0 then
             npcsay
    ("vials")
             
    wait(300,700)
         
    end
         
    while flask_count do
             
    npcsay("yes")
             
    wait(200,500)
         
    flask_count = (itemcount(283) + itemcount(284) + itemcount(285))
         
    end
    else
         if 
    not tradeopen then
              npcsay
    ("trade")
              
    wait(1000,1300)
         
    end
         
    for 283285 do
              
    local count itemcount(i)
              while 
    count do
                    
    sellitems(icount)
                    
    wait(300,500)
                    
    count itemcount(i)
              
    end
         end
    end

    -- [[ buying mps ]] 

    mana_missing maxMp current_mana

    if not tradeopen then
           npcsay
    ("trade")
           
    wait(1000,1500)
    end
    while mana_missing do
           
    buyitems(nameMpmana_missing)
           
    wait(600,1000)
           
    moveitems(nameMp"all"SupplyBp100)
           
    wait(500,1000)
           
    mana_missing mana_missing 100
    end 

    if its not gonna work then go to help > debug and check if the bot returns any error
    18:48 : LUA:CaveBotAction - LuaInterface.LuaScriptException: [string "chunk"]:55: 'end' expected (to close 'if' at line 1) near ''

  5. #5
    Normal User Balbek's Avatar
    Join Date
    May 2012
    Location
    LDZ
    Posts
    554
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    4 Post(s)
    Reputation
    84
    Rep Power
    6
    Quote Originally Posted by curry View Post
    18:48 : LUA:CaveBotAction - LuaInterface.LuaScriptException: [string "chunk"]:55: 'end' expected (to close 'if' at line 1) near ''
    Are you sure that you only pasted the code i gave you and didnt add anything else? I've now tested it and it works all fine.

  6. #6
    Normal User Balbek's Avatar
    Join Date
    May 2012
    Location
    LDZ
    Posts
    554
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    4 Post(s)
    Reputation
    84
    Rep Power
    6
    Well, I assume that you wanted to add location check as I just noticed that you've mentioned it in the first post. You should just add another action for the location check that will check it before selling vials / buying mps.

  7. #7
    iBot User
    Join Date
    May 2012
    Posts
    334
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    48
    Rep Power
    5
    Quote Originally Posted by Balbek View Post
    Well, I assume that you wanted to add location check as I just noticed that you've mentioned it in the first post. You should just add another action for the location check that will check it before selling vials / buying mps.
    yes, it work with only the manas but i want to buy

    buyitemsupto(nameRune2,maxRune2,itemcount(nameRune 2))
    wait(900,1350)

    aswell?! where to add

Posting Permissions

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