Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //This script should harvest and plant wheat in a rectangular farm, throwing
- //out extra seeds, and chesting wheat on one side and continuing to plant afterwards. -Gerbil_9
- //Skrongden script
- // Stick in first slot, food in 2nd slot, seeds in 8th and last slots.
- // The ONLY THINGS you should need to change are the #rows in your farm, the far-end x-coordinate (eastward)
- // and the #ticks to wait (near the end of the entire script).
- // Everything else should work as long as there's a chest
- // to the west of the start point, your farm faces east and you followed the other instructions.
- //This if/else statement makes this script "toggle" on or off.
- if(wheat);
- log("&3Wheat Farming Stopped");
- unset(wheat);
- stop();
- else;
- log("&3Wheat Farming Started");
- set(wheat);
- //"If not "NOT FARMING" then do the farming script, beginning here:"
- do;
- //Set this # (currently 54) to number of rows in your farm
- // 6024 is what I use for farend
- set(#rows,62);
- set(#farend,-2205);
- set(#counter,%ZPOS%);
- set(#z,%ZPOS%);
- set(#x,%XPOS%);
- //Go through this script for as many rows as you have
- do(%#rows%);
- //Looks at inventory to see if a good amount has been filled.
- //If so, returns to start, dumps things in chest, returns to
- //where it left off.
- press(e);
- wait(250ms);
- getslotitem(26,&item,#num);
- if(%&item% != "air");
- press(e);
- wait(250ms);
- wait(100ms);
- look(180,0);
- wait(100ms);
- togglekey(forward);
- do;
- look(180,0);
- until(ZPOS=%#z%);
- togglekey(forward);
- log("&3Returned to Start");
- wait(250ms);
- //Begin chest-placement of wheat. Starting with looking eye-level.
- look(270,0);
- wait(150ms);
- look(270,+45)
- wait(250ms);
- set(#chest_counter,53);
- key(use);
- wait(500ms);
- do;
- getslotitem(%#chest_counter%,&item,#num);
- if(%&item% = "wheat");
- slotclick(%#chest_counter%,1,true);
- wait(500ms);
- endif;
- inc(#chest_counter);
- until(#chest_counter = 90);
- press(e);
- look(270,-45);
- wait(250ms);
- // This code is for wheat bots which require dumping seeds.
- do(9);
- set(#slot,3);
- press(e);
- wait(200ms)
- set(#invslot,9);
- do;
- slotclick(%#invslot%,1,true);
- inc(#invslot);
- until(#invslot=35);
- slotclick(35,1,true);
- wait(250ms);
- press(e);
- //echo("Pressed E twice");
- wait(250ms);
- do;
- slot(%#slot%);
- getslotitem(%#slot%,&item,#num);
- do(%#num%);
- key(drop);
- wait(20ms);
- loop;
- inc(#slot);
- until(#slot=8);
- wait(500ms);
- loop;
- look(0,0);
- wait(100ms);
- togglekey(forward);
- log("&3Returning to harvest");
- do;
- look(0,0);
- until(ZPOS=%#counter%);
- togglekey(forward);
- wait(250ms);
- look(90,90);
- press(e);
- wait(250ms);
- endif;
- press(e);
- log("&3If Statement Ended");
- wait(250ms);
- togglekey(forward);
- do;
- //Selects first slot (stick)
- slot(1);
- //Looks east
- look(90,90);
- //Harvests
- key(attack);
- //set this number to the x position of the far end of your farm
- until(XPOS=%#farend%);
- log("&3Done Harvesting");
- do;
- //does the same as the harvesting bit, but with planting/west
- pick(wheat_seeds);
- look(270,90);
- key(use);
- until(XPOS=%#x%);
- log("&3Done Planting");
- //decreases row counter and starts harvesting/planting next row
- //togglekey(forward);
- dec(#counter);
- //Moves to the next row.
- do;
- look(0,0);
- until(ZPOS=%#counter%);
- log("&3Moved to Next Row!")
- //ends the harvesting/planting "do" loop
- loop;
- do;
- look(180,0);
- until(ZPOS=%#z%);
- togglekey(forward);
- //Eating Script
- slot(2);
- keydown(use);wait(10000ms);
- look(270,0);
- togglekey(forward);
- //change this wait time to crop growth time (72000ticks*hours), I have this set currently to
- //a couple of seconds because I like to turn my bot off instead of letting it repeat every 3 hours
- //until I shut it off. Regardless, after this time has past it will start harvesting your wheat
- //field all over again ad infinitum.
- //For "ticks" do "wait(####t);" the "t" means ticks. ms is milliseconds.
- wait(5000ms);
- //End auto-eating script
- keyup(use);
- togglekey(forward);
- wait(300ms);
- //do;
- //keydown(forward);
- //look(0,0);
- //until(ZPOS=%#z%);
- log("&3Done with final Forward Loop");
- keyup(forward);
- loop;
- //end script/if-statement/loop
- endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement