--sc by user
--converted to GL + modified by iniey
function Drop(id, count)
SendPacket(2, "action|drop\n|itemID|"..id)
Sleep(130)
SendPacket(2, "action|dialog_return\ndialog_name|drop_item\nitemID|"..id.."|\
ncount|"..count)
Sleep(130)
end
function Log(type, text)
if type == 1 then
LogToConsole("`0[`2User404#5457`0]+`o[`ciniey`o] `5"..text)
elseif type == 2 then
SendVariant({v1 = "OnTextOverlay",
v2 = "`0[`2User404#5457`0]+`o[`ciniey`o] `5"..text
})
end
end
AddHook(function(var)
if var.v1:find("OnConsoleMessage") then
Log(1, var.v2)
return true
end
if var.v1:find("OnDialogRequest") and var.v2:find("drop_item") then
Log(2, "`4Blocking dialog drop.")
return true
end
return false
end, "OnVariant")
AddHook(function(type, pkt)
if pkt:find("text") then
if pkt:find("/(%w+) (%d+)") then
Type,Amount = pkt:match("/(%w+) (%d+)")
if Type == "cd" then
id = 242
elseif Type == "dd" then
id = 1796
elseif Type == "bd" then
id = 7188
end
Log(1,"Dropped "..Amount..", id = "..id..".")
Drop(id, Amount)
id = nil
Amount = nil
return true
end
end
return false
end,"OnSendPacket")