Automated Stranded Bot

My friend wanted this again, so here it is: It’s a Stranded bot that I made back in May when Stranded had outlasted its fun for me. Now I’m not so much releasing this so you can cheat on Stranded (cheating only makes Stranded even less fun), but as something you can play with and possibly give you inspiration to make on your own. Making it was really fun, especially when you’re on a server and everyone is in on it. This bot:

[ul]
[li]Knows to get a drink when it needs to[/li][li]Knows when to get something to eat when it needs to[/li][li]Knows to plant fruit trees when needed (in a very orderly garden)[/li][li]Knows to forage for seeds to plant fruit trees with[/li][li]Knows to sleep when it needs to[/li][li]Knows to mine when it is idle[/li][li]Knows to drop off things from the bot’s inventory into a designated area when it’s getting full[/li][/ul]

That aside, it’s not a genius. The biggest issue is that there is no pathfinding, so you need to plant yourself in a reasonable accessible location. Consequently, you have to choose locations for each task (eat, drink, etc.).

I remember one time I had left the bot running and came back later to see that a crowd had gathered around me. They were discussing among themselves whether I was really a human or a bot because my farm was always so orderly and straight. I also performed the tasks with such mechanized motion too. It was really funny and I was a bit surprised that they considered that I was actually real.

I also thank Solaris as he didn’t have a problem with me developing it while he was online, though Script Enforcer came on a few weeks later. I actually leveled up ~25 levels with the bot (though I was already a fairly high level by manual means) in 2 days, but he doesn’t know that. :stuck_out_tongue:

The code is a mess as it was just a big experiment. Find the file here:
http://github.com/sk89q/gmod/blob/master/hiertask/autostranded.lua

[ol][li]Drop autostranded.lua into your lua/ folder.[/li][li]In your console, run lua_openscript_cl autostranded.lua[/li][li]Run as_stop[/li][li]Look at appropriate places and do as_set placename where “placename” is water, forage, sleep, dropoff, mine, or plant. You need to set these positions for the bot to use them.[/li][li]Run as_start[/ol][/li]
I also did work on a more organized version that let you (the programmer) assign tasks with priority. It even drew a prioritized task tree on your HUD so you knew exactly what your bot was “thinking.” Tasks are arranged in a hierarchy so tasks can depend on subtasks, but subtasks can always raise an exception to stop/control its parent task. I never finished it, but you can find it here:
http://github.com/sk89q/gmod/tree/master/hiertask/
hiertask.lua is a module.

That’s really impressive! I see great things in your future.

Simple but nice. I don’t thing many people here know lua, so, your instructions are a little obsolete. its as_start and as_stop for anyone wondering how to start and stop it.

Continue, please!
StrandedBot - survive like the hopeless survivor you are!

question… for your more complex one, where does that all go. where does the folder go? in autorun?

The complex one doesn’t really work yet. I didn’t finish it. The coordinates in the file are hardcoded for flatgrass; the bot will walk to a certain spot and start jumping or something. It’s something you can build upon though.

nice! i dont know lua D::::::::::

This sound nice,

you should make a little video to see how it’s working. That would be lovely :slight_smile:

Ill really quickly record one… i got it working kinda well… mabeh tomorrow though cause i have to deal with my step brother and sister coming over this weekend. Im gonna lock myself in my room in a few hours with my TV, my computer, and my dick for jacking. Oh and a 24 pack of pepsi. Ill record after do the 3rd thing i listed.

[editline]15th October 2010[/editline]

just use as_set “forage,mine,plant” and aim where u want him to do those things, then use as_start and stop to… well, what do you thing -_^

[editline]15th October 2010[/editline]

LOL A COMPLEX JUMPBOT XD Ah… this was coded while u were bord as fuck of stranded and decided to stop in-between?

Well, after I finished my the original version, I realized that it had become a total mess so I started writing the new version. The problem with the original is that it could only have one primary task (either forage or mine), and I wanted other tasks like fishing and such and the ability to switch between them easily. However, by the time I started rewriting it all, I totally stopped caring.

How the hell do you install it?

“lua/autorun/client” I believe.
BTW sk89q, you’ve inspired me to make my own simple bot. Nice work.

[ol]
[li]Drop autostranded.lua into your lua folder.[/li][li]In console: lua_openscript_cl autostranded.lua[/li][li]Since the bot just starts going right away, as_stop in console[/li][li]Look at the respective places and do as_set drink, as_set mine (check the code for a list)[/li][li]as_start[/li][/ol]

Have fun!

Impressive! I will check this out tomorrow

Can’t you just put it in autorun\client? So I Don’t have to type that in console? Or…

…you don’t want it running every game you enter.

I know.
But anyway, can you make plants plant infront of you? Not directly below? I keep getting stuck in my melons.

Oh my god, its fucking amazing! Gonna test it now! >:D

Well I’m not working on it anymore. That’s where you come in :stuck_out_tongue:

Oh…