PDA

View Full Version : slime trainer



holos
01-13-2016, 10:42 PM
so I try to skill a pally with slimes atm. But my problem is that most of the good slime training spawns are taken 24/7. So I am at thais trolls with a slime. But the spawn is not rly good for training so sometimes a rotworm takes a slime spot and the bot wont attack the rotworm to make place for the slime. I cant put the rotworm in targeting list because if I do so the bot would move out of my spot and also my slime trainer script dont work anymore. I use this script:

--Slime Trainer Settings--
local CreatureName = 'Slime' -- Name of creature you want to train on.

--Weapon Switcher Settings--
local TrainingWeaponID = 3291 -- ID of weapon you are training with. (Default: Knife)
local LowHealthWeaponID = 7418 -- ID of weapon you want to switch to when low on health. (Default: Bright Sword)

local SwitchOnLowHealth = true -- Set to false if you don't want to switch to alternate weapon on low health.
local SwitchLowHealth = math.floor(Self.MaxHealth() * 0.5) -- Your health at which you want to switch to alternate weapon. (Default: 50%)
local SwitchHighHealth = math.floor(Self.MaxHealth() * .75) -- Your health at which you want to switch back to training weapon. (Default: 75%)

--Slime Mother Killer Settings--
local KillOnLowHealth = true -- Set to false if you don't want to kill slime mother when low on health.
local KillLowHealth = math.floor(Self.MaxHealth() * .30) -- Your health at which you want to kill slime mother.

--Alerts--
local AlertOnWeaponSwitch = false -- Set to true if you want to be alerted when weapon is switched.
local AlertOnLowHealth = false -- Set to true if you want to be alerted when low on health.
local AlertOnKill = true -- Set to false if you don't want to be alerted when slime mother is killed.

--Only edit below if you want to.--
local KillingSlimeMother = false -- Do not change!

local SlimeTrainer = Module.New('Slime Trainer', function()
if (Self.TargetID() == 0) then
local creatures = Self.GetTargets(1)
for i = 1, #creatures do
if (creatures[i]:Name() == 'Slime' and creatures[i]:HealthPercent() >= 50) then
if (creatures[i]:Attack()) then break end
end
end
end
end)

local WeaponSwitcher = Module.New('Weapon Switcher', function()
if (SwitchOnLowHealth) then
if (Self.Health() <= SwitchLowHealth and Self.Weapon().id ~= LowHealthWeaponID) then
if (AlertOnLowHealth) then alert() end
if (MoveWeapon(LowHealthWeaponID) and AlertOnWeaponSwitch) then alert() end
elseif (Self.Health() >= SwitchHighHealth and Self.Weapon().id ~= TrainingWeaponID) then
if (MoveWeapon(TrainingWeaponID) and AlertOnWeaponSwitch) then alert() end
end
end
wait(1000, 2000)
end, false)

local SlimeMotherKiller = Module.New('Slime Mother Killer', function()
if (KillOnLowHealth) then
if (Self.Health() <= KillLowHealth) then KillSlimeMother() end
end
wait(1000, 2000)
end, false)

function MoveWeapon(ItemID)
local container = Container.GetFirst()
while (container:isOpen()) do
for spot = 0, container:ItemCapacity() do
if (container:GetItemData(spot).id == ItemID) then
return (container:MoveItemToEquipment(spot, 'weapon'))
end
end
container = container:GetNext()
end
return false
end

function KillSlimeMother()
if not (KillingSlimeMother) then
SlimeTrainer:Stop()
Self.StopAttack()
if (AlertOnLowHealth) then alert() end
local creatures = Self.GetTargets(1)
for i = 1, #creatures do
if (creatures[i]:Name() == 'Slime' and creatures[i]:HealthPercent() <= 50) then
if (creatures[i]:Attack()) then break end
end
end
elseif (KillingSlimeMother and Self.TargetID == 0) then
local creatures = Self.GetTargets(1)
for i = 1, #creatures do
if (creatures[i]:Name() == 'Slime' and creatures[i]:HealthPercent() <= 50) then
if (creatures[i]:Attack()) then break end
end
end
if (AlertOnKill) then alert() end
KillingSlimeMother = false
end
end

if (SwitchOnLowHealth) then WeaponSwitcher:Start() end
if (KillOnLowHealth) then SlimeMotherKiller:Start() end

local info = [['Knight Slime Trainer' loaded successfully.]]
print(info)
wait(500)

Ideas?:D

Whitehat
01-13-2016, 11:38 PM
Turn off your looter (if enabled)
Add rotworm with focus setting on high, and make sure that the atk type is set to nothing (normally it's follow), so it will attack the rotworm but won't move from it's place. Also, make sure the slime has a lower focus setting to make sure it kills the alter mobs first

holos
01-13-2016, 11:47 PM
ok thanks for the answer but if I enable targeting the script dont attack slime anymore

yacata45
02-05-2016, 02:43 PM
THANKS! Work perfect

mynigga
02-25-2016, 12:50 AM
I am having a similar problem! Did you ever get it figured out?