Results 1 to 3 of 3

Thread: Help on making own scripts

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

    Help on making own scripts

    I need someone who can help me out to make my own scripts. I am having some issues with some actions and I think a scripter with decent experience would be able to help me. This scripts will most likely be released to the community. If someone can help me out I would really appreciate it.

    For example: I am currently making a script but I cannot go past the buying manas option because it will buy and endless amount of manas and will get stuck in there:

    Action List
    Code:
    MainBp = "Brocade Backpack"
    RareBp = "Yellow Backpack"
    GoldBp = "Golden Backpack"
    DepotBp = "Green Backpack"
    StackBp = "Grey Backpack"
    LootBp = "Blue Backpack"
    
    MpCount = 70
    MpType = "mana potion"
    MpPrice = 50
    AmmoCount = 20
    AmmoType = "royal spear"
    AmmoPrice = 20
    
    MpLeave = 10
    AmmoLeave = 7
    CapLeave = 30
    Banker:
    Code:
    local Mana = positive(MpCount - itemcount("mana potion"))*MpPrice
    findcreature("Tesha")
    say("hi")
    wait(1500,2500)
    npcsay("deposit all")
    wait(200,300)
    npcsay("yes")
    wait(200,300)
    
    if Mana> 0 then
    npcsay("withdraw "..Mana)
    wait(200,300)
    npcsay("yes")
    wait(200,300)
    npcsay("balance")
    wait(200,400)
    end
    Mana Refiller:
    Code:
    findcreature("Mehkesh") 
    wait(500,1000) 
    sellflasks() 
    wait(500,900) 
    opentrade() 
    wait(500,800) 
     
    local Potions = MpCount - itemcount("mana potion")
    
    while Potions> 0 do 
    buyitems("mana potion", Potions) 
    wait(500,900)
    npcsay("bye")
    wait(500,900)
    Potions = Potions-100
    end

    The North Remembers

  2. #2
    Normal User
    Join Date
    Aug 2012
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    1 Post(s)
    Reputation
    21
    Rep Power
    5
    Just use
    Code:
    buyitemsupto("mana potion", 50)
    instead of
    Code:
    local Potions = MpCount - itemcount("mana potion")
    
    while Potions> 0 do 
    buyitems("mana potion", Potions) 
    wait(500,900)
    npcsay("bye")
    wait(500,900)
    Potions = Potions-100
    end
    seems to be easier.

    or you can add
    Code:
    local potions = buyitemsupto("mana potion", MpCount)
    then action:
    Code:
    while itemcount('mana potion") < MpCount do
    potions
    end
    @down
    ye, right
    Last edited by Scross; 08-04-2013 at 04:51 PM.

  3. #3
    Banned
    Join Date
    Nov 2012
    Location
    Sweden
    Posts
    450
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    65
    Rep Power
    0
    I would rather use


    buyitemsupto(MpType, MpCount)


    that way you don't have to change the mana shop action and setup everytime if you're going to buy other potions, just the setup.



    reachcreature("Mehkesh")

    if itemcount(283) > 0 or itemcount(284) > 0 or itemcount(285) > 0 then
    say("hi")
    wait(350,500)
    npcsay("vials")
    wait(350,500)
    npcsay("yes")
    wait(350,500)
    end

    if itemcount(283) > 0 or itemcount(284) > 0 or itemcount(285) > 0 then
    npcsay("yes")
    wait(350,500)
    end

    if itemcount(283) > 0 or itemcount(284) > 0 or itemcount(285) > 0 then
    npcsay("yes")
    wait(350,500)
    end

    if itemcount(283) > 0 or itemcount(284) > 0 or itemcount(285) > 0 then
    npcsay("yes")
    wait(350,500)
    end

    if itemcount(MpType) < MpCount then
    buyitemsupto(MpType, MpCount)
    wait(500,900)
    npcsay("bye")
    wait(500,900)
    end
    Last edited by PromB; 08-04-2013 at 04:58 PM.

Posting Permissions

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