Odp: Skrypt na ANTY RS
[MENTION=440378]askara76[/MENTION] to jest skrypt do elfbota. On potrzebuje do xenobota.
[lua]-- script by Rif
local players = {}
local hited = {}
function _getPlayers(range)
for _, c in Creature.iPlayers(range) do
name = c:Name()
return true
end
return false
end
function _insertPlayers()
for _, c in Creature.iPlayers(range) do
if not _tableContains(players, c:Name()) then
players[#players + 1] = c:Name()
print('Added to list '..c:Name())
end
end
end
function _tableContains(table, nick)
for i = 1, #table do
if table == nick then
setName = table
return true
end
end
return false
end
function _checkLifeStatus(hpperc)
if _tableContains(hited, setName) then
local player = Creature.New(setName)
local self = Creature.GetByID(Self.ID())
if player:isOnScreen() and player:HealthPercent() <= hpperc then
if self:Skull() == 3 then
print('I killed him omg, exiting..')
wait(2000)
os.exit()
end
end
end
end
BattleMessageProxy.OnReceive('server', function(proxy, text)
if _getPlayers(7) then
if _tableContains(players, name) then
dmg = text:match('%d')
if text:find(setName) and text:find('your attack.') then
if not _tableContains(hited, setName) then
hited[#hited + 1] = setName
print('You hit '.. setName ..' for '.. dmg ..'.')
else
if setName ~= nil then
print('You hit '.. setName ..' for '.. dmg ..'.')
end
end
end
end
end
end)
Module.New('Anti-Rs', function()
_insertPlayers()
_checkLifeStatus(0)
end)[/lua]