0% found this document useful (0 votes)
4 views2 pages

Fast Buy Vend

The document is a script for a vending system that interacts with a game, managing inventory and transactions. It includes functions to log messages, check inventory, and handle the main vending process based on specific conditions. The script continuously runs, waiting for a vending action to occur and processes it accordingly while logging relevant information.

Uploaded by

ajimlahtol
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)
4 views2 pages

Fast Buy Vend

The document is a script for a vending system that interacts with a game, managing inventory and transactions. It includes functions to log messages, check inventory, and handle the main vending process based on specific conditions. The script continuously runs, waiting for a vending action to occur and processes it accordingly while logging relevant information.

Uploaded by

ajimlahtol
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/ 2

delay = 200

-- Don't change anything!!


itemID = 0
selectedVend = false
posX = 0
posY = 0
count = 0
price = 0

function log(t)
LogToConsole("``[`6NOIR COMMUNITY MESSAGE``] `0"..t)
end

function inv()
for _, p in pairs(GetInventory()) do
if p.id == 7188 then return p.amount end
end
return 0
end

function main()
while true do
if selectedVend then
if inv() < 10 then
SendPacket(2, [[action|dialog_return
dialog_name|info_dialog
buttonClicked|convert_pl_to_bgl

]])
end
SendPacket(2, [[action|dialog_return
dialog_name|vending
tilex|]].. posX ..[[|
tiley|]].. posY ..[[|
verify|1|
buycount|]].. count ..[[|
expectprice|]].. price ..[[|
expectitem|]].. itemID ..[[|
]])
Sleep(50)
SendPacket(2, [[action|dialog_return
dialog_name|backpack_menu
itemid|]].. itemID)
Sleep(delay)
else
log("`2Done``/`4Stop")
return 0
end
end
end

AddHook(function(t,s)
if t == 2 and s:match("vending") and not s:match("verify") and selectedVend ==
false then
itemID = s:match("expectitem|(%d+)")
price = s:match("expectprice|(%d+)")
posX = s:match("tilex|(%d+)")
posY = s:match("tiley|(%d+)")
count = s:match("buycount|(%d+)")
log("`2Target Vend Details:\n``>> `0ItemID:`1 " .. itemID .. "\n``>> `0Pos X
Vend:`1 ".. posX .."\n``>> `0Pos Y Vend:`1 " .. posY .. "\n``>> `0Buy count:`1 " ..
count)
selectedVend = true
log("`2Starting main scrip in few sec...")
end
end,"OnSendPacket")

SendPacket(2, "action|input\n|text|`2Script by `6Kenweps")

while true do
if selectedVend then
main()
else
sleep(10000)
end
end

You might also like