I was hired to automate farming...

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello fellow engineers and welcome to the farmer was replaced replaced by what you might ask this drone with a straw hat and this other drone which is like a piggy bank flying around this game is absolutely like it's really I don't really know how to describe it it's a clicker game but it's also a programming game like you got to program the game to become a clicker for you if that makes sense so as you can see here this is this is our farm currently it's just one little block of land under there under our drone but in order order to make our drone actually collect that and turn it into coins we've got to use this and basically we can type commands into here and we can we can do all sorts for example we can type do a flip then if we press plate our drone does a flip which is cool but it doesn't get money that's where the Harvest one comes in so if we run that we got a coin that's gone into the top left well it's not a coin it's actually just a a bunch of hay so basically we can play this as often as we want I guess we could probably copy and then put that down a few times so if we press play now we should get five load of hate yeah nice now the game does have this little taskbar thing which sort of teaches you what to do and introduces new stuff and so basically the next thing we want to do is click on this unlock button in the top right and then oh boy there's a lot to unlock here but we're going to start with unlocking Loops so we can use a while loop which has true and false man programmers are going to absolutely love this and they're probably going to be screaming at me for being an idiot but uh let's have a go with this then so I think what we want to sort of do is is we say while and then true and then underneath if we press tab so it goes to there we can then put the Harvest command and then brackets I don't know why you put brackets I don't know I don't know why you do a lot of stuff but oh no there must be a coolon yeah so I think we got to put a coolon there right so now that says while true and then the colon means it looks for like the next part of the task so if you press play now does it need a capital Le yeah it needs a capital so many so many rules but that is Pro gring for you so we press play and now we it's unlimited money unlimited so you can see our piggy bank is filling up that is very very nice and and it means we can go to our next unlock and we can unlock the speed now you'll notice the the Drone is like it's trying to harvest the wheat however the wheat isn't it's not growing enough like if I press stop you can see it's now grown if I just if I just play it once so Bo then we get we get the hay out of there so if I just do that a few times it works but if we try and play it it's too fast so basically we need like a delay in time from after we Harvest to allow the the crops to grow now the game's given us a new function the can Harvest function which basically sort of says can we Harvest it is it is it okay is it too short or is it grown fully so we can say if and then can Harvest so the Drone looks at the hay and it says can I harvest it if it can then we can type in Harvest hang on I forgot my I forgot my colons otherwise which is just in programming language we can use that flip we leared so it looks something like that so our drone when we press play it should yeah it looks at the hay you can see it's long enough we can Harvest it so we've just got to turn this into a loot so we need a line above which can be the while command so we say while true and then I think the stuff below we've got to tab like over once so all of it moves over to the right so that while true we can do this and then I think because it's true it just keeps looping now apparently when you actually do programming you shouldn't do infinite Loops but in this game apparently there's like a little pause or something so it's fine and cuz it's a clicker we're trying to get as much hay as possible infinite Loops are the way to go okay so while is wrong so is it while true and then that yes I need to learn how things work but yeah so now you can see we're harvesting the hay and then we do a backflip while we wait for it to grow and then that is enough time that the the whole the whole Loop starts again yeah and it means we're gaining lots of lots of hay into our piggy bank why is the piggy bank taking hey why not cash anyway in the unlock menu we can now unlock once we've waited until we've got 100 coins sorry Haze we can unlock grass which increases the yield of grass so it costs 100 ha so we can do that and now you can see every time we gain a hay if you look in the top left we're gaining two every single time so yeah now hay is worth double we can then move on to these two so this one over here we can unlock the plant so once we got 50 hey we can unlock that on the right we've got this one expand expand which costs 30 okay let's go with let's try the expand first it's only 30 oh yeah now look at this so there's three there's three loads of hate and we're being taught the move command so movement works is as the directions NorthEast Southwest never eat Shredded Wheat all so the question is how do we want to combine that with what we have so let's just stop it a second so we may not need wild true or actually looking down here we do need that to move yeah okay so if we grab move north there I'm just going to do this step by step so while true we can we can move north so we can say while true and then move north Bo so it moves Us North and then we can Harvest what's there and then it goes back to the top and moves oh actually I think this is this is everything we need so I think if we just play this oh yeah it does just move oh sweet look how much fast that is so it no longer does a flip because it doesn't it doesn't like need the time cuz it moves forward every single time like it just harvests the next one by the time it gets to the top it jumps back to the first one um meaning the others have grown so that's oh man money is flying in okay so back in the unlocks we have plant over here and worth noting as well as you hover over these you can upgrade them again but look they cost logs and actually this one down here operators that requires hay and logs so I'm guessing over on the plant one that's how we unlock logs perhaps so yeah we've unlocked planting now so we can plant entities Bush um what I might do I might I might just stop this you can add an extra window so like over here I can work on something else so I don't really want to lose what I've got there but I do just want to sort of work out how this planting works so if I were to just plant and then we play that oh plants a bush now I'm pretty sure if we Harvest this now let's just play the Harvest command yeah that's Harvest it oh and it goes back to Hay Yeah so basically when you plant a bush you've then got to wait for it to grow if I harvest it too early as before you don't get anything but if we if we plant it wait for it to grow like that and then do the Harvest we get a log so you can see in the top left we've now got three logs from where I've been doing this so do I want to go all in on logs at the moment or do I want a bit of hay still I tell you what I might leave the main one and then sort of copy this to my new one so over here right and then so in here if we probably after this if can I add like a separate things so if we can Harvest we then Harvest but then can we plant afterwards so hopefully if we can Harvest we'll Harvest it then we'll plant a bush otherwise we'll do a flip and then we'll just move north every time so if I play that yes yes okay so then we just do a flip and we're just sort of waiting for them to grow then we can Harvest plant Harvest plant okay we've now we've now automated logs so I can probably rename this to logs rename the main one to grass and then if I just move them side by side I feel like this is like one of the main parts of like using like engineering software like getting all your all your windows in the right place making them all neat making all the gaps the same but yeah I did do a little bit of programming like when I was at University we use this program called mat lab I think it's like short for mathematics laboratory or something I mean it's sort of like a engineering programming things it's sort of like this but you can use it to like make sort of software that helps you like calculate loadings and beams and stuff um it was kind of cool it was slightly annoying it was compulsory you could not do it so I do have a little bit of this sort of knowledge and the way I sort of like Tred to think about in my head is this basically like XL but there's no boxes that's what programming is Right XL without boxes right anyway we are gaining we are gaining a load of logs let's have a look in the unlocks what we can get now we can unlock the operators what I might want to do though is there's an expand here oh you can go from 1x3 to 3x3 oh I think I might do that so yeah I've just done that there we go we have grass and we have logs so we can probably combine them quite well I'm going to in the unlocks as well also do the grass upgrade again so that's 300 he but now they're all worth three but yeah since we got a 3X3 I think that's quite a Big Grid let's try and sort of merge these two these two programs together and let me just check like what the next expand is oh it needs carrot okay that's quite a way off I think right so before I merge these two together let's just get the old the whole hay up to 200 cuz then I can unlock senses and look that allows the Drone to see what's underneath it and where it is I think that would be really useful so unlock that then the Drone can SE out so we can get the position X and Y note Minecraft players it's X and Y not X and Zed so the X position increases one East and then the Y position increases one North okay that's fine so in terms of this 3x3 grid now let's just let's just pause that a second so we've unlocked get entity type and get ground type but it looks like we need to unlock operators first so what do we need for operators 300 and 30 okay we can unlock that straight away boost so operators oh goodness there's the game's throwing a lot at me right now all right so yeah I'm just going to add a new thing just called like test and it's just going to allow me to test all the new stuff I've unlocked so if this is now working on a grid we can say if and then we can use this one so y position so if that equals z which should be the the the bottom row then we do our semicolon then down here we can say move East so that will move to the right so yeah if I play that because it's just on the bottom row it moves to the right so if I want to get it to move up first I guess above all of this if I move both of these to the right we can do North so let's see so it's going to move north it's going to be up there and then it's going to check if it's on the bottom row and then it's not so we need an else to go in after this so else move north so if we move those back over to there I think what should happen hang on there must be a colon after okay yeah yeah else is its own command isn't it it's just got to be else on its own okay so yeah so I think what happens here if we start at the top so it should move north there you go it's moved North so if we keep going through it's then going to look at what position Y is in so it's going to say I'm not on position o so I'm not going to move East it goes straight to the else one then when it gets there it moves North again so if I if I play that all the way through did you see that it went back to the bottom and because it was in that row it starts down there now I think if all of this is looped it should work because it's always move north first so if we just make space up the top and we say while true that should create us our Loop we then just got to tab all this stuff over by one so then we can play this and yeah look it goes yes it does the entire grid for all of them brilliant unfortunately it's not it's not harvesting anything but that's fine I think we can add Harvest pretty easily so if we go down to our grass one it's basically this bit you want to steal from the Harvest so we can grab that we can then shove that in above the the moving thing so if we play this this is moving and harvesting it's not harvesting every single one though that's because I think this else isn't actually needed no it is it is isn't it do I need to like T these over by one or is that going to everything up okay it didn't everything up that's good but it's still not working how I want it to I think I need another Harvest thing in don't I so this moves North and then it Harvest yep and then it looks at position and it sees it's not on the bottom rout so it moves North and then it goes back to the beginning where move north happens again yeah okay so I think we don't want move north up the top I think if we play that we should do every block yeah except for now we haven't got to move north so I guess I could put another if for the X Direction okay actually I think I got it I think I got it if we say if y position equals 2 so it gets to the top then move East but then move north as well and then else I'll just say do a flip I think so if we play this oh no it's just flipping every time oh it's just flipping every time yeah because oh yeah idiot idiot so that's meant to be move north I mean it probably should be the other way around but I sort of want to check the position so I think think this should work so it should do every single one and then it moves down to the bottom oh I've actually solved it I've actually solved it programming is so rewarding okay so it does them all in order now brilliant okay so if I now want to plant stuff we know we have this plant entities one so I can make all of these bushes so I just swap harest no after harvest I just add plant entities so this should plant a plant a bush on every single one as we go through whe the time we get back to the start they have grown again yeah so we get logs that's good you can see in the top left actually logs are still only worth one and I'm guessing is there like a log value one no you can upgrade grass oh is it the plant no you can't okay you can't increase the the logs to get more interesting but still that's really good for logs what I'm thinking though can I sort of can I do a row of a row of logs and then a row of hate so maybe I want to make my last one hey let me just get my guide back open for sensing what's beneath it actually I don't need that I don't need that I've I've got mway I think I know what I'm doing I just want to see if we're in X position three we're going to make that one hey I reckon so if I add this down here so if we are in get position X of oh no not three two sorry so you write it like that so if x position equals 2 so if we're in that rout I think I probably want this up the top actually hang on I might just grab this and plonk it in the bottom right so that is is that is my logs one now I don't actually need the grass one let's get rid of the grass delete so my new test bench here if I cut that shove it here so if exp position is two then I just want to say if we can Harvest then Harvest I want to make sure after we have Harvest hang on let me just tab that over there so if we do do that I then do want to move north oh yeah then else will be move East I think actually right I've just pressed play it almost started working but then it planted a tree there oh it's got a bit mental it's got a little bit mental okay what it might be worth doing if I can make the I think I've just got to sort this out so let me just play through all of this all right so when it's here it it sees we can Harvest that then it moves North and it sees we can Harvest that oh it's down there yeah so it's between these two commands I've got to sort of make it do the top one again can I swap true with like that so while true to Loop the entire think oh this is going to get well confusing while true to link the entire thing but then for the top bit I want while that happens so I think cuz I got a while there I need to I need to move all of these over with tab like that right so this should put logs everywhere is it just going to do hey on the last three yes but now it's stuck on the right that is because because there's three when we get to the top you can harvest the one at the start again because of how long they take so I think all I need to add is once we've done the top one so if we say if get position X2 I think we can add an and or an or here so and if get position y if I do less than two two cuz then it's going to do it's going to harvest that one Harvest that one I might leave that one blank now oh no look it's just glitched up there it's like ah what do I do what do I do is it because that's indented too much what if I did that yeah then it moves over to there that plants all those oh it moves okay so I'm just missing the bottom two now that is getting all the hate it's not it's not harvesting the top right one either is it oh this is annoying I'm feeling for the programmers right now I can really I can actually fill the program and Shout at me like why is he trying to do it that way what an idiot to be fair to be fair well to be fair all right so if x is position two and then Y is less than two we do that so there we want an eles El we Harvest and then move East oh actually yeah is it just that was I just missing move north as well hang on let me try that so it Harvest is there and then goes back to the start and that goes to there okay so this one it goes that row Harvest Harvest Harvest oh I've done it I've done it I just forgot to move north as well I just needed those like that bit okay so this is gaining us three Haze but remember they're Times by three so that's getting us nine Haze and six logs in one go oh I tell you what I'll tell you what that's pretty good I think right so what have we unlocked now so variables requires carrots debug mode doesn't tools to help debuging problems I'm not going to have any problems and I let's let's debug let's see what it says sometimes your code just doesn't work and you need to find out why I don't need tool I've literally I worked it out just got to use your brain anyway it does mean we can now unlock the carrots so that's 100 logs so that is unlocked so basically we can add a strip of carrots which is good however to do carrots what do we need to do what I might do I might just pause this so I mean rather than my test this is actually my new thing now so let's just copy that down into it's called logs I think I'm just going to rename that main again so that's my main one matest one we're going to attempt to do carrots let's just move main down out the way so basically we need to do we need to till what does till do we'll play that okay oh so it plows the land if you till like plowed land then it goes back to normal grass okay the second new feature is that carrots need seeds to grow you can buy seeds with the trade function I need to buy seeds Okay so trade so if we do that oh look we got a seed up the top what does a seed cost oh it cost one of everything yeah look as I buy seeds cost oh no okay so presumably if I if I go back to what's down here we can grab like the the plant command and rather than Bush I guess we can put carrot all right so now if I play that so we should till the ground then we'll buy a carrot seed and then we'll plant the carrot then we got to wait for them to grow oh they take quite a while but then after that we can Harvest presumably so if we do Harvest come on yeah we get oh we get three carrots for that okay that's good so yeah I'm guessing I'm going to need something in order to check the ground to see if it's been tilled or not so that will be a senses we can get entity oh no get ground type oh yeah so I guess entity type rather than telling it what row it's in I can say like are you in the log Row the grass row or the carrot row by doing it that way I guess anyway we need ground type so I want to say if get ground type and do I want to say till oh no I need to use the equal sign don't I I mean to be fair I don't actually need to like check that first I'm sure I can get it to work without that I'm not just going to try and program my way out of it because I don't know how I to do it I just feel like it's a waste of a command I don't want to make it think too hard so we start with tilt then we trade to get some seeds then we plant and then before we Harvest we check that we can Harvest else we just move north and do it all again anyway right so I'm just going to try and get this road to like carrot so yeah this seems to work nice let's just add the while true at the start so while true I think do I I think do I need to yeah I need to indent all the rows beneath I think yeah so this sort of works I mean it's it's definitely doing carrots it's also doing hay as well in between um I I feel like it's good enough I guess we we're getting carrots that's the main thing right wait are we getting carrots oh no they take ages to grow we didn't get any carrots for that however once we add it into our main thing May maybe we will so right all I need to do now I need to swap row two so that is actually that's x = 1 isn't it so I think we can do if we can then actually add like a different command called like elth is it so this is sort of like a second thing so if all of that stuff oh no actually no cuz look we got while there no no okay ignore me ignore me we want to add after that another while here and we want you want that but a one this is going to be so conf confusing so I've just pasted this bit in here so while x = 1 which is the middle row I think we probably want the Harvest thing first so if we can Harvest then Harvest then till it then buy the carrot seeds then plant the carrot seeds and then move north oh no no before we do that move north we need we need all that thing in don't we so that says if we're in the top row then move East and North otherwise just move north yeah okay there's so much going on on this okay so I think we've got carrots in there so I think I've got to just move all these over sort of like that um so the question is what do we do if we can't Harvest when we get to the carrots so I think if we line up with this if that's where we put our else and I think there we just do we just wait or do we move north and just check the entire row I think let's just wait so we'll just say do a flip okay so it oh I was going to say it appears to be working but it doesn't I think we're tilling at the wrong time so they're all trees that is harvesting than tilling yeah so when it gets to here it's cocking up so we need to say if you can Harvest you harvest then you till then you do that no it should work shouldn't it and we move north so it goes back up to this one so it does the same thing can we Harvest yes Harvest oh you don't till it again oh I see once it's tilled it's tilled oh so I don't actually want the till thing if I just get rid of that entire line yeah got it okay well I say got it we are just doing flips there cuz there's nothing to Harvest so I think we want to say if we can Harvest then we Harvest and then do all the planting stuff if we don't Harvest then we just do the planting stuff without the rest so if I copy all of that move it down to there make that an else get rid of the do a flip thing at the end this is so long now but look now I think it works oh no why have we got a tree there hang on we got we got bushes we then got carrots they're all planted and then that bottom one why is that not working why is it planting a bush there right so here what are we doing so we're seeing we're not in position one so we go down to there can we have oh where have we gone to that one oh is it cuz it hasn't gone back to the start oh do I just need to move all of this over so I think I got to add the while thing in beforehand so we have a while there we say while that's a zero so the bush planting only happens in the first row so we just move all those over one okay so now it should plant hay there oh yes it works it works it looks pretty complicated but it works so yeah as you can see up here we're actually gaining some some fat carrots so much so we can unlock watering unlock the water command to make them grow faster so 100 carrots that is happened oh no there's like water tanks and everything oh this is going to be so complicated so what else is actually on oh there's quite a lot on here there's there's trees there's sunflowers Cactus as well as dinosaurs all right well whilst that's been a huge success I'm not sure I'm capable of adding to this just the look of this is like terrifying me so if you enjoyed boost like button if you're programmer I can only apologize uh still boost your like button L uh for now I'll say peace love and if not subscribed press subscribe else press like button bye guys
Info
Channel: Real Civil Engineer
Views: 375,376
Rating: undefined out of 5
Keywords: rce, real civil engineer
Id: F5bpI_od1h0
Channel Id: undefined
Length: 24min 17sec (1457 seconds)
Published: Tue Jun 11 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.