-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgapple.lua
More file actions
90 lines (84 loc) · 3.82 KB
/
Copy pathgapple.lua
File metadata and controls
90 lines (84 loc) · 3.82 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
local find = {
on_tick = function(event)
local found_items = {}
local slotz = modules:get_setting("AutoGapple", "slotz")
for i = 0, 35 do
local item = inventory:get_item(i)
if item and string.find(item.name, "appleGold") then
-- Do something if item name includes "appleGold"
table.insert(found_items, {slot = i, size = item.stack_size})
end
end
if #found_items > 0 then
-- Find the item with the highest stack size
local max_stack_item = found_items[1]
for i = 2, #found_items do
if found_items[i].size > max_stack_item.size then -- bug impl https://discord.com/channels/968569296412356629/1056187788208377948/1095169210012938270
max_stack_item = found_items[i]
end
end
if max_stack_item.slot ~= slotz then
client:print(max_stack_item.slot .. " " .. slotz)
if max_stack_item.slot <= 8 then
-- client:print("Debug Hotbar")
-- inventory:window_click(1, max_stack_item.slot, 0, 1)
-- client:print("Debug Hotbar1 ".. max_stack_item.slot)
-- inventory:window_click(1, max_stack_item.slot, 0, 1)
-- client:print("Debug Hotbar2 ")
-- Do something if the item is in the hotbar
else
client:print("Debug item ")
inventory:swap(max_stack_item.slot, slotz)
modules:toggle("AutoGapple")
-- Print the slot number and stack size of the item with the highest stack size
-- client:print("Found appleGold at slot " .. max_stack_item.slot .. " with stack size " .. max_stack_item.size)
end
modules:toggle("AutoGapple")
end
end
end
}
modules:register("AutoGapple", "AutoGapple", find)
modules:create_integer_setting("AutoGapple", "slotz", "Slot", 6, 0, 8, 1)
-- local find = {
-- on_tick = function(event)
-- local found_items = {}
-- local slotz = modules:get_setting("AutoGapple", "slotz")
-- for i = 0, 35 do
-- local item = inventory:get_item(i)
-- if item and string.find(item.name, "appleGold") then
-- -- Do something if item name includes "appleGold"
-- table.insert(found_items, {slot = i, size = item.stack_size})
-- end
-- end
--
-- if #found_items > 0 then
-- -- Find the item with the highest stack size
-- local max_stack_item = found_items[1]
-- for i = 2, #found_items do
-- if found_items[i].size > max_stack_item.size then -- bug impl https://discord.com/channels/968569296412356629/1056187788208377948/1095169210012938270
-- max_stack_item = found_items[i]
-- window_click(1, 1, 1, 1)
-- window_click(1, 2, 1, 1)
-- end
-- end
-- -- client:print(max_stack_item.slot .. " " .. slotz)
-- if max_stack_item.slot <= 8 then
--
--
-- end
--
-- else
-- inventory:swap(max_stack_item.slot, slotz)
-- modules:toggle("AutoGapple")
--
-- -- Print the slot number and stack size of the item with the highest stack size
-- -- client:print("Found appleGold at slot " .. max_stack_item.slot .. " with stack size " .. max_stack_item.size)
-- else
-- modules:toggle("AutoGapple")
-- end
-- end
-- }
--
-- modules:register("AutoGapple", "AutoGapple", find)
-- modules:create_integer_setting("AutoGapple", "slotz", "Slot", 6, 0, 8, 1)