Skip to content

Instantly share code, notes, and snippets.

@SOF3
Last active January 23, 2021 11:20
Show Gist options
  • Save SOF3/2128f3135a8e1e20f6a6d30fbe6d1d3f to your computer and use it in GitHub Desktop.
Save SOF3/2128f3135a8e1e20f6a6d30fbe6d1d3f to your computer and use it in GitHub Desktop.
set itemSource nucleus1
ubind @poly
sensor items @unit @totalItems
jump 20 greaterThan items 0
sensor coreX itemSource @x
sensor coreY itemSource @y
ucontrol move coreX coreY 0 0 0
op rand itemId 12 b
jump 13 lessThan itemId 2
jump 15 lessThan itemId 5
jump 17 lessThan itemId 8
set item @lead
jump 18 always itemId 2
set item @titanium
jump 18 always itemId 2
set item @silicon
jump 18 always itemId 2
set item @copper
ucontrol itemTake itemSource item 20 0 0
jump 37 always x false
op rand linkNo @links b
op floor linkNo linkNo b
getlink link linkNo
sensor linkType link @type
jump 20 notEqual linkType @alloy-smelter
sensor itemType @unit @firstItem
sensor supplied link itemType
jump 33 lessThan supplied 20
sensor coreX itemSource @x
sensor coreY itemSource @y
ucontrol move coreX coreY 0 0 0
ucontrol itemDrop itemSource 20 10 0 0
end
sensor dropX link @x
sensor dropY link @y
ucontrol move dropX dropY 0 0 0
ucontrol itemDrop link 20 10 0 0
print state
printflush message1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment