Signup Now
Page 1 of 4 123 ... LastLast
Results 1 to 10 of 38
  1. #1
    Free User
    Join Date
    Dec 2014
    Posts
    66
    Reputation
    24
    Rep Power
    19

    Post Advanced Shooter for Mages

    Well here's my version of an advanced shooter for mages.
    It incorporates strike spells, area spells, area runes and target runes.

    Again, this Leonardo guy gets credits for checking if it's safe to cast area spells and runes, he's somewhat good isn't he.
    If you hate the comments in the scripts, feel free to delete them, just for reference and education.

    -- Advanced Shooter for Mages
    -- Version 1.0.1 - By Heronas
    -- Credits for playercheck go to Leonardo
    init start
    -- Set monsters to consider when using spells/area runes
    local creatureNames = {
    'Crystal Spider',
    'Frost Dragon'
    }

    -- Spells such as beams/waves/UEs and even knight/paladin spells can be set here
    -- Example: {name = "exevo vis hur", amount = 3, monsters = {'Hydra'}},
    -- name = spell name or words, amount = monster amount, monsters = monsters to consider
    local spells = {
    {name = "exevo gran mas vis", amount = 4},
    {name = "exevo vis hur", amount = 3},
    {name = "exevo vis hur", amount = 2, monsters = {'Frost Dragon'}},
    {name = "exevo gran vis lux", amount = 2},
    }

    -- Area runes such as thunderstorms can be set here
    -- Example: {name = "thunderstorm rune", amount = 3, monsters = {'Crystal Spider'}},
    -- name = rune name, amount = monster amount, monsters = monsters to consider
    local areaRunes = {
    {name = "avalanche rune", amount = 3}
    }

    -- Target runes such as SDs can be set here, for now only supports 1 targetrune
    -- Example: {name = "sudden death rune", amount = 3, monsters = {'Demon'}},
    -- name = rune name, amount = monster amount, monsters = monsters to consider
    local targetRunes = {
    {name = "sudden death rune", amount = 3, monsters = {'Frost Dragon'}},
    }

    -- Check for players, taken from Leonardo's scripts
    local players = {
    consider = true,
    distance = 20,
    safeList = {"Bubble", "Eternal Oblivion"},
    floorDifference = 1
    }

    -- Set to true to use strong strikes
    local strongStrike = true

    -- DON'T EDIT BELOW THIS LINE IF YOU DON'T KNOW WHAT YOU'RE DOING --
    --------------------------------------------------------------------

    -- Directions to check
    local shootDir = {'n', 'w', 's', 'e'}

    -- Initial values for loop iteration
    local quitLoop = 0
    local exhaustTime = 0
    local strongExhaustTime = 0
    local countTries = 0
    local areaCountLow = 10
    local spellCountLow = 10

    for i,j in pairs(spells) do
    if spellCountLow > spells[i].amount then
    spellCountLow = spells[i].amount
    end
    spells[i].monsters = spells[i].monsters or creatureNames
    end

    for i,j in pairs(areaRunes) do
    if areaCountLow > areaRunes[i].amount then
    areaCountLow = areaRunes[i].amount
    end
    areaRunes[i].monsters = areaRunes[i].monsters or creatureNames
    end

    for i,j in pairs(targetRunes) do
    targetRunes[i].monsters = targetRunes[i].monsters or creatureNames
    end

    -- Prints
    print('Started advanced mage shooter.')
    init end

    auto(50, 100)
    quitLoop = 0

    -- Reset exhaust time if a new projectile is fired from your position to your target's position
    if $lastprojectile.tox == $attacked.posx and $lastprojectile.toy == $attacked.posy and $lastprojectile.fromx == $posx and $lastprojectile.fromy == $posy then
    exhaustTime = $timems
    end

    if $timems >= exhaustTime then
    if not players.consider or paroundfloorignore(players.distance, players.floorDifference, unpack(players.safeList)) == 0 then
    -- Spells
    if maround(8) >= spellCountLow and spells[1] ~= nil then
    for i,_ in pairs(spells) do
    if cancast(spells[i].name) then
    for j,_ in pairs(shootDir) do
    if maroundspell(spells[i].name, shootDir[j], unpack(spells[i].monsters)) >= spells[i].amount then
    pausewalking(100)
    turn(shootDir[j])
    cast(spells[i].name)
    quitLoop = 1
    end
    end
    end
    end
    end

    -- Area Runes
    if maround(8) >= areaCountLow and areaRunes[1] ~= nil and quitLoop ~= 1 then
    for i,_ in pairs(areaRunes) do
    runeArea = getarearunetile(false, unpack(areaRunes[i].monsters))
    if runeArea.amount >= areaRunes[i].amount and itemcount(areaRunes[i].name) ~= 0 then
    countTries = 0
    pausewalking(500)
    useitemon(areaRunes[i].name, 0, runeArea.tile)
    wait(500)
    countTries = 1
    if $lastprojectile.time <= exhaustTime then
    countTries = 2
    end
    quitLoop = 1
    end
    end
    end
    end

    -- Targetrunes and strikes
    if $attacked.id ~=0 and quitLoop == 0 then
    if maround(7, unpack(targetRunes[1].monsters)) >= targetRunes[1].amount then
    useoncreature(targetRunes[1].name, $target)
    elseif $timems >= strongExhaustTime and strongStrike then
    caststrongstrike(1000)
    strongExhaustTime = $timems + 5000
    else
    caststrike(1000)
    end
    end

    -- Add exhaust time, takes into account if you missfire an area rune
    exhaustTime = $timems + 1000 - countTries*500
    end


    Because a few people requested it in this thread, here is a paladin version:

    -- Advanced Shooter for Paladins
    -- Version 1.0.0 - By Heronas
    -- Credits for playercheck go to Leonardo
    init start
    -- Set monsters to consider when using spells/area runes
    local creatureNames = {
    'Skeleton',
    'Ghoul',
    }

    -- Spells such as beams/waves/UEs and even knight/paladin spells can be set here
    -- Example: {name = "exevo vis hur", amount = 3, monsters = {'Hydra'}},
    -- name = spell name or words, amount = monster amount, monsters = monsters to consider
    local spells = {
    {name = "exevo mas san", amount = 4, monsters = {'Ghoul'}},
    {name = "exevo mas san", amount = 3},
    }

    -- Area runes such as thunderstorms can be set here
    -- Example: {name = "thunderstorm rune", amount = 3, monsters = {'Crystal Spider'}},
    -- name = rune name, amount = monster amount, monsters = monsters to consider
    local areaRunes = {
    {name = "avalanche rune", amount = 5}
    }

    -- Target runes such as SDs can be set here, for now only supports 1 targetrune
    -- Example: {name = "sudden death rune", amount = 3, monsters = {'Demon'}},
    -- name = rune name, amount = monster amount, monsters = monsters to consider

    -- NOTE: FOR NOW ONLY WORKS FOR 1 TARGETRUNE AND IT NEEDS A MONSTERS PARAMETER!!!!
    local targetRunes = {
    {name = "holy missile rune", amount = 2, monsters = {'Ghoul'}}
    }

    -- Check for players, taken from Leonardo's scripts
    local players = {
    consider = true,
    distance = 20,
    safeList = {"Bubble", "Eternal Oblivion"},
    floorDifference = 1
    }

    -- Set to true to use strong strikes
    local strongStrike = true

    -- DON'T EDIT BELOW THIS LINE IF YOU DON'T KNOW WHAT YOU'RE DOING --
    --------------------------------------------------------------------

    -- Directions to check
    local shootDir = {'n', 'w', 's', 'e'}

    -- Initial values for loop iteration
    local quitLoop = 0
    local exhaustTime = 0
    local strongExhaustTime = 0
    local countTries = 0
    local areaCountLow = 10
    local spellCountLow = 10

    for i,j in pairs(spells) do
    if spellCountLow > spells[i].amount then
    spellCountLow = spells[i].amount
    end
    spells[i].monsters = spells[i].monsters or creatureNames
    end

    for i,j in pairs(areaRunes) do
    if areaCountLow > areaRunes[i].amount then
    areaCountLow = areaRunes[i].amount
    end
    areaRunes[i].monsters = areaRunes[i].monsters or creatureNames
    end

    for i,j in pairs(targetRunes) do
    targetRunes[i].monsters = targetRunes[i].monsters or creatureNames
    end

    -- Prints
    print('Started advanced paladin shooter.')
    init end

    auto(50, 100)
    quitLoop = 0

    -- Reset exhaust time if a new projectile is fired from your position to your target's position
    if $lastprojectile.tox == $attacked.posx and $lastprojectile.toy == $attacked.posy and $lastprojectile.fromx == $posx and $lastprojectile.fromy == $posy then
    exhaustTime = $timems
    end

    if $timems >= exhaustTime then
    if not players.consider or paroundfloorignore(players.distance, players.floorDifference, unpack(players.safeList)) == 0 then
    -- Spells
    if maround(8) >= spellCountLow and spells[1] ~= nil then
    for i,_ in pairs(spells) do
    if cancastspell(spells[i].name) then
    for j,_ in pairs(shootDir) do
    if maroundspell(spells[i].name, shootDir[j], unpack(spells[i].monsters)) >= spells[i].amount then
    pausewalking(100)
    turn(shootDir[j])
    cast(spells[i].name)
    quitLoop = 1
    end
    end
    end
    end
    end

    -- Area Runes
    if maround(8) >= areaCountLow and areaRunes[1] ~= nil and quitLoop ~= 1 then
    for i,_ in pairs(areaRunes) do
    runeArea = getarearunetile(false, unpack(areaRunes[i].monsters))
    if runeArea.amount >= areaRunes[i].amount and itemcount(areaRunes[i].name) ~= 0 then
    countTries = 0
    pausewalking(500)
    useitemon(areaRunes[i].name, 0, runeArea.tile)
    wait(500)
    countTries = 1
    if $lastprojectile.time <= exhaustTime then
    countTries = 2
    end
    quitLoop = 1
    end
    end
    end
    end

    -- Targetrunes and strikes
    if $attacked.id ~=0 and quitLoop == 0 then
    if maround(7, unpack(targetRunes[1].monsters)) >= targetRunes[1].amount and itemcount(targetRunes[1].name) > 0 then
    useoncreature(targetRunes[1].name, $target)
    else
    holyMod = tonumber(creatureinfo($attacked.name).holymod)
    physicalMod = tonumber(creatureinfo($attacked.name).physicalmod)
    if holyMod > physicalMod and holyMod > 90 then
    if cancastspell('exori san') then
    cast('exori san')
    end
    elseif physicalMod > 90 then
    if strongStrike and cancastspell('exori gran con') then
    cast('exori gran con')
    strongExhaustTime = $timems + 5000
    elseif cancastspell('exori con') then
    cast('exori con')
    end
    end
    end
    end

    -- Add exhaust time, takes into account if you missfire an area rune
    exhaustTime = $timems + 1000 - countTries*500
    end


    PHP Code:
    Versionlog:
    1.0.0 First release
    1.0.1 
    Counts runes now paladin version added 
    Last edited by Heronas; 09-18-2015 at 01:46 PM.

  2. #2
    Free User ash katchup's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    144
    Reputation
    15
    Rep Power
    21
    Hello there,


    I haven't tested you script yet but have a question:

    Where are you using areaCountLow and spellCountLow variables?

    The following IF doesn't make sense:

    if spellCountLow > spells[i].amount then
    spellCountLow = spells[i].amount
    end


    Was it suppose to be a sort method (bubble?)? If so, are you sure it is working?

  3. #3
    Free User
    Join Date
    Dec 2014
    Posts
    66
    Reputation
    24
    Rep Power
    19
    Heya,

    You're right, I'm not using them at the moment, minor error on my side.

    They are supposed to be in line 93 and 109 respectively, areaCountLow in 109 at
    if maround(8) >= 2 and spells[1] ~= nil then
    instead of the value 2 and same for spellCountLow at line 93.

    The if statement is actually functioning, both variables start with a value 10 and if the next value in the table spells is lower, it gets replaced until it finds the lowest value.
    I do those two if statements to prevent unecessary for loops in the actual script, after the initial.

    I updated the code snippet in my first post, thanks.

  4. #4
    Free User ash katchup's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    144
    Reputation
    15
    Rep Power
    21
    You're welcome!

    I have another question: as i'm newbie at LUA, how does the following statement works?

    areaRunes[i].monsters = areaRunes[i].monsters or creatureNames

  5. #5
    Free User
    Join Date
    Dec 2014
    Posts
    66
    Reputation
    24
    Rep Power
    19
    Basically, if the value areaRunes[i].monsters returns a nil value, so that variable doesn't have a value, then it uses the other variable creatureNames.

    If I would do this:

    local value = nil
    local test = value or 2
    print(test)


    It would return 2. And if I would do this:

    local value = 3
    local test = value or 2
    print(test)


    It would return 3.
    Last edited by Heronas; 01-08-2015 at 07:40 AM.

  6. #6
    Free User ash katchup's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    144
    Reputation
    15
    Rep Power
    21
    I see.

    So, basically creatureNames is a list of creatures to use spells IF none other are set on targetRunes[i].monsters?

    Interesting!

  7. #7
    Free User
    Join Date
    Dec 2014
    Posts
    66
    Reputation
    24
    Rep Power
    19
    That is correct
    As for the strikes (e.g. exori vis etcetera), they are based on your target and do not use any list or table of creatures, just your current target.

  8. #8
    Free User
    Join Date
    Jun 2014
    Posts
    173
    Reputation
    33
    Rep Power
    20
    bro, tell me, i havent tested your persistent yet but, it tries to shoot first area spells, sd, thunderstorms or normal spells? ty

  9. #9
    Free User
    Join Date
    Dec 2014
    Posts
    66
    Reputation
    24
    Rep Power
    19
    Quote Originally Posted by felipepiva View Post
    bro, tell me, i havent tested your persistent yet but, it tries to shoot first area spells, sd, thunderstorms or normal spells? ty
    Sorry I was busy lately didn't have time to be on the forum.
    As of yet area spells, then area runes then target runes and strike spells last.

  10. #10
    Free User
    Join Date
    Aug 2014
    Location
    Rio de Janeiro - Brazil
    Posts
    356
    Reputation
    66
    Rep Power
    20
    @Heronas
    How can I adapt it to a paladin using only avalanche, exevo mas san and casting exori san or gran con/con when needed? I tried to modify it but the character doesn`t shoot avalanche because I`m exhausted. If i turn off spells in targeting he shoots well the avalanche but it doesn`t cast exori san. How to proceed?
    Thanks!

 

 

Posting Permissions

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