Signup Now
Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Free User eXotaur's Avatar
    Join Date
    Feb 2014
    Location
    Netherlands
    Posts
    281
    Reputation
    31
    Rep Power
    21

    How would I make this?

    Okay I'd want to do something like this:

    if current waypoint is > x and higher than x in the 'Spawn' waypoint section AND ypos is > x and xpos > x then
    dosomething()


    How I'd do that?

    The thing is, the bot rarely crosses a special area it really shouldn't. But when it does that I want it to set some monsters to only kill if trapped and to NOT loot any. So it will run to the next waypoint and attack&loot everything again. I thought this would be the best method.

  2. #2
    Moderator Dehan's Avatar
    Join Date
    Dec 2013
    Posts
    1,404
    Reputation
    315
    Rep Power
    26
    @eXotaur First I would start by posting on the right forum section/reading the forum rules.

    Thread Moved

  3. #3
    Free User KrusT's Avatar
    Join Date
    Jul 2014
    Posts
    332
    Reputation
    15
    Rep Power
    20
    @eXotaur briefly speaking you want, if bot cross some special area he disable this special area?

    try this

    auto(100)
    if $wptsection == "Zebra" and $posy >= 11111 then
    setsetting('Cavebot/SpecialAreas/Area Zebra/Policy', 'None')
    else
    wait(10000)
    setsetting('Cavebot/SpecialAreas/Area Zebra/Policy', 'Targeting')
    end
    Last edited by KrusT; 11-19-2014 at 12:34 AM.

  4. #4
    Free User eXotaur's Avatar
    Join Date
    Feb 2014
    Location
    Netherlands
    Posts
    281
    Reputation
    31
    Rep Power
    21
    Thanks! but nope.

    If the bot will cross the special area, it needs to set some monsters to only kill if trapped and to NOT loot any. So it will run to the next waypoint and attack&loot everything again.

  5. #5
    Free User KrusT's Avatar
    Join Date
    Jul 2014
    Posts
    332
    Reputation
    15
    Rep Power
    20
    Quote Originally Posted by eXotaur View Post
    Thanks! but nope.

    If the bot will cross the special area, it needs to set some monsters to only kill if trapped and to NOT loot any. So it will run to the next waypoint and attack&loot everything again.
    its not better you remove this special area and put one action when char go refill to set all targetings to "only if traped" and "dont loot"

    more easy if this are for a refill thing

  6. #6
    Free User eXotaur's Avatar
    Join Date
    Feb 2014
    Location
    Netherlands
    Posts
    281
    Reputation
    31
    Rep Power
    21
    Okay so I described the situation in this picture:



    The green broken circle is the spawn I'm botting, the red circle is a dangerous spawn pretty close. Its no problem if monsters from the red spawn get lured into the green area.
    The green arrows are how the bot will walk.

    The purple lines are special areas.
    Just before the first purple line, bot will set all monsters to kill 'Only if trapped'. Also it will cast strong haste and it will run to a waypoint after the second purple line. So it will run trough the red part of the spawn without killing anything.
    After it reaches that waypoint, bot will kill monsters again like normally.

    But rarely, monsters will run past purple line #2, and the bot will cross the purple line to loot it or kill it and loot. See where I'm going? If this happens, the bot will be near the red dangerous spawn, and monsters will lure my char there. If this happens, the char will die.

    So I want it to NEVER cross the 2nd purple line when it reached the waypoint after it.
    How would I do that?

  7. #7
    Free User KrusT's Avatar
    Join Date
    Jul 2014
    Posts
    332
    Reputation
    15
    Rep Power
    20
    Quote Originally Posted by eXotaur View Post
    Okay so I described the situation in this picture:



    The green broken circle is the spawn I'm botting, the red circle is a dangerous spawn pretty close. Its no problem if monsters from the red spawn get lured into the green area.
    The green arrows are how the bot will walk.

    The purple lines are special areas.
    Just before the first purple line, bot will set all monsters to kill 'Only if trapped'. Also it will cast strong haste and it will run to a waypoint after the second purple line. So it will run trough the red part of the spawn without killing anything.
    After it reaches that waypoint, bot will kill monsters again like normally.

    But rarely, monsters will run past purple line #2, and the bot will cross the purple line to loot it or kill it and loot. See where I'm going? If this happens, the bot will be near the red dangerous spawn, and monsters will lure my char there. If this happens, the char will die.

    So I want it to NEVER cross the 2nd purple line when it reached the waypoint after it.
    How would I do that?
    the 2 special areas are just for target or cavebot too?

  8. #8
    Moderator Raphael's Avatar
    Join Date
    Dec 2013
    Location
    raphseller.com
    Posts
    2,441
    Reputation
    309
    Rep Power
    28
    Because I like simple solutions with over-complicated code behind them and because I somehow gotta promote the use of the code I wrote myself, here's my take on this:

    Make the purple special area a rectangular one, such as this:


    Preferably border-only, but it doesn't really matter.

    Then use this code:

    init start
    -- This is case sensitive
    local specialAreaName = 'dangerousShit'

    -- DO NOT EDIT BELOW THIS LINE --
    local specialArea

    foreach settingsentry e 'Cavebot/SpecialAreas' do
    if get(e, 'Name') == specialAreaName then
    specialArea = Area:createFromSpecialArea(e)
    end
    end
    init end

    auto(100)
    if specialArea:hasPoint({$posx, $posy}) then
    -- Inside dangerous area
    else
    -- Outside dangerous area
    end

  9. #9
    Free User eXotaur's Avatar
    Join Date
    Feb 2014
    Location
    Netherlands
    Posts
    281
    Reputation
    31
    Rep Power
    21
    That would be a perfect idea indeed, but I can't just drop down a rectangular figure out there..



    I've marked the special areas purple, and the ignorable area pinkish. So you can see the whole figure which needs to be ignored..

  10. #10
    Moderator Raphael's Avatar
    Join Date
    Dec 2013
    Location
    raphseller.com
    Posts
    2,441
    Reputation
    309
    Rep Power
    28
    K, this should solve it by allowing multiple special areas:

    init start
    -- This is case sensitive
    local specialAreaNames = {
    'dangerousShit1',
    'dangerousShit2',
    'dangerousShit3'
    }

    -- DO NOT EDIT BELOW THIS LINE --
    local specialAreas = {}

    foreach settingsentry e 'Cavebot/SpecialAreas' do
    if table.find(specialAreaNames, get(e, 'Name')) then
    table.insert(specialAreas, Area:createFromSpecialArea(e))
    end
    end

    -- I plan to add this to my lib on the next update. Maybe
    local function table.any(self, condition)
    for k, v in pairs(self) do
    if condition(v, k) then
    return true
    end
    end

    return false
    end
    init end

    auto(100)
    if table.any(specialAreas, function(v) return v:hasPoint({$posx, $posy}) end) then
    -- Inside dangerous area
    else
    -- Outside dangerous area
    end

 

 

Posting Permissions

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