Log in

View Full Version : Foulwerp's Scripts



Foulwerp
11-20-2015, 02:23 PM
-- ╔═╗┬ ┬┌┬┐┌─┐ ╔═╗┬┌─┐┬ ┬┌─┐┬─┐
-- ╠═╣│ │ │ │ │ ╠╣ │└─┐├─┤├┤ ├┬┘
-- ╩ ╩└─┘ ┴ └─┘ ╚ ┴└─┘┴ ┴└─┘┴└─
-- ╔╗ ┬ ┬ ╔═╗┌─┐┬ ┬┬ ┬ ┬┌─┐┬─┐┌─┐
-- ╠╩╗└┬┘ ╠╣ │ ││ ││ │││├┤ ├┬┘├─┘
-- ╚═╝ ┴ ╚ └─┘└─┘┴─┘└┴┘└─┘┴└─┴

-- If Randomize is true will select random tiles to fish.
-- If Randomize is false will procedurally select tiles to fish.

Randomize = false

Module.New("Auto Fisher", function(Module)
if Self.ItemCount(3492) > 0 and Self.ItemCount(3483) > 0 and Self.Cap() > 5 then
p = Self.Position()
if Randomize then
x = math.random(p.x -7, p.x + 7)
y = math.random(p.y -5, p.y + 5)
while table.isStrIn({4597,4598,4599,4600,4601,4602}, Map.GetTopUseItem(x, y, p.z).id) and Map.IsTileOnScreen(x, y, p.z) do
Self.UseItemWithGround(3483, x, y, p.z)
wait(Self.Ping() + 1000)
end
else
for i = -7, 7 do
for j = -5, 5 do
x = p.x + i
y = p.y + j
while table.isStrIn({4597,4598,4599,4600,4601,4602}, Map.GetTopUseItem(x, y, p.z).id) and Map.IsTileOnScreen(x, y, p.z) do
Self.UseItemWithGround(3483, x, y, p.z)
wait(Self.Ping() + 1000)
end
end
end
end
end
Module:Delay(1000)
end)
-- ╔═╗┬ ┬┌┬┐┌─┐ ╔╦╗┬─┐┌─┐┬┌┐┌┌─┐┬─┐
-- ╚═╗│ ││││├┤ ║ ├┬┘├─┤││││├┤ ├┬┘
-- ╚═╝┴─┘┴┴ ┴└─┘ ╩ ┴└─┴ ┴┴┘└┘└─┘┴└─
-- ╔╗ ┬ ┬ ╔═╗┌─┐┬ ┬┬ ┬ ┬┌─┐┬─┐┌─┐
-- ╠╩╗└┬┘ ╠╣ │ ││ ││ │││├┤ ├┬┘├─┘
-- ╚═╝ ┴ ╚ └─┘└─┘┴─┘└┴┘└─┘┴└─┴

-- Attacks Mother Slime till under a certain HP, then continues to attack summoned ones
-- Set MotherHP to the health percent you want to stop attacking the Mother Slime

MotherHP = 50

Module.New("Slime Trainer", function(Module)
if Self.TargetID() == 0 then
local Slimes = Self.GetTargets(1)
for i = 1, #Slimes do
if Slimes[i]:Name() == 'Slime' then
if (Slimes[i]:isMother() and Slimes[i]:HealthPercent() > MotherHP) or not Slimes[i]:isMother() then
Slimes[i]:Attack()
break
end
end
end
end
local Slime = Creature.New(Self.TargetID())
if Slime:isMother() and Slime:HealthPercent() <= MotherHP then
Self.StopAttack()
end
Module:Delay(2000)
end)

-- ╦ ╦┌─┐┌┬┐┌─┐┬─┐ ╔═╗┬ ┌─┐┌┬┐┌─┐┌┐┌┌┬┐┌─┐┬ ╔═╗┬┌─┐┬ ┬┌─┐┬─┐
-- ║║║├─┤ │ ├┤ ├┬┘ ║╣ │ ├┤ │││├┤ │││ │ ├─┤│ ╠╣ │└─┐├─┤├┤ ├┬┘
-- ╚╩╝┴ ┴ ┴ └─┘┴└─ ╚═╝┴─┘└─┘┴ ┴└─┘┘└┘ ┴ ┴ ┴┴─┘ ╚ ┴└─┘┴ ┴└─┘┴└─
-- ╔╗ ┬ ┬ ╔═╗┌─┐┬ ┬┬ ┬ ┬┌─┐┬─┐┌─┐
-- ╠╩╗└┬┘ ╠╣ │ ││ ││ │││├┤ ├┬┘├─┘
-- ╚═╝ ┴ ╚ └─┘└─┘┴─┘└┴┘└─┘┴└─┴

