Advertisement
Oldaccountblocked

autosorter v2

Jun 13th, 2024
116
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | Gaming | 0 0
  1. Scriptname AutosorterPelt extends ObjectReference
  2.  
  3. FormList Property AutoSorterPeltList Auto
  4. ObjectReference Property AutosorterPeltChest Auto
  5.  
  6. Event OnActivate(ObjectReference akActionref)
  7. PlayGamebryoAnimation("open")
  8. PlayAnimation("open")
  9. MoveListItemsToChest(akActionref)
  10. EndEvent
  11.  
  12. Function MoveListItemsToChest(ObjectReference akActionRef)
  13.  
  14. Actor Player = Game.GetPlayer()
  15. Int FormToFind = 0
  16. Int MaxSize = AutoSorterPeltList.GetSize()
  17. Int ItemToMoveCount = Player.GetItemCount(AutoSorterPeltList.GetAt(FormToFind))
  18. Form ItemToMove = AutoSorterPeltList.GetAt(FormToFind)
  19.  
  20. While FormToFind<= MaxSize
  21. If ItemToMoveCount >= 1
  22. AutosorterPeltChest.Additem(ItemToMove, ItemToMoveCount)
  23. Player.RemoveItem(ItemToMove, ItemToMoveCount)
  24. Debug.Notification("Removed "+ItemToMoveCount+ItemToMove+" from the player")
  25. FormToFind + 1
  26. ElseIf ItemToMoveCount == 0
  27. FormToFind + 1
  28. Debug.Notification("No pelt was found")
  29. EndIf
  30. EndWhile
  31.  
  32. EndFunction
Advertisement
Comments
  • BunnyPriestess
    312 days
    # text 0.97 KB | 0 0
    1. Scriptname AutosorterPelt extends ObjectReference
    2.  
    3. FormList Property AutoSorterPeltList Auto
    4. ObjectReference Property AutosorterPeltChest Auto
    5.  
    6. Event OnActivate(ObjectReference akActionref)
    7. PlayGamebryoAnimation("open")
    8. PlayAnimation("open")
    9. MoveListItemsToChest(akActionref)
    10. EndEvent
    11.  
    12. Function MoveListItemsToChest(ObjectReference akActionRef)
    13.  
    14. Actor Player = Game.GetPlayer()
    15. Int FormToFind = 0
    16. Int MaxSize = AutoSorterPeltList.GetSize()
    17. Int ItemToMoveCount = Player.GetItemCount(AutoSorterPeltList.GetAt(FormToFind))
    18. Form ItemToMove = AutoSorterPeltList.GetAt(FormToFind)
    19.  
    20. While FormToFind <= MaxSize
    21. If ItemToMoveCount >= 1
    22. AutosorterPeltChest.Additem(ItemToMove, ItemToMoveCount)
    23. Player.RemoveItem(ItemToMove, ItemToMoveCount)
    24. Debug.Notification("Removed "+ItemToMoveCount+ItemToMove+" from the player")
    25. FormToFind += 1
    26. ElseIf ItemToMoveCount == 0
    27. FormToFind += 1
    28. Debug.Notification("No pelt was found")
    29. EndIf
    30. EndWhile
    31.  
    32. EndFunction
Add Comment
Please, Sign In to add comment
Advertisement