XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 10 of 32

Thread: Anoyn's Scripts

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #14

    Join Date
    Feb 2014
    Posts
    24
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by anoyn View Post
    Spell Caster while Manually Playing
    This script will cast spells in order when you are attacking a creature.
    To be used if you are too lazy to cast spells yourself while manually playing.
    Can be enabled and disabled with a hotkey. (Default end)

    lua code:

    -- Automatic spell caster for manual targeting
    -- Version 1.0
    --[[ Made by
    ___ .__ __. ______ ____ ____ .__ __.
    / \ | \ | | / __ \ \ \ / / | \ | |
    / ^ \ | \| | | | | | \ \/ / | \| |
    / /_\ \ | . ` | | | | | \_ _/ | . ` |
    / _____ \ | |\ | | `--' | | | | |\ |
    /__/ \__\ |__| \__| \______/ |__| |__| \__|

    ]]
    --------------------------------------------
    --[[ ------------ CONFIG -------------- ]]--
    --------------------------------------------
    --Spells to cast in order from strongest to weakest
    strikeSpells = {
    "exori max frigo",
    "exori gran frigo",
    "exori frigo"
    }

    --Square range you can shoot your spells
    castRange = 3

    --will only cast if mana percent is this or above
    manaPercentToCast = 10

    --Whether you want automatic casts to be on when you start the script
    castingSpells = true

    enableHotkey = 35 -- 35 = END, 36 = HOME

    --------------------------------------------
    --[[ ----- Script -- No need to edit ---- ]]
    --------------------------------------------
    Module.New('saySpell', function(saySpell)
    if( castingSpells ) then
    local curTargetID = Self.TargetID()
    if( curTargetID ~= 0 ) then
    local enemyPos = Creature.New(curTargetID):Position()
    local manaPercent = math.floor(( Self.Mana() * 100 ) / Self.MaxMana())
    if( Self.DistanceFromPosition(enemyPos.x, enemyPos.y, enemyPos.z) <= castRange and
    Self.Position().z == enemyPos.z and manaPercent >= manaPercentToCast ) then
    for spellIndex = 1, #strikeSpells do
    if( Self.CanCastSpell(strikeSpells[spellIndex] ) ) then
    Self.Cast(strikeSpells[spellIndex] )
    break
    end
    end
    end
    end
    end
    end)

    if not Hotkeys.Register(enableHotkey) then
    print("Could not enable hotkey, check that enableHotkey (" .. enableHotkey .. ") is valid.")
    end

    function pressHandler(key, control, shift)
    if( castingSpells ) then
    print("Pausing Spell Caster")
    castingSpells = false
    else
    print("Starting Spell Caster")
    castingSpells = true
    end
    end
    Hotkeys.AddPressHandler(pressHandler)
    Just give s me an error when trying to use this script?

    07:30 XenoScript Error:
    Script: spells.lua
    Line #: 55
    Error: attempt to index global 'Hotkeys' (a nil value)
    This is an error with user-input and should not be reported as a bug with XenoBot.
    Last edited by Gluben; 03-25-2016 at 06:34 AM.

Posting Permissions

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