-- If Wait is true script will wait on unfishable corpses.
-- If Wait is false script will ignore any unfishable corpses,
-- but will fish them if they become fishable.

Wait = true

Module.New("Water Elemental Fisher", function()
Count = 0
for i = -7, 7 do
for j = -5, 5 do
p = Self.Position()
x = p.x + i
y = p.y + j
z = p.z
if Map.IsTileWalkable(x, y, z) then
if Wait and Map.GetTopUseItem(x, y, z).id == 4037 then
if Walker.IsEnabled() then
Walker.Stop()
end
Count = Count + 1
elseif Map.GetTopUseItem(x, y, z).id == 9582 then
Self.UseItemWithGround(3483, x, y, z)
wait(500 + Self.Ping())
end
end
end
end
if not Walker.IsEnabled() and Count == 0 then
Walker.Start()
end
end)

Rif
11-21-2015, 06:16 PM
-- Based off DarkstaR's 'Players Above', but shows all floors above and below. Shows how many floors above or below the player is.

local TextDisplayList = {HUD.CreateTextDisplay(25, 5, "Players Above & Below:", 255, 120, 120)}

Module.New("Track Players", function(Module)
local players = {}

for index = CREATURES_LOW, CREATURES_HIGH do
local creature = Creature.GetFromIndex(index)
if (creature:isValid() and creature:isPlayer()) then
local locz = Self.Position().z - creature:Position().z
local locy = math.abs(Self.Position().y - creature:Position().y)
local locx = math.abs(Self.Position().x - creature:Position().x)
if (locx <= 7 and locy <= 5 and locz ~= 0) then
local z = "" .. locz
if locz > 0 then
z = "+" .. z
end
players[#players+1] = ("[" .. z .. "]" .. creature:Name())
end
end
end

while (#TextDisplayList <= #players) do
TextDisplayList[#TextDisplayList+1] = HUD.CreateTextDisplay(25, 5 + (12 * (#TextDisplayList)), "", 255, 120, 120)
end

for i = 1, #TextDisplayList-1 do
if (i <= #players) then
TextDisplayList[i+1]:SetText(players[i])
else
TextDisplayList[i+1]:SetText("")
end
end
Module:Delay(500)
end)

This script will works fatally until DarkStar change CREATURES_LOW, CREATURES_HIGH to detecting creature._index below you character while you stay on Tibia 7 floor

Syntax
11-21-2015, 11:31 PM
Thanks for contributing Foulwerp

sholh
12-20-2015, 05:50 PM
-- ╔═╗┬ ┬┌┬┐┌─┐ ╔═╗┬┌─┐┬ ┬┌─┐┬─┐
-- ╠═╣│ │ │ │ │ ╠╣ │└─┐├─┤├┤ ├┬┘
-- ╩ ╩└─┘ ┴ └─┘ ╚ ┴└─┘┴ ┴└─┘┴└─
-- ╔╗ ┬ ┬ ╔═╗┌─┐┬ ┬┬ ┬ ┬┌─┐┬─┐┌─┐
-- ╠╩╗└┬┘ ╠╣ │ ││ ││ │││├┤ ├┬┘├─┘
-- ╚═╝ ┴ ╚ └─┘└─┘┴─┘└┴┘└─┘┴└─┴

-- If Randomize is true will select random tiles to fish.
-- If Randomize is false will procedurally select tiles to fish.

Randomize = false

Module.New("Auto Fisher", function(Module)
if Self.ItemCount(3492) > 0 and Self.ItemCount(3483) > 0 and Self.Cap() > 5 then
p = Self.Position()
if Randomize then
x = math.random(p.x -7, p.x + 7)
y = math.random(p.y -5, p.y + 5)
while table.isStrIn({4597,4598,4599,4600,4601,4602}, Map.GetTopUseItem(x, y, p.z).id) and Map.IsTileOnScreen(x, y, p.z) do
Self.UseItemWithGround(3483, x, y, p.z)
wait(Self.Ping() + 1000)
end
else
for i = -7, 7 do
for j = -5, 5 do
x = p.x + i
y = p.y + j
while table.isStrIn({4597,4598,4599,4600,4601,4602}, Map.GetTopUseItem(x, y, p.z).id) and Map.IsTileOnScreen(x, y, p.z) do
Self.UseItemWithGround(3483, x, y, p.z)
wait(Self.Ping() + 1000)
end
end
end
end
end
Module:Delay(1000)
end)
-- ╔═╗┬ ┬┌┬┐┌─┐ ╔╦╗┬─┐┌─┐┬┌┐┌┌─┐┬─┐
-- ╚═╗│ ││││├┤ ║ ├┬┘├─┤││││├┤ ├┬┘
-- ╚═╝┴─┘┴┴ ┴└─┘ ╩ ┴└─┴ ┴┴┘└┘└─┘┴└─
-- ╔╗ ┬ ┬ ╔═╗┌─┐┬ ┬┬ ┬ ┬┌─┐┬─┐┌─┐
-- ╠╩╗└┬┘ ╠╣ │ ││ ││ │││├┤ ├┬┘├─┘
-- ╚═╝ ┴ ╚ └─┘└─┘┴─┘└┴┘└─┘┴└─┴

-- Attacks Mother Slime till under a certain HP, then continues to attack summoned ones
-- Set MotherHP to the health percent you want to stop attacking the Mother Slime

MotherHP = 50

Module.New("Slime Trainer", function(Module)
if Self.TargetID() == 0 then
local Slimes = Self.GetTargets(1)
for i = 1, #Slimes do
if Slimes[i]:Name() == 'Slime' then
if (Slimes[i]:isMother() and Slimes[i]:HealthPercent() > MotherHP) or not Slimes[i]:isMother() then
Slimes[i]:Attack()
break
end
end
end
end
local Slime = Creature.New(Self.TargetID())
if Slime:isMother() and Slime:HealthPercent() <= MotherHP then
Self.StopAttack()
end
Module:Delay(2000)
end)

-- ╦ ╦┌─┐┌┬┐┌─┐┬─┐ ╔═╗┬ ┌─┐┌┬┐┌─┐┌┐┌┌┬┐┌─┐┬ ╔═╗┬┌─┐┬ ┬┌─┐┬─┐
-- ║║║├─┤ │ ├┤ ├┬┘ ║╣ │ ├┤ │││├┤ │││ │ ├─┤│ ╠╣ │└─┐├─┤├┤ ├┬┘
-- ╚╩╝┴ ┴ ┴ └─┘┴└─ ╚═╝┴─┘└─┘┴ ┴└─┘┘└┘ ┴ ┴ ┴┴─┘ ╚ ┴└─┘┴ ┴└─┘┴└─
-- ╔╗ ┬ ┬ ╔═╗┌─┐┬ ┬┬ ┬ ┬┌─┐┬─┐┌─┐
-- ╠╩╗└┬┘ ╠╣ │ ││ ││ │││├┤ ├┬┘├─┘
-- ╚═╝ ┴ ╚ └─┘└─┘┴─┘└┴┘└─┘┴└─┴

-- If Wait is true script will wait on unfishable corpses.
-- If Wait is false script will ignore any unfishable corpses,
-- but will fish them if they become fishable.

Wait = true

Module.New("Water Elemental Fisher", function()
Count = 0
for i = -7, 7 do
for j = -5, 5 do
p = Self.Position()
x = p.x + i
y = p.y + j
z = p.z
if Map.IsTileWalkable(x, y, z) then
if Wait and Map.GetTopUseItem(x, y, z).id == 4037 then
if Walker.IsEnabled() then
Walker.Stop()
end
Count = Count + 1
elseif Map.GetTopUseItem(x, y, z).id == 9582 then
Self.UseItemWithGround(3483, x, y, z)
wait(500 + Self.Ping())
end
end
end
end
if not Walker.IsEnabled() and Count == 0 then
Walker.Start()
end
end)


slim script doesn't work bro i attacked slime mother under 50% hp and the scribt still attack it

mendill200
05-11-2016, 07:17 AM
Hello,

The slime trainer isnt working.Its keep saying there is something wrong.Unexpected symbol near I that what it say's
Anyone got a clue how to fix this ?

Thanks,
Mendill

Mizgamus
05-14-2017, 09:20 AM
This script for train on slime dont working who can fix this ;(

Mizgamus
05-24-2017, 11:35 AM
refresh