Samatter

script_latex.data

May 29th, 2021 (edited)
84
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None
  1. If(%HITID%=="IC2:blockRubWood")
  2. #x=%HITX%
  3. #y=%HITY%
  4. #z=%HITZ%
  5.  
  6. // max rubber tree height is 8
  7. #y_max=#y+8
  8.  
  9. #latex_count=0
  10. &info="Latex not found."
  11.  
  12. For(#y_index,%#y%,%#y_max%)
  13. GetID(%#x%,%#y_index%,%#z%,&id,#data)
  14. If(%&id%=="IC2:blockRubWood")
  15. Dec(#data,1)
  16. If(%#data%>0)
  17. Inc(#latex_count,1)
  18.  
  19. // get latex state
  20. If(%#data%>6)
  21. Dec(#data,6)
  22. &info="Empty latex"
  23. Else
  24. &info="Full latex"
  25. EndIf
  26.  
  27. // get relative height
  28. #block_pos=#y_index
  29. Dec(#block_pos,%#y%)
  30. Inc(#block_pos,1)
  31. &info="%&info% on the block %#block_pos%"
  32.  
  33. // get latex side
  34. If(%#data%==1)
  35. &info="%&info%, north."
  36. ElseIf(%#data%==2)
  37. &info="%&info%, south."
  38. ElseIf(%#data%==3)
  39. &info="%&info%, west."
  40. ElseIf(%#data%==4)
  41. &info="%&info%, east."
  42. EndIf
  43.  
  44. Log(%&info%)
  45. EndIf
  46. EndIf
  47. Next
  48. If(%#latex_count%>0)
  49. &info="%#latex_count% latex found."
  50. EndIf
  51. Log(%&info%)
  52. EndIf
RAW Paste Data Copied