Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;====================================================
- ; Script Name: Callum's Item Deconstructor
- ; Author: Callum O'Lyre
- ; Purpose: Useful for deconstructing items back to hides, bones, ingots or bandages
- ; Warning: It does not discriminate, when using scissors to make clothing into bandages
- ; it doesn't hold back its wrath and will turn everything it can in the bag
- ; into bandages.
- ;====================================================
- Set %ContainerTypes BO_WN_UMF_CTD_DLN_CUD_UXM_CKF_JKF_TXM_ZTD_VMF_TMF_LKF_AUD_OKF_ZJF_BKF
- set %DeconstructionBag N/A
- GoSub ShowItemBreakdownermenu
- GoSub ButtonListener
- Sub SetDestructionBag
- DestructionBag:
- set #TARGCURS 1
- Event Sysmessage Target the bag with the items to be deconstructed.
- while #TARGCURS = 1
- wait 1
- finditem #LTARGETID G_2
- if #findtype in %ContainerTypes
- {
- set %DeconstructionBag #LTARGETID
- set #lobjectid #LTARGETID
- Event Macro 17 0
- }
- else
- {
- Event Sysmessage Silly Merchant, that is not a recognized container.
- goto DestructionBag
- }
- return
- Sub SmeltSomeItems
- finditem * 1 C_ , %1
- for #FINDINDEX 1 #FINDCNT
- {
- set #lobjectid %2
- event macro 17 0
- while #targcurs = 0
- wait 1
- set #ltargetid #FINDID
- event macro 22 0
- wait 2s
- }
- Event Sysmessage Bag Complete!
- return
- Sub ItemProps
- finditem #ltargetid
- event property #findid
- wait 5
- str pos #property $
- set %tmp #strres - 1
- str left #property %tmp
- set %name #strres
- if #findstack > 1
- {
- str len #findstack
- set %tmp #strres + 1
- str del %name 1 %tmp
- set %name #strres
- }
- return
- Sub showItemBreakdownermenu
- menu Clear
- menu Window Title Item Breakdowner
- menu Window Color Black
- menu Window Size 100 72
- menu Font Transparent #true
- menu Font Align Right
- menu Font Name MS Sans Serif
- menu Font Size 8
- menu Font Style
- menu Font Color WindowText
- menu Font Transparent #false
- menu Font Align Left
- menu Font BGColor Black
- menu Font Color Yellow
- menu Text BagName 24 6 Unset
- menu Combo Create ToolType 2 25 122
- menu Combo Add ToolType Scissors
- menu Combo Add ToolType Seam Rippers
- menu Combo Add ToolType Tongs
- menu Combo Select ToolType 1
- menu Font Size 10
- menu Button BeginDeconstruction 2 50 122 20 Deconstruct!
- menu Button BagSelection 2 2 20 20 _
- menu Font Size 8
- menu Show 10 55
- return
- Sub ButtonListener
- Reset:
- set #menubutton 0
- ListenToTheButtons:
- if #menubutton = BagSelection
- {
- GoSub SetDestructionBag
- GoSub ItemProps
- menu Set BagName %name
- Goto Reset
- }
- if #menubutton = BeginDeconstruction
- {
- menu Get ToolType
- set %ToolType #menures
- if %ToolType = 1
- {
- Set %Tool KAG
- }
- if %ToolType = 2
- {
- Set %Tool YLK
- }
- if %ToolType = 3
- {
- Set %Tool TBG
- }
- Finditem %Tool C_ , #BackpackID
- if #FINDID = X
- {
- set #sysmsgcol 1939
- Event Sysmessage Silly Merchant, You don't seem to have the proper tool in your main pack!
- set #sysmsgcol 0
- Goto Reset
- }
- Set %ToolID #FindID
- if %DeconstructionBag = N/A
- {
- set #sysmsgcol 1939
- Event Sysmessage Silly Merchant, You need to select a container to destroy items from!
- set #sysmsgcol 0
- Goto Reset
- }
- menu Delete BeginDeconstruction
- GoSub SmeltSomeItems %DeconstructionBag %ToolID
- menu Button BeginDeconstruction 2 50 122 20 Deconstruct!
- Goto Reset
- }
- if #menubutton = closed
- {
- halt
- }
- GoTo ListenToTheButtons
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement