PRINT CONDITIONS -- will display a list of all conditions & their values
PRINT VALUES -- will display a list of all values & their values
1
2
3
--[[
*********************************************************************************
INVENTORY
*********************************************************************************]]--
local inventory_States = {
[1] = function () end,
[2] = function ()
local inventory = getObject("Interfaces[inventory]")
local p = inventory:getPoint(VInterfaceOffset)
if p.y<=640 then
getObject("Values[inventory_state]"):setValue(VValueInt, 1)
else
p.y= p.y-2
inventory:setValue(VInterfaceOffset,p)
end
end,
[3] = function ()
local inventory = getObject("Interfaces[inventory]")
local p = inventory:getPoint(VInterfaceOffset)
if p.y>=696 then
getObject("Values[inventory_state]"):setValue(VValueInt, 1)
else
p.y= p.y+2
inventory:setValue(VInterfaceOffset,p)
end
end
}
function updateInventory()
local inventory_state = getObject("Values[inventory_state]"):getInt(VValueInt)
inventory_States[inventory_state]()
end
--[[
*********************************************************************************
HANDLERS
*********************************************************************************]]--
function updateInterfaces()
updateInventory()
end
function onMainLoop()
updateInterfaces() -- updates all Interface Positions
end
registerEventHandler("mainLoop", "onMainLoop")
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