Kod:
dofile(getinstalldir().."FindItems.lua")
PlayerHotkey = "F2"
PlayerTypes = {400,401}
PlayerBasePos = {50,29}
StatusGumpPosition = {173,489}
BackPackPosition = {794,478}
PositionChanger = 63
MaxGumps = 5
BaseIngore = {UO.CharID}
--############################################
function GetHealthbar(c,d)
UO.StatBar(c)
wait(100)
UO.ContPosX = d[1]
UO.ContPosY = d[2]
end
--##########################################
function GetStatus()
while(UO.ContID~=UO.CharID)do
UO.Macro(8,2)
wait(200)
if(UO.ContID==UO.CharID)then
UO.ContPosX = StatusGumpPosition[1]
UO.ContPosY= StatusGumpPosition[2]
end
end
end
--####################################
function GetGumps(x,b)
cx = b[1]
cy = b[2]
IT = BaseIngore
Counter = 0
for i = 1 , 15 do
t = ScanItems(true,{Type=x,Dist=i},{ID=IT})
if(#t>0)then
for a = 1 , #t do
if(Counter<MaxGumps)then
GetHealthbar(t[a].ID,{cx,cy})
cy = UO.ContPosY + PositionChanger
Counter = Counter + 1
end
table.insert(IT,1,t[a].ID)
end
end
end
cx = b[1]
cy = b[2]
IT = BaseIngore
end
--############################################
function Main()
if(UO.Hits==0)and(CheckGumpbyName("status gump",UO.CharID)==false)then
GetStatus()
end
if(CheckGumpbyName("container gump",UO.BackpackID)==false)then
while(UO.ContID~=UO.BackpackID)do
UO.Macro(8,7)
wait(500)
end
UO.ContPosX = BackPackPosition[1]
UO.ContPosY = BackPackPosition[2]
end
if(UO.Hits>0)then
if(getkey(MonsterHotkey))then
GetGumps(MonsterTypes,MonsterBasePos)
end
if(getkey(PlayerHotkey))then
GetGumps(PlayerTypes,PlayerBasePos)
end
end
end
--###########################################
function CheckGumpbyName(a,b)
statusgump = false
ContIndex = true
for i = 0 , 999 do
if(ContIndex==true)then
local sName,nX,nY,nSX,nSY,nKind,nId,nType,nHP = UO.GetCont(i)
if(sName==a)and(statusgump==false)and(nId==n)then
statusgump = true
elseif(sName==nil)then
ContIndex=false
end
end
end
if(statusgump==true)then
return true
else
return false
end
end
--################################################
while(1==1)do
Main()
F2 ye bastığın zaman ekrandaki en yakın 5 kişinin status barını alt alta sıralıyor.