Advertisement
DavidJSGardner

Callum's Box Cleaning Machine 1.1

Sep 8th, 2012
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.40 KB | None | 0 0
  1. ;==================================
  2. ; Script Name: Callum's Magically Wonderful Container Emptying Machine
  3. ; Author: Callum O'Lyre
  4. ; Version: 1.0
  5. ; Shard: Pangaea
  6. ; Public Release: 08.07.2012
  7. ; Purpose: Moves items between two containers, written in response to an idea posted
  8. ; in the ideas section regarding the inability to unsecure containers which contain items.
  9. ; ToDo: Probably missing some container types so add missing container types
  10. ;==================================
  11.  
  12. set %Box1 N/A
  13. set %Box2 N/A
  14. menu Clear
  15. menu Window Title Callum's Box Cleaner
  16. menu Window Color Black
  17. menu Window Size 215 103
  18. menu Font Transparent #true
  19. menu Font Align Right
  20. menu Font Name MS Sans Serif
  21. menu Font Size 8
  22. menu Font Style
  23. menu Font Color WindowText
  24. menu Font BGColor Yellow
  25. menu Button Box1 4 24 19 20 C1
  26. menu Font BGColor Yellow
  27. menu Button Box2 4 52 19 20 C2
  28. menu Font Color WindowText
  29. menu Font BGColor Yellow
  30. menu Button MoveItems 4 76 200 20 Move Items
  31. menu Show 421 270
  32. Reset:
  33. set %name N/A
  34. set #menubutton 0
  35. Listener:
  36. if #menubutton = Box1
  37. {
  38. Event Sysmessage Select the box you wish to move items from.
  39. gosub ContainerSelection
  40. set %Box1 %ContType
  41. menu Delete BoxName1
  42. gosub ItemProps
  43. menu Font Align Left
  44. menu Font Color Yellow
  45. menu Text BoxName1 26 25 %name ( %ContType )
  46. goto Reset
  47. }
  48. if #menubutton = Box2
  49. {
  50. Event Sysmessage Select the box you wish to move items to.
  51. gosub ContainerSelection
  52. set %Box2 %ContType
  53. menu Delete BoxName2
  54. gosub ItemProps
  55. menu Font Align Left
  56. menu Font Color Yellow
  57. menu Text BoxName2 26 53 %name ( %ContType )
  58. goto Reset
  59. }
  60. if #menubutton = MoveItems
  61. {
  62. menu Delete MoveItems
  63. set #menubutton 0
  64. menu Font Align Center
  65. menu Font Color Yellow
  66. menu Text ProcessingText 38 76 Processing Item Movement...
  67. gosub moveItems %Box1 %Box2
  68. menu Delete ProcessingText
  69. menu Font Color WindowText
  70. menu Font BGColor Yellow
  71. menu Button MoveItems 4 76 200 20 Move Items
  72. goto Reset
  73. }
  74. if #menubutton = CLOSED
  75. {
  76. halt
  77. }
  78. goto Listener
  79.  
  80.  
  81. sub ContainerSelection
  82. {
  83. set #targcurs 1
  84.  
  85. targloop:
  86. wait 5
  87. {
  88. if #targcurs = 1
  89. goto targloop
  90. wait 5
  91. finditem #ltargetid
  92. if #findtype in BO_WN_UMF_CTD_DLN_CUD_UXM_CKF_JKF_TXM_ZTD_VMF_TMF_LKF_AUD_OKF_ZJF_BKF
  93. {
  94. set %ContType #LTARGETID
  95. set #lobjectid #ltargetid
  96. Event Macro 17 0
  97. wait 5
  98. return
  99. }
  100. else
  101. {
  102. event sysmessage That is not a recognized container type.
  103. wait 1s
  104. set #targcurs 1
  105. wait 5
  106. goto targloop
  107. }
  108. }
  109.  
  110. return
  111. }
  112.  
  113. sub ItemProps
  114. finditem #ltargetid
  115. event property #findid
  116. wait 5
  117.  
  118. str pos #property $
  119. set %tmp #strres - 1
  120. str left #property %tmp
  121. set %name #strres
  122.  
  123. if #findstack > 1
  124. {
  125. str len #findstack
  126. set %tmp #strres + 1
  127. str del %name 1 %tmp
  128. set %name #strres
  129. }
  130. return
  131.  
  132. ;==================================
  133. ; Script Name: A fast moveItems Sub
  134. ; Author: Lord Helmchen
  135. ; Version: 1.2
  136. ; Client Tested with: 4.0.9b
  137. ; EUO version tested with: 1.5 Test 58
  138. ; Shard OSI / FS: RunUO
  139. ; Revision Date: 13.09.2005
  140. ; Public Release: 30.07.2005
  141. ; Purpose: Moves items between two containers as fast as possible.
  142. ; Usage: gosub moveItems sourceContainer targetContainer [itemTypes]
  143. ;==================================
  144. sub moveItems ns
  145. {
  146. namespace push
  147. namespace local moveItems
  148. set !dragTimeout 5 ;1/10 s
  149. set !dragTimer #scnt2
  150. set !items %3
  151. if %0 < 3
  152. set !items *
  153. set !from %1
  154. set !to %2
  155. finditem !items C_ , !from
  156. for #findindex 1 #findcnt
  157. {
  158. if #findkind = 0
  159. {
  160. set !amt 1
  161. if #findstack > 1
  162. set !amt #findstack
  163. while #scnt2 < !dragTimer
  164. wait 0
  165. exevent drag #findid !amt
  166. exevent dropc !to
  167. set !dragTimer #scnt2 + !dragTimeout
  168. }
  169. }
  170. namespace clear
  171. namespace pop
  172. return
  173. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement