Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ply = Entities.me
- local function regen(mode)
- if type(mode) == "table" then
- for k,v in ipairs(mode) do
- if regen(v) then
- return mode,v
- end
- end
- end
- if ply:InCombat() and mode != "POTION" then
- return false
- end
- if not mode or mode == "WAIT" then
- while ply:Health() > ply:MaxHealth() do
- sleep(5)
- if ply:InCombat() then
- return false
- end
- end
- return true
- elseif mode == "CLASS" then
- local class = ply:GetClass()
- ply:SetClass(class == "warrior" and "rougue" or "warrior")
- ply:SetClass(class)
- return true
- elseif mode == "POTION" then
- local item = findItem(ply.InventoryController, Items.HEALTH_POTION)
- if not item then return false end
- return ply:UseItem(item)
- end
- end
- local config_teleport = false
- local function moveTo(pos)
- if config_teleport then
- ply:SetPos(pos)
- else
- ply:MoveTo(pos)
- end
- end
- -- Keys to press
- local spells = {5,4,3,2}
- local function fight(ent)
- ply:SetTarget(ent)
- while ent and ent:IsValid() and ply:CanAttack(ent) do
- if (ply.position - ent.position).sqrMagnitude > combatRange^2 then
- moveTo(ent.position)
- end
- local gcd = ply:GetGlobalCD()
- if gcd > 0 then sleep(gcd) end
- local flag = false
- for i,v in ipairs(spells) do
- if ply:CanAttackWithSpell(ent,spell) then
- ply:CastSpell(v)
- flag = true
- end
- end
- if not flag then
- ply:AutoAttack(ent)
- end
- end
- end
- local function findNPCs(pred,comp)
- local ents = Entities.NPCMap
- local ent
- for k,v in pairs(ents) do
- if pred(v) then
- if comp then
- ent = ent and comp(ent,v) and ent or v
- else
- return v
- end
- end
- end
- return ent
- end
- ply:JoinWorld("slabs")
- --waypoints
- for i,v in ipairs{Vector(1.0,5.0,2.0),...} do
- moveTo(v)
- end
- while true do
- local ent = findNPC("South Warsworn")
- if ent then
- fight(ent)
- regen("CLASS")
- else
- sleep(1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement