Advertisement
MiraMiraMira

Sell Junk Macro

Dec 3rd, 2015
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $${
  2. //editable variables
  3. //add whatever items you want to auto-sell here
  4. &itemstosell = "stone|cobblestone|granite|diorite|andesite|dirt|gravel|flint|rail|fence"
  5.  
  6. IF(GUI = "NONE")
  7.     #amounttosell = 0
  8.     UNSET(&sell[])
  9.     GUI(INVENTORY)
  10.     //cycles through all inventory slot ID's
  11.     FOR(#slotid,9,44)
  12.         //gets inventory slot info
  13.         GETSLOTITEM(%#slotid%,&founditem,#stacksize,#datavar)
  14.         //checks if the item is on the sell list
  15.         IFMATCHES(%&founditem%, "^(%&itemstosell%)$")
  16.         //detects what type of stone it is, a function like this is also needed for wood, planks, wool, decoration bricks/sandstone, colored glass, clay, etc...
  17.             IF(&founditem = "stone")
  18.                 IF(#datavar = 1)
  19.                     &founditem = "granite"
  20.                 ELSEIF(#datavar = 3)
  21.                     &founditem = "diorite"
  22.                 ELSEIF(#datavar = 5)
  23.                     &founditem = "andesite"
  24.                 ENDIF
  25.             ENDIF
  26.             //checks is an item is already in the sell array
  27.             //I used this so instead of selling everything as it was found, it would save an array of items, then close your inventory so you could get back to what you were doing, then actually sell them, saving you a few seconds
  28.             INDEXOF(&sell,#index,%&founditem%)
  29.             //if item was not found
  30.             IF(#index = -1)
  31.                 PUSH(&sell,%&founditem%)
  32.                 #amounttosell = #amounttosell + 1
  33.             ENDIF
  34.            
  35.         ENDIF
  36.     NEXT
  37.     //closes inventory GUI, allowing you to go back to mining, as it sells everything
  38.     GUI()
  39.     //checks if anything needs to be sold
  40.     IF(#amounttosell > 0)
  41.         #endofarray = #amounttosell - 1
  42.         //cycles through array for things to be sold
  43.         FOR(#arrayposition,0,%#endofarray%)
  44.             ECHO(/sell %&sell[%#arrayposition%]%)
  45.             //anti command spam
  46.             WAIT(1)
  47.         NEXT
  48.     ENDIF
  49. ENDIF
  50. }$$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement