上传文件
This commit is contained in:
1 parent
d24531851a
commit
9ae55bcc64
12 files changed
+2529
No files matched your search
@@ -0,0 +1,22 @@
|
|||||||
|
import config
|
||||||
|
def Plant():
|
||||||
|
for x in range(get_world_size()):
|
||||||
|
for y in range(get_world_size()):
|
||||||
|
if get_entity_type() != None:
|
||||||
|
if can_harvest():
|
||||||
|
harvest()
|
||||||
|
if num_items(Items.Hay) > config.carrottimes * get_world_size() and num_items(Items.Wood) > config.carrottimes * get_world_size():
|
||||||
|
if get_ground_type() != Grounds.Soil:
|
||||||
|
till()
|
||||||
|
plant(Entities.Carrot)
|
||||||
|
if get_water() < config.waterpercent:
|
||||||
|
use_item(Items.Water)
|
||||||
|
else:
|
||||||
|
if num_items(Items.Hay) > config.carrottimes * get_world_size() and num_items(Items.Wood) > config.carrottimes * get_world_size():
|
||||||
|
if get_ground_type() != Grounds.Soil:
|
||||||
|
till()
|
||||||
|
plant(Entities.Carrot)
|
||||||
|
if get_water() < config.waterpercent:
|
||||||
|
use_item(Items.Water)
|
||||||
|
move(North)
|
||||||
|
move(East)
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import config
|
||||||
|
def Plant():
|
||||||
|
for x in range(get_world_size()):
|
||||||
|
for y in range(get_world_size()):
|
||||||
|
if get_entity_type() != None:
|
||||||
|
if can_harvest():
|
||||||
|
harvest()
|
||||||
|
if get_ground_type() != Grounds.Grassland:
|
||||||
|
till()
|
||||||
|
else:
|
||||||
|
if get_ground_type() != Grounds.Grassland:
|
||||||
|
till()
|
||||||
|
move(North)
|
||||||
|
move(East)
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
import config
|
||||||
|
def Plant():
|
||||||
|
while True:
|
||||||
|
dead = 0
|
||||||
|
for x in range(get_world_size()):
|
||||||
|
for y in range(get_world_size()):
|
||||||
|
if get_entity_type() != None:
|
||||||
|
if get_entity_type() != Entities.Pumpkin:
|
||||||
|
dead += 1
|
||||||
|
if can_harvest():
|
||||||
|
harvest()
|
||||||
|
if num_items(Items.Carrot) > config.pumpkintimes * get_world_size():
|
||||||
|
if get_ground_type() != Grounds.Soil:
|
||||||
|
till()
|
||||||
|
plant(Entities.Pumpkin)
|
||||||
|
if get_water() < config.waterpercent:
|
||||||
|
use_item(Items.Water)
|
||||||
|
else:
|
||||||
|
dead += 1
|
||||||
|
if num_items(Items.Carrot) > config.pumpkintimes * get_world_size():
|
||||||
|
if get_ground_type() != Grounds.Soil:
|
||||||
|
till()
|
||||||
|
plant(Entities.Pumpkin)
|
||||||
|
if get_water() < config.waterpercent:
|
||||||
|
use_item(Items.Water)
|
||||||
|
move(North)
|
||||||
|
move(East)
|
||||||
|
if dead == 0:
|
||||||
|
for a in range(get_pos_x()):
|
||||||
|
move(West)
|
||||||
|
for b in range(get_pos_y()):
|
||||||
|
move(South)
|
||||||
|
harvest()
|
||||||
|
break
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
import config
|
||||||
|
def Plant():
|
||||||
|
for x in range(get_world_size()):
|
||||||
|
for y in range(get_world_size()):
|
||||||
|
if get_entity_type() != None:
|
||||||
|
if can_harvest():
|
||||||
|
harvest()
|
||||||
|
if get_ground_type() != Grounds.Soil:
|
||||||
|
till()
|
||||||
|
plant(Entities.Sunflower)
|
||||||
|
if get_water() < config.waterpercent:
|
||||||
|
use_item(Items.Water)
|
||||||
|
else:
|
||||||
|
if get_ground_type() != Grounds.Soil:
|
||||||
|
till()
|
||||||
|
plant(Entities.Sunflower)
|
||||||
|
if get_water() < config.waterpercent:
|
||||||
|
use_item(Items.Water)
|
||||||
|
move(North)
|
||||||
|
move(East)
|
||||||
|
for a in range(14):
|
||||||
|
for x in range(get_world_size()):
|
||||||
|
for y in range(get_world_size()):
|
||||||
|
if measure() == 15-a:
|
||||||
|
harvest()
|
||||||
|
move(North)
|
||||||
|
if a > 8:
|
||||||
|
break
|
||||||
|
move(East)
|
||||||
|
if a > 8:
|
||||||
|
break
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import config
|
||||||
|
def Plant():
|
||||||
|
for x in range(get_world_size()):
|
||||||
|
for y in range(get_world_size()):
|
||||||
|
if get_entity_type() != None:
|
||||||
|
if can_harvest():
|
||||||
|
harvest()
|
||||||
|
if get_ground_type() != Grounds.Grassland:
|
||||||
|
till()
|
||||||
|
if x % 2 == 0:
|
||||||
|
if y % 2 == 0:
|
||||||
|
plant(Entities.Tree)
|
||||||
|
else:
|
||||||
|
if y % 2 != 0:
|
||||||
|
plant(Entities.Tree)
|
||||||
|
if get_water() < config.waterpercent:
|
||||||
|
use_item(Items.Water)
|
||||||
|
else:
|
||||||
|
if get_ground_type() != Grounds.Grassland:
|
||||||
|
till()
|
||||||
|
if x % 2 == 0:
|
||||||
|
if y % 2 == 0:
|
||||||
|
plant(Entities.Tree)
|
||||||
|
else:
|
||||||
|
if y % 2 != 0:
|
||||||
|
plant(Entities.Tree)
|
||||||
|
if get_water() < config.waterpercent:
|
||||||
|
use_item(Items.Water)
|
||||||
|
move(North)
|
||||||
|
move(East)
|
||||||
+2321
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,18 @@
|
|||||||
|
import CarrotModule
|
||||||
|
import TreeModule
|
||||||
|
import GrassModule
|
||||||
|
import PumpkinModule
|
||||||
|
import SunFlowerModule
|
||||||
|
crops = [Entities.Carrot,Entities.Pumpkin,Entities.Tree,Entities.Sunflower]
|
||||||
|
while True:
|
||||||
|
for crop in crops:
|
||||||
|
if crop == Entities.Carrot:
|
||||||
|
CarrotModule.Plant()
|
||||||
|
if crop == Entities.Grass:
|
||||||
|
GrassModule.Plant()
|
||||||
|
if crop == Entities.Tree:
|
||||||
|
TreeModule.Plant()
|
||||||
|
if crop == Entities.Pumpkin:
|
||||||
|
PumpkinModule.Plant()
|
||||||
|
if crop == Entities.Sunflower:
|
||||||
|
SunFlowerModule.Plant()
|
||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
import config
|
||||||
|
def Plant():
|
||||||
|
dead_x = []
|
||||||
|
dead_y = []
|
||||||
|
for x in range(get_world_size()):
|
||||||
|
for y in range(get_world_size()):
|
||||||
|
if get_entity_type() != None:
|
||||||
|
if can_harvest():
|
||||||
|
harvest()
|
||||||
|
if num_items(Items.Carrot) > config.pumpkintimes * get_world_size():
|
||||||
|
if get_ground_type() != Grounds.Soil:
|
||||||
|
till()
|
||||||
|
plant(Entities.Pumpkin)
|
||||||
|
if get_water() < config.waterpercent:
|
||||||
|
use_item(Items.Water)
|
||||||
|
else:
|
||||||
|
if num_items(Items.Carrot) > config.pumpkintimes * get_world_size():
|
||||||
|
if get_ground_type() != Grounds.Soil:
|
||||||
|
till()
|
||||||
|
plant(Entities.Pumpkin)
|
||||||
|
if get_water() < config.waterpercent:
|
||||||
|
use_item(Items.Water)
|
||||||
|
for x in range(get_world_size()):
|
||||||
|
for y in range(get_world_size()):
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"items":{"serializeList":[{"name":"hay","nr":274838.0},{"name":"wood","nr":310225.0},{"name":"carrot","nr":139972.0},{"name":"pumpkin","nr":116139.0},{"name":"water","nr":30039.0},{"name":"fertilizer","nr":5676.0},{"name":"power","nr":14987.589666666778}]},"dockedFiles":[{"key":"CarrotModule","value":"main"},{"key":"config","value":"SunFlowerModule"},{"key":"GrassModule","value":"TreeModule"},{"key":"main","value":"clear"},{"key":"pumpkin","value":"tools"},{"key":"PumpkinModule","value":"GrassModule"},{"key":"SunFlowerModule","value":"PumpkinModule"},{"key":"tools","value":"config"},{"key":"TreeModule","value":"CarrotModule"}],"minimizedFiles":["CarrotModule","clear","config","GrassModule","main","pumpkin","PumpkinModule","SunFlowerModule","tools","TreeModule"],"openFilePositions":[{"key":"CarrotModule","value":{"x":1532.1026611328125,"y":1707.4998779296875}},{"key":"clear","value":{"x":-301.1478271484375,"y":857.6665649414063}},{"key":"config","value":{"x":1532.1026611328125,"y":1707.4998779296875}},{"key":"GrassModule","value":{"x":1532.1026611328125,"y":1707.4998779296875}},{"key":"main","value":{"x":1532.1026611328125,"y":1707.4998779296875}},{"key":"pumpkin","value":{"x":1532.1026611328125,"y":1707.4998779296875}},{"key":"PumpkinModule","value":{"x":1532.1026611328125,"y":1707.4998779296875}},{"key":"SunFlowerModule","value":{"x":1532.1026611328125,"y":1707.4998779296875}},{"key":"tools","value":{"x":1532.1026611328125,"y":1707.4998779296875}},{"key":"TreeModule","value":{"x":1532.1026611328125,"y":1707.4998779296875}},{"key":"docs0","value":{"x":-935.7947998046875,"y":1360.41748046875}},{"key":"docs1","value":{"x":337.240234375,"y":1091.625732421875}}],"openFileScrollPositions":[{"key":"CarrotModule","value":0.0},{"key":"clear","value":-0.000030517578125},{"key":"config","value":0.0},{"key":"GrassModule","value":0.0},{"key":"main","value":0.0},{"key":"pumpkin","value":0.0},{"key":"PumpkinModule","value":251.53636169433595},{"key":"SunFlowerModule","value":378.08282470703127},{"key":"tools","value":0.0},{"key":"TreeModule","value":0.0}],"openFileSizes":[{"key":"CarrotModule","value":{"x":0.0,"y":0.0}},{"key":"clear","value":{"x":0.0,"y":0.0}},{"key":"config","value":{"x":0.0,"y":0.0}},{"key":"GrassModule","value":{"x":0.0,"y":443.3776550292969}},{"key":"main","value":{"x":0.0,"y":583.07958984375}},{"key":"pumpkin","value":{"x":0.0,"y":0.0}},{"key":"PumpkinModule","value":{"x":0.0,"y":841.0057373046875}},{"key":"SunFlowerModule","value":{"x":0.0,"y":0.0}},{"key":"tools","value":{"x":0.0,"y":0.0}},{"key":"TreeModule","value":{"x":0.0,"y":677.8125}},{"key":"docs0","value":{"x":900.0,"y":700.0}},{"key":"docs1","value":{"x":900.0,"y":700.0}}],"openDocPages":[{"key":"docs0","value":"docs/unlocks/polyculture.md"},{"key":"docs1","value":"docs/scripting/lists.md"}],"unlocks":["grass_6","soil","harvest","pass","do_a_flip","pet_the_piggy","grassland","hay","straw_hat","tap","while","true","false","break","continue","loops","change_hat","gray_hat","purple_hat","green_hat","brown_hat","hats","can_harvest","if","else","elif","speed_5","expand_7","move","north","south","east","west","for","range","get_world_size","wood","bush","entities","clear","plant","and","or","not","operators","traffic_cone","carrots_6","carrot","till","can_trade","trade","items","carrot_seed","print","quick_print","unlocks","str","debug","get_entity_type","get_ground_type","grounds","get_pos_x","get_pos_y","none","num_items","num_unlocked","senses","variables","append","remove","pop","insert","len","list","lists","carrot_hat","tree_hat","tree","trees_6","functions","def","return","global","from","import","watering_6","water","use_item","get_water","weird_substance","fertilizer_4","sunflower_seed","sunflower","power","get_active_power","measure","sunflowers","pumpkin","pumpkin_seed","dead_pumpkin","pumpkins_5","wizard_hat","pumpkin_hat","dicts","sets","add","dict","set","dictionaries","swap","cactus_seed","cactus_3","get_companion","polyculture","sunflower_hat","min","max","abs","random","utilities","get_cost","costs"],"version":3}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
def goto(target_x,target_y):
|
||||||
|
if get_pos_x() > target_x:
|
||||||
|
if get_pos_x() - target_x > get_world_size() - get_pos_x() + target_x:
|
||||||
|
while get_pos_x() != target_x:
|
||||||
|
move(East)
|
||||||
|
else:
|
||||||
|
while get_pos_x() != target_x:
|
||||||
|
move(West)
|
||||||
|
else:
|
||||||
|
if target_x - get_pos_x() > get_world_size() - target_x + get_pos_x():
|
||||||
|
while get_pos_x() != target_x:
|
||||||
|
move(West)
|
||||||
|
else:
|
||||||
|
while get_pos_x() != target_x:
|
||||||
|
move(East)
|
||||||
|
if get_pos_y() > target_y:
|
||||||
|
if get_pos_y() - target_y > get_world_size() - get_pos_y() + target_y:
|
||||||
|
while get_pos_y() != target_y:
|
||||||
|
move(North)
|
||||||
|
else:
|
||||||
|
while get_pos_y() != target_y:
|
||||||
|
move(South)
|
||||||
|
else:
|
||||||
|
if target_y - get_pos_y() > get_world_size() - target_y + get_pos_y():
|
||||||
|
while get_pos_y() != target_y:
|
||||||
|
move(South)
|
||||||
|
else:
|
||||||
|
while get_pos_y() != target_y:
|
||||||
|
move(North)
|
||||||
Reference in new issue
Block a user