0% found this document useful (0 votes)
63 views1 page

Simple Proxy GL - Lua

The document describes Lua functions for dropping items and logging messages in the game. It defines Drop and Log functions. It also adds hooks to block item drop dialogs and log console and chat messages when items are dropped.

Uploaded by

Galang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views1 page

Simple Proxy GL - Lua

The document describes Lua functions for dropping items and logging messages in the game. It defines Drop and Log functions. It also adds hooks to block item drop dialogs and log console and chat messages when items are dropped.

Uploaded by

Galang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

--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")

You might also like