Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $${
- //editable variables
- //add whatever items you want to auto-sell here
- &itemstosell = "stone|cobblestone|granite|diorite|andesite|dirt|gravel|flint|rail|fence"
- IF(GUI = "NONE")
- #amounttosell = 0
- UNSET(&sell[])
- GUI(INVENTORY)
- //cycles through all inventory slot ID's
- FOR(#slotid,9,44)
- //gets inventory slot info
- GETSLOTITEM(%#slotid%,&founditem,#stacksize,#datavar)
- //checks if the item is on the sell list
- IFMATCHES(%&founditem%, "^(%&itemstosell%)$")
- //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...
- IF(&founditem = "stone")
- IF(#datavar = 1)
- &founditem = "granite"
- ELSEIF(#datavar = 3)
- &founditem = "diorite"
- ELSEIF(#datavar = 5)
- &founditem = "andesite"
- ENDIF
- ENDIF
- //checks is an item is already in the sell array
- //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
- INDEXOF(&sell,#index,%&founditem%)
- //if item was not found
- IF(#index = -1)
- PUSH(&sell,%&founditem%)
- #amounttosell = #amounttosell + 1
- ENDIF
- ENDIF
- NEXT
- //closes inventory GUI, allowing you to go back to mining, as it sells everything
- GUI()
- //checks if anything needs to be sold
- IF(#amounttosell > 0)
- #endofarray = #amounttosell - 1
- //cycles through array for things to be sold
- FOR(#arrayposition,0,%#endofarray%)
- ECHO(/sell %&sell[%#arrayposition%]%)
- //anti command spam
- WAIT(1)
- NEXT
- ENDIF
- ENDIF
- }$$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement