Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.72 KB | None | 0 0
  1. function btnPack()
  2. if isPVw() then do return end end
  3. if not Global.getVar("oWisOn") or not aBase then do return end end
  4. if ss != "" or prs != "" then broadcastToAll("The Current Zone is Busy...", {0.943, 0.745, 0.14}) do return end end
  5. if not findBags() then do return end end if tBag then dumpSet() end local l = vBase.getLuaScript()
  6. n = 1 local p, f, u, r, m local s = "" aoj = getAllObjects() g = aoj[1] local a = string.char(10) local k = string.char(44)
  7. while g do
  8. p = g.getPosition() f = g.getGUID() u = 0 if g.getLock() then u = 1 end
  9. if math.abs(p[3]) < 26 and math.abs(p[1]) < 44 and math.abs(p[2]) < 26 then
  10. if string.find("059864@3761d8@ff9bc3@2deca3@649822", f) then m = 1 end
  11. if not string.find("FogOfWarTrigger@ScriptingTrigger@3DText", g.name) and not string.find(l, f) then
  12. ss = ss..g.guid r = g.getRotation() s = s.."--"..f..k..p[1]..k..p[2]..k..p[3]..k..r[1]..k..r[2]..k..r[3]..k..u..a
  13. end
  14. end n = n+1 g = aoj[n]
  15. end z2 = 1
  16. if ss != "" then
  17. if m then ss = "" broadcastToAll("Pack Canceled. Remove SkyBox Tool.", {0.943, 0.745, 0.14})
  18. else aBase.setLuaScript(s) broadcastToAll("Packing Zone...", {0.943, 0.745, 0.14})
  19. local t = {} t.type = "Bag" t.position = {0, 4, 0} t.callback = "doPack" t.callback_owner = self spawnObject(t)
  20. end
  21. else
  22. broadcastToAll("(to empty a zone, use Delete)", {0.7, 0.7, 0.7})
  23. broadcastToAll("No Objects Found in Zone.", {0.943, 0.745, 0.14})
  24. end
  25. end
  26. function doPack(a)
  27. local i for i = 0, string.len(ss)/6-1 do a.putObject(getObjectFromGUID(string.sub(ss, i*6+1, i*6+6))) end
  28. aBase.setDescription(a.guid) iBag = a cbOn({"cbPack"})
  29. end
  30. function cbPack() if cbc < 12 then do return end end
  31. if ss == "" then cbOff() cbOn({"endPack"}) end local i, g
  32. for i = 0, string.len(ss)/6-1 do g = string.sub(ss, i*6+1, i*6+6)
  33. if not getObjectFromGUID(g) then ss = string.sub(ss, 1, i*6)..string.sub(ss, i*6+7) end
  34. end if ss == "" then do return end end
  35. cbc = 0 z2 = z2 + 1 if z2/10 == math.modf(z2/10) then broadcastToAll("Pass"..(z2/10).."...", {0.943, 0.745, 0.14}) end
  36. if z2 > 68 then broadcastToAll("Manual Inspection Required.", {0.943, 0.745, 0.14})
  37. for i = 0, string.len(ss)/6-1 do g = string.sub(ss, i*6+1, i*6+6)
  38. getObjectFromGUID(g).resting = true getObjectFromGUID(g).setPosition({0, 3, 0})
  39. end ss = ""
  40. end
  41. end
  42. function endPack() if cbc < 45 then do return end end cbOff()
  43. if iBag then mBag.putObject(iBag) iBag = nil end
  44. jotBase() stowBase() noBase() setBtn() setTxt() broadcastToAll("Packing Complete.", {0.943, 0.745, 0.14})
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement