Signup Now
Page 3 of 18 FirstFirst 1234513 ... LastLast
Results 21 to 30 of 180

Thread: Spells Attacker

  1. #21
    Wind Powered
    Join Date
    Dec 2013
    Location
    dvscripts.com
    Posts
    7,105
    Reputation
    433
    Rep Power
    39
    i was trying with that

    --AA

    if getuseroption("SafeExori") then
    init start
    local Config = {
    Monsters = {"Tarantula", "Giant Spider", "Mutated Bat"},

    Players = {
    Consider = true,
    Distance = 10,
    FloorDifference = 1,
    SafeList = {"Bubble", "Eternal Oblivion"},
    },

    Spells = {
    {Name = "exori gran", Amount = 4},
    {Name = "exori", Amount = 2},
    {Name = "exori min", Amount = 3},
    {Name = "exori ico", Hppc = 10},
    {Name = "exori hur", Hppc = 10},
    {Name = "utito tempo", Amount = 5},
    },
    }

    -- DO NOT CHANGE ANYTHING BELOW THIS LINE

    local i, LastFloor, Exhaust, AreaConv = 1, $posz, 0, {["GFB"] = "3x3", ["WaveMedium"] = "smallwave", ["WaveVerySmall"] = "smallwave", ["WaveSmall"] = "smallwave", ["Front"] = "front", ["BeamBig"] = "bigbeam", ["BeamSmall"] = "smallbeam", ["WaveBig"] = "bigwave", ["Dist1"] = "1", ["Dist2"] = "2", ["Dist3"] = "3", ["Dist4"] = "4", ["Dist5"] = "5", ["Dist7"] = "7"}

    table.lower(Config.Monsters)

    while #Config.Spells >= i do
    local info = spellinfo(Config.Spells[i].Name)
    Config.Spells[i].Area = AreaConv[info.castarea] or info.castarea:lower()
    Config.Spells[i].Attack = info.castmode:match("Target") ~= nil
    if #info.words == 0 then
    table.remove(Config.Spells, i)
    else
    if #Config.Spells[i].Area > 0 and table.find({"smallwave", "bigwave", "smallbeam", "bigbeam", "front"}, Config.Spells[i].Area) then
    Config.Spells[i].NeedDirection = true
    else
    Config.Spells[i].NeedDirection = false
    end
    i = i + 1
    end
    end

    function cancast(spell)
    local info = spellinfo(spell)
    if info.specialeffect:match("Strength") then
    return not $strenghtened and cooldown(info.words) == 0 and $mp >= info.mp and $level >= info.level and $soul >= info.soul and $mlevel >= info.mlevel
    end
    return cooldown(info.words) == 0 and $mp >= info.mp and $level >= info.level and $soul >= info.soul and $mlevel >= info.mlevel
    end

    function findcreature(c)
    local c = type(c) == 'userdata' and getcreaturebyid(c.id) or getcreaturebyname(c)
    return c
    end

    init end

    auto(200, 400)

    if $posz ~= LastFloor then
    LastFloor, Exhaust = $posz, $timems + 2000
    return
    end

    if $timems > Exhaust then
    for _, Spell in ipairs(Config.Spells) do
    if cancast(Spell.Name) then
    if Spell.Amount and (not Config.Players.Consider or paroundfloorignore(Config.Players.Distance, Config.Players.FloorDifference, unpack(Config.Players.SafeList)) == 0) then
    local BestAmount, BestDir = 0, $self.dir
    if Spell.NeedDirection then
    for Dir, Amount in pairs({["n"] = 0, ["e"] = 0, ["s"] = 0, ["w"] = 0}) do
    Amount = maroundspell(Spell.Area, Dir, unpack(Spell.Monsters or Config.Monsters))
    if Amount > BestAmount or (Amount >= BestAmount and Dir == $self.dir) then
    BestAmount, BestDir = Amount, Dir
    end
    end
    else
    BestAmount = Spell.Attack and maroundspell(Spell.Area, BestDir, unpack(Spell.Monsters or Config.Monsters)) or maround(1, unpack(Spell.Monsters or Config.Monsters))
    end
    if BestAmount >= Spell.Amount then
    while $self.dir ~= BestDir do
    turn(BestDir)
    waitping()
    end
    cast(Spell.Name) waitping()
    end
    elseif Spell.Hppc and $attacked.dist <= (tonumber(Spell.Area) or -2) and table.find(Spell.Monsters or Config.Monsters, $attacked.name:lower()) and Spell.Hppc <= $attacked.hppc and $attacked.isshootable then
    cast(Spell.Name)
    waitping()
    end
    end
    end
    end
    else
    init start
    local Config = {
    Monsters = {"Tarantula", "Giant Spider", "Mutated Bat"},

    Players = {
    Consider = false,
    Distance = 10,
    FloorDifference = 1,
    SafeList = {"Bubble", "Eternal Oblivion"},
    },

    Spells = {
    {Name = "exori gran", Amount = 4},
    {Name = "exori", Amount = 2},
    {Name = "exori min", Amount = 3},
    {Name = "exori ico", Hppc = 10},
    {Name = "exori hur", Hppc = 10},
    {Name = "utito tempo", Amount = 5},
    },
    }

    -- DO NOT CHANGE ANYTHING BELOW THIS LINE

    local i, LastFloor, Exhaust, AreaConv = 1, $posz, 0, {["GFB"] = "3x3", ["WaveMedium"] = "smallwave", ["WaveVerySmall"] = "smallwave", ["WaveSmall"] = "smallwave", ["Front"] = "front", ["BeamBig"] = "bigbeam", ["BeamSmall"] = "smallbeam", ["WaveBig"] = "bigwave", ["Dist1"] = "1", ["Dist2"] = "2", ["Dist3"] = "3", ["Dist4"] = "4", ["Dist5"] = "5", ["Dist7"] = "7"}

    table.lower(Config.Monsters)

    while #Config.Spells >= i do
    local info = spellinfo(Config.Spells[i].Name)
    Config.Spells[i].Area = AreaConv[info.castarea] or info.castarea:lower()
    Config.Spells[i].Attack = info.castmode:match("Target") ~= nil
    if #info.words == 0 then
    table.remove(Config.Spells, i)
    else
    if #Config.Spells[i].Area > 0 and table.find({"smallwave", "bigwave", "smallbeam", "bigbeam", "front"}, Config.Spells[i].Area) then
    Config.Spells[i].NeedDirection = true
    else
    Config.Spells[i].NeedDirection = false
    end
    i = i + 1
    end
    end

    function cancast(spell)
    local info = spellinfo(spell)
    if info.specialeffect:match("Strength") then
    return not $strenghtened and cooldown(info.words) == 0 and $mp >= info.mp and $level >= info.level and $soul >= info.soul and $mlevel >= info.mlevel
    end
    return cooldown(info.words) == 0 and $mp >= info.mp and $level >= info.level and $soul >= info.soul and $mlevel >= info.mlevel
    end

    function findcreature(c)
    local c = type(c) == 'userdata' and getcreaturebyid(c.id) or getcreaturebyname(c)
    return c
    end

    init end

    auto(200, 400)

    if $posz ~= LastFloor then
    LastFloor, Exhaust = $posz, $timems + 2000
    return
    end

    if $timems > Exhaust then
    for _, Spell in ipairs(Config.Spells) do
    if cancast(Spell.Name) then
    if Spell.Amount and (not Config.Players.Consider or paroundfloorignore(Config.Players.Distance, Config.Players.FloorDifference, unpack(Config.Players.SafeList)) == 0) then
    local BestAmount, BestDir = 0, $self.dir
    if Spell.NeedDirection then
    for Dir, Amount in pairs({["n"] = 0, ["e"] = 0, ["s"] = 0, ["w"] = 0}) do
    Amount = maroundspell(Spell.Area, Dir, unpack(Spell.Monsters or Config.Monsters))
    if Amount > BestAmount or (Amount >= BestAmount and Dir == $self.dir) then
    BestAmount, BestDir = Amount, Dir
    end
    end
    else
    BestAmount = Spell.Attack and maroundspell(Spell.Area, BestDir, unpack(Spell.Monsters or Config.Monsters)) or maround(1, unpack(Spell.Monsters or Config.Monsters))
    end
    if BestAmount >= Spell.Amount then
    while $self.dir ~= BestDir do
    turn(BestDir)
    waitping()
    end
    cast(Spell.Name) waitping()
    end
    elseif Spell.Hppc and $attacked.dist <= (tonumber(Spell.Area) or -2) and table.find(Spell.Monsters or Config.Monsters, $attacked.name:lower()) and Spell.Hppc <= $attacked.hppc and $attacked.isshootable then
    cast(Spell.Name)
    waitping()
    end
    end
    end
    end
    end


    but its showing error
    error in Persistent script NewPersistentScript:
    ["end"]:NewPersistentScript:96: '<eof>' expected near 'end'


    is way to fix that ?

  2. #22
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    Quote Originally Posted by Dworak View Post
    i was trying with that

    -- code

    but its showing error
    error in Persistent script NewPersistentScript:
    ["end"]:NewPersistentScript:96: '' expected near 'end'


    is way to fix that ?
    Just add a line on the script like UNF said. (Line 61)

    -- script removed due to new version
    Last edited by Leonardo; 01-05-2014 at 07:33 PM.

  3. #23
    Wind Powered
    Join Date
    Dec 2013
    Location
    dvscripts.com
    Posts
    7,105
    Reputation
    433
    Rep Power
    39
    Great One !!
    Thanks for you , Pro !

  4. #24
    Moderator mistgun's Avatar
    Join Date
    Dec 2013
    Location
    Lodz, Poland
    Posts
    1,821
    Reputation
    220
    Rep Power
    26
    just try
    local pvpworld = getuseroption('pvpworld')
    consider = pvpworld

  5. #25
    Free User
    Join Date
    Dec 2013
    Location
    Netherlands!
    Posts
    26
    Reputation
    22
    Rep Power
    0
    good work but it doesnt rlly work good

  6. #26
    Moderator mistgun's Avatar
    Join Date
    Dec 2013
    Location
    Lodz, Poland
    Posts
    1,821
    Reputation
    220
    Rep Power
    26
    Quote Originally Posted by supreme killer View Post
    good work but it doesnt rlly work good
    Huh what do you mean? :P

  7. #27
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    There are some stuff that needs to be fixed, will come after the holidays.

  8. #28
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    Script updated.

    Fixed the problem with secondary monster list.
    Improved the exhaust for each spell.
    Added special areas, it'll avoid casting if you are inside a special area, just add the positions to the SpecialAreas section or let it empty if you don't want to use this feature.

    I didn't added compat with runes because there is more stuff like shooting at target/self/crosshair and it would make the code a little harder to configure, so I'll just do another script for that.

  9. #29
    Moderator mistgun's Avatar
    Join Date
    Dec 2013
    Location
    Lodz, Poland
    Posts
    1,821
    Reputation
    220
    Rep Power
    26
    Thank you for listening my request for special areas Its great !

  10. #30
    Wind Powered
    Join Date
    Dec 2013
    Location
    dvscripts.com
    Posts
    7,105
    Reputation
    433
    Rep Power
    39
    can you make version with

    Config.Players.Consider = getuseroption("SafeExori")
    too ?
    please

 

 

Posting Permissions

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