Signup Now
Results 1 to 7 of 7

Thread: Force leave

  1. #1
    Free User
    Join Date
    Aug 2014
    Posts
    8
    Reputation
    10
    Rep Power
    0

    Red face Force leave

    Hello guys, I need a simple action: when I'm with the leave supply number or ammo, the force leave will stop targeting and stop everything and will go directly to the city to ressupply. Can someone do it for me?

  2. #2
    Helper StaR's Avatar
    Join Date
    Dec 2013
    Location
    Manchester
    Posts
    712
    Reputation
    50
    Rep Power
    23
    Something like this:

    init start
    local ManaName = 'strong mana potion'
    local MinManas = 10

    local AmmoName = 'prismatic bolt'
    local MinAmmo = 50

    ACTIVATED = false
    init end


    auto(1000)
    if (itemcount(ManaName) < MinManas or itemcount(AmmoName) < MinAmmo) and not ACTIVATED then
    if not $trapped then
    settargeting('no')
    else
    settargeting('yes')
    end
    if $targeting.id > 0 then
    stopattack()
    end
    gotolabel('CITY') -- change to refill label
    ACTIVATED = true
    else
    settargeting('yes')
    end
    Last edited by StaR; 05-18-2015 at 12:05 PM.



  3. #3
    Wind Tester
    Join Date
    Dec 2013
    Location
    Warsaw, Poland
    Posts
    2,568
    Reputation
    149
    Rep Power
    28
    @StaR, it will keep changing waypoint forever
    init start
    local ManaName = 'strong mana potion'
    local MinManas = 10


    local AmmoName = 'prismatic bolt'
    local MinAmmo = 50

    ACTIVATED = false
    init end


    auto(1000)
    if (itemcount(ManaName) < MinManas or itemcount(AmmoName) + $belt.count < MinAmmo) and not ACTIVATED then
    settargeting('no')
    if $targeting.id > 0 then
    stopattack()
    end
    gotolabel('CITY') -- change to refill label
    ACTIVATED = true
    else
    settargeting('yes')
    end


    Also, disabling targeting is bad idea, once you really know what you are doing. I would go for changing monsters to attack only if trapped.

  4. #4
    Helper StaR's Avatar
    Join Date
    Dec 2013
    Location
    Manchester
    Posts
    712
    Reputation
    50
    Rep Power
    23
    Correct thank's for informing me! I'll edit mine also!



  5. #5
    Free User blakw's Avatar
    Join Date
    Dec 2013
    Posts
    2,666
    Reputation
    73
    Rep Power
    27
    @StaR itemcount() already count amounts on equipment slots.


    Visit:
    (◣_◢)

  6. #6
    Helper StaR's Avatar
    Join Date
    Dec 2013
    Location
    Manchester
    Posts
    712
    Reputation
    50
    Rep Power
    23
    @blakw, correct thanks!



  7. #7
    Free User
    Join Date
    Aug 2014
    Posts
    8
    Reputation
    10
    Rep Power
    0
    Guys, thank you very much for your attention and your help, I really appreciate.

 

 

Posting Permissions

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