Dropar Item

Descrição

Dropar item na posição do mouse.

Autor: Lee

                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
hotkey("f1", "Drop item to Mouse", function() local tile = getTileUnderCursor() if tile then local pos = tile:getPosition() local itemToMouse = 3031 for _, container in pairs(g_game.getContainers()) do for __, item in ipairs(container:getItems()) do if item:getId() == itemToMouse then return g_game.move(item, pos, 1) end end end end end) hotkey("1", "Drop item to Mouse", function() local neighbours = { { x = 0, y = -1, z = 0 }, { x = -1, y = -1, z = 0 }, { x = -1, y = 0, z = 0 }, { x = -1, y = 1, z = 0 }, { x = 0, y = 1, z = 0 }, { x = 1, y = 1, z = 0 }, { x = 1, y = 0, z = 0 }, { x = 1, y = -1, z = 0 } } local tile = getTileUnderCursor() if tile then local pos = tile:getPosition() local itemToMouse = 3031 for _, container in pairs(g_game.getContainers()) do for __, item in ipairs(container:getItems()) do if item:getId() == itemToMouse then for k, v in pairs(neighbours) do local posN = { x = pos.x + v.x, y = pos.y + v.y, z = pos.z + v.z } g_game.move(item, posN, 1) end return end end end end end)