You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First CBOT program I've made in years since the last time I picked up the game. Pretty self-explainatory, this program makes the recycler move around and recycle on it's own, can also hande the cases when nearest wreck is under water. Main concern is not reacting to battery level in time to go recharge. Tested on the uranium hill mission and TerraNova freeplay.
Feedback is welcome.
extern void object::RecyclerAutomation()
{
object wreck;
object power;
object integrity;
//main body of the program
while(radar(Wreck) != null) //checks for wrecks on map before anything else, otherwise the program stops after recycling a single wreck
{
if(energyCell.energyLevel < 0.4 && energyCell.category != NuclearCell && radar(PowerStation) != null)
{
message("Low on power, going to recharge.", DisplayWarning);
power = radar(PowerStation);
goto(power.position);
while(this.energyLevel < 1)
{
wait(1);
}
message("Recycler charging completed, continuing work.", DisplayInfo);
}
else
{
message("Power Station not found or inaccessible.", DisplayError);
}
if(shieldLevel < 0.4 && canbuild(RepairCenter) && radar(RepairCenter) != null)
{
message("Structual integrity is low, retreating to repair facility.", DisplayWarning);
integrity = radar(RepairCenter);
goto(integrity.position);
while(this.shieldLevel < 1)
{
wait(1);
}
message("Recycler repaired, continuing work.");
}
else
{
message("Repair Center not found or inaccessible.", DisplayError);
}
wreck = radar(Wreck);
if(wreck.position.z < 0)
{
message("Wreck found under water, searching for a different one.", DisplayWarning);
object newWreck;
newWreck = radar(Wreck, 0, 360, wreck.position.z + 100);
goto(newWreck.position);
move(-0.8);
recycle();
message("Wreck recycled, moving on.");
}
goto(wreck.position);
move(-0.8); //moves a bit backwards, hopefully this helps with the recycler constantly smacking the wreck under some angles
recycle();
message("Wreck recycled, moving on.");
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
First CBOT program I've made in years since the last time I picked up the game. Pretty self-explainatory, this program makes the recycler move around and recycle on it's own, can also hande the cases when nearest wreck is under water. Main concern is not reacting to battery level in time to go recharge. Tested on the uranium hill mission and TerraNova freeplay.
Feedback is welcome.
Beta Was this translation helpful? Give feedback.
All reactions