Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local trash = {3031, 3492} -- You can add more items if you want
- dofile("Forgee.lua")
- function onSpeak(c, msg)
- c:SendYellowMessage(Self.Name(), msg)
- if msg:lower() == "help" then
- c:SendOrangeMessage("AntiPush", "Type 'start' to activate or 'stop' to deactivate.\nTip: bind those words to an autosend hotkey.")
- elseif msg:lower() == "start" then
- active = true
- c:SendOrangeMessage("AntiPush", "AntiPush has been activated!")
- elseif msg:lower() == "stop" then
- active = false
- c:SendOrangeMessage("AntiPush", "AntiPush has been stopped!")
- end
- end
- function onClose(c, msg) end
- local c = Channel.Open("AntiPush", onSpeak, onClose)
- function antiPush(top, ...)
- local trash = {...}
- local top = top or 0
- local item = Map.GetTopMoveItem(Self.Position().x, Self.Position().y, Self.Position().z)
- if item.id ~= top then
- if table.contains(trash, item.id) then
- for i = 1, #trash do
- if item.id ~= trash[i] then
- spot, container = getSpotByID(trash[i])
- if spot then
- container:MoveItemToGround(spot, Self.Position().x, Self.Position().y, Self.Position().z, 2)
- return trash[i]
- end
- end
- end
- else
- local count = 0
- for i = 1, #trash do
- spot, container = getSpotByID(trash[i])
- if spot then
- container:MoveItemToGround(spot, Self.Position().x, Self.Position().y, Self.Position().z, 2)
- count = count + 1
- top = trash[i]
- if count >= 2 then
- break
- end
- end
- wait(300, 500)
- end
- return top
- end
- else
- return top
- end
- end
- registerEventListener(TIMER_TICK, "onTimerTick")
- function onTimerTick()
- if active then
- top = antiPush(top, unpack(trash))
- end
- wait(100, 300)
- end
Advertisement
Add Comment
Please, Sign In to add comment