forked from ScriptB3ast/razor-enhanced
-
Notifications
You must be signed in to change notification settings - Fork 0
/
organizer_moveToBag_reagents.py
27 lines (21 loc) · 1.13 KB
/
organizer_moveToBag_reagents.py
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
from Scripts.utilities.items import FindItem, MoveItem
from Scripts.glossary.items.reagents import reagents
from Scripts import config
reagentsBagSharedValue = 'reagentsBag'
if not Misc.CheckSharedValue( reagentsBagSharedValue ):
reagentsBag = Target.PromptTarget( 'Select bag to move the reagents into' )
Misc.SetSharedValue( reagentsBagSharedValue, reagentsBag )
reagentsBag = Misc.ReadSharedValue( reagentsBagSharedValue )
if reagentsBag == None or Items.FindBySerial( reagentsBag ) == None:
Player.HeadMessage( 'Can\'t find reagents bag! Clearing stored bag, please run again' )
Misc.RemoveSharedValue( reagentsBagSharedValue )
Stop
reagentsBag = Items.FindBySerial( reagentsBag )
def MoveReagentsToBag():
for reagent in reagents:
reagentItemID = reagents[ reagent ].itemID
reagentStack = FindItem( reagentItemID, Player.Backpack, ignoreContainer = [ reagentsBag.Serial ] )
while reagentStack != None:
MoveItem( Items, Misc, reagentStack, reagentsBag )
reagentStack = FindItem( reagentItemID, Player.Backpack, ignoreContainer = [ reagentsBag.Serial ] )
MoveReagentsToBag()