Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Backpack = "red backpack"
- HUD.New(30, 30, "Loot taker by Shanner", 0, 255, 0)
- HUD.New(30, 45, "1. Naloz przygotowany BP na siebie", 0, 255, 0)
- HUD.New(30, 60, "2. Zamknij wszystkie bp", 0, 255, 0)
- HUD.New(30, 75, "3. Otworz depo z ktorego bierzesz", 0, 255, 0)
- HUD.New(30, 90, "4. Otworz backpack", 0, 255, 0)
- HUD.New(30, 105, "5. loottaker:start", 0, 255, 0)
- HUD.New(30, 120, "6. loottaker:stop", 0, 255, 0)
- is_started = 0
- function messageCallback(proxy, mtype, speaker, level, text)
- if speaker == Self.Name() then
- print(text)
- if text == "loottaker:start" then
- is_started = 1
- elseif text == "loottaker:stop" then
- is_started = 0
- end
- end
- end
- LocalSpeechProxy.OnReceive("OnOffProxy", messageCallback)
- Module.New('takeLootFromDepo', function(m)
- if is_started == 1 then
- local depo = Container.GetFirst()
- local bp = Container.GetLast()
- if depo:ItemCount() > 0 and Self.Cap() > Item.GetWeight(depo.GetItemData(0).id) * depo.GetItemData(0).count then
- if bp:ItemCount() == 20 then
- bp:OpenChildren({Backpack, false})
- bp:Close()
- bp = Container.GetLast()
- end
- depo:MoveItemToContainer(0, bp:Index(), 19)
- end
- end
- m:Delay(100)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement