You are on page 1of 2

id = 0

data = {}
amount = 0
function clave(a)
if a[0]:find("OnDialogRequest") then
if a[1]:find("With this device") then
data = {}
if a[1]:find("Autoclave") then
tools = {
-- 1270, --Stitches
-- 1260, --Scalpel
-- 1266, --Antibiotic
-- 1262, --Anesthetic
1264, --Antiseptic
1258, --Sponge
4318, --Lab Kit
4308, --Pins
1268, --Spint
4314, --Clamp
4312, --Defibilator
4316, --Ultrasound
4310, --Transfusion
}
paket = "autoclave"
elseif a[1]:find("Nanoforge") then
tools = {
6520,-- AI Brain
6538,--Cyborg Diploma
6522,--Galactic Bolt
6528,-- Giga Blaster
--6540,--Torpedo
6518,--Hyper Shield
6530,-- Quadrascanner
6524,--Med Kit
6536,--Supplier
6534,--Stellar Document
--6532,--Tactical Drone
--6526,--Teleporter
}
paket = "star tool nanoforge"
end
for b, c in ipairs(tools) do
for d, e in pairs(getInventory()) do
if e.id == c then
amount = e.amount
end
end
data[#data + 1] = {c, amount}
end
for f = 1, #data - 1 do
if tonumber(data[1][2]) < tonumber(data[f + 1][2]) then
data[1], data[f + 1] = data[f + 1], data[1]
end
end
id = data[1][1]
x = a[1]:match("|tilex|(%d+)")
y = a[1]:match("|tiley|(%d+)")
sendPacket(
2,
"action|dialog_return\ndialog_name|" ..
paket .. "\ntilex|" .. x .. "|\ntiley|" .. y .. "|\nitemID|" ..
id .. "|\nbuttonClicked|tool" .. id
)
elseif a[1]:find("Are you sure you want") then
sendPacket(
2,
"action|dialog_return\ndialog_name|" ..
paket .. "\ntilex|" .. x .. "|\ntiley|" .. y .. "|\nitemID|" ..
id .. "|\nbuttonClicked|verify"
)
end
return true
end
return false
end
AddHook("OnVarlist", "AutoClaves", clave)

You might also like