A bit late to the party, but the wording is clear:
RAW, Unseen Servant can be used to implement an arbitrary computer or command, even given the most conservative reading of the rules.
However, this is not obvious, and may require some tricks. Your questions might be considered leading questions, and the answers are generally "yes... but not for the reason you may think".
I will go over examples of how a single Unseen Servant can be programmed to be Turing-complete.
The relevant excerpts are as follows:
invisible, mindless, shapeless force that performs simple tasks at your command until the spell ends
People often confuse mindless with unable to process information. Obviously a computer is mindless, but is able to do things like read and process text. A GM may even opt to treat a mindless entity as having an Int/Wis score sometimes (e.g. whether you treat an avatar of an evil witch in a magic mirror, as having an avatar creature with an Int/Wis stat, or forwarding effects to/from the real witch)... not that it's necessarily a good thing to do in general.
Obviously a mindless force cannot understand things. 'Understanding' though is not the same as "processing something" or "effecting action based on something". For example a computer need not understand sound in order to do text-to-speech synthesis. A corollary is that an Unseen Servant itself has no consciousness, sentience, or (in D&D universe) no soul. By definition of 'subjective', it may not make 'subjective' decisions*. (However, an Unseen Servant may theoretically act as a brain for a composite entity thinking entity, whose mind is the code run by the Unseen Servant, and whose brain is the Unseen Servant. See the Chinese Room thought experiment. Mind=software, brain=hardware.)
*(this is actually a bit complicated... one might say that an image recognition task performed by a computer is subjective, when it is in fact just finding the maximal probability. Consequently if one just said something like "Unseen Servant, I mentally command you to indicate 'cat' or 'dog' with this rock based on what my ally Bob the Paladin would hypothetically give the answer as!"... that would certainly be logically sound. However, it would not work for other reasons we'll get to below.)
springs into existence in an unoccupied space on the ground
Once on each of your turns as a bonus action, you can mentally command the servant to move up to 15 feet and interact with an object. The servant can perform simple tasks that a human servant could do, such as fetching things, cleaning, mending, folding clothes, lighting fires, serving food, and pouring wine. Once you give the command, the servant performs the task to the best of its ability until it completes the task, then waits for your next command.
Some important things to note:
- The servant can perform lengthy tasks without having to control it every action; it just needs an initial mental command (which may be done as a bonus action). Proof: all these tasks cannot be done in a single action.
- The servant can perform complicated tasks that might take a minutes-long Youtube video to explain. These examples just illustrate the phrasing "simple tasks a human servant could do". That is the core of the spell. It even goes so far as to list examples that would require multiple different Interact With Object such as:
- possibly different Interact With Object actions like serving wine (into a glass), serving (different types of) food (though this is technically ambiguous but the context clearly implies it is not)
- actions which require complicated tradeskill knowledge like 'mending' e.g. a quilt, and possibly tools
- multiple different Interact With Object actions such as lighting [multiple] fireS (plural).
Thus for all intents and purposes, the servant can be 'loaded' or queued with any "simple task a human servant could do", subject to the constraint that the servant has no free will (is mindless). (Corollary: thus the task may not depend on the mental state of the servant, which doesn't exist... though may potentially depend on the introspection of what the servant is doing and has been doing right now.)
(As a sidenote, one might ponder what mechanism might make an Unseen Servant 'work' behind the scenes. There are quite a few possibilities the GM might come up with, e.g. it pulls from the subconscious of the caster and/or nearby allies; it is pre-programmed and run by an otherworldly CPU; it is a narrativium-style black box, etc.)
Some obvious questions we might ask ourselves:
Can an Unseen Servant read?
- It can certainly recognize letters and symbols, just like it can mend clothes, or pour a cup of water until it is full. It can react to those symbols and act based on those symbols. Because it is mindless, it cannot write out a literary analysis of a text involving any original thought.
- However, does that mean it understands Common? That is, can you give it written orders? See #5.
Does an Unseen Servant have a concept of relative and/or absolute time?
- Can it do things like wait a round, wait until noon, etc.? The answer is probably up to the GM here. It would be very awkward if it could not. The workaround for players would just be to carry around a stopwatch to give to the servant (or set up a sundial). Multiple Unseen Servants could synchronize off one another because they (as Creatures on the map) are a physical process (e.g. Force energy) in the multiverse (unless the GM rules otherwise).
Can an Unseen Servant hear and speak?
- This is not explicitly stated. In fact, the GM might rule that an Unseen Servant cannot react sounds and high-frequency vibrations (though I personally would not). Just because it is described as 'Unseen' and typically does silent labor, does not necessarily mean it is unheard and cannot hear; the nomenclature brings to mind a certain mental imagine that is not necessarily canon. This is a GM decision; it would be weird for it not to be able to hear though.
- If the GM rules the Unseen Servant cannot make sound, one can have it tap rocks on the ground in a pattern.
Can the Unseen Servant 'know' things the player cannot?
- Clearly so, if the player is for example Blinded.
- Being Mindless, the Unseen Servant cannot 'know' things, but can react on things.
- What happens if the player says "If this goblin is actually a polymorphed fae, move this rock."? Can it detect stealthed creatured like an Alarm spell? Can one say "If I say the answer to the sphinx's riddle, move this rock"? The GM should not allow this because it would break the game, but limited versions are possibly for GMs who like certain mechanistic worldbuilding (perhaps Unseen Servants have Perception despite with +0 int modifier... a magical world, the notion of computability may be trumped by Divination...... sidenote: Though, then I believe that would just create an infinite hierarchy of Divinition-magic-aware computability and Divinition-magic-on-Divination-magic-aware-computability etc., see mention of oracles of the Busy Beaver function in this article).
- In any case, it would be strange for the Unseen Servant to have knowledge of how to do things the caster did not. For example, if the caster never knew how to perform mending on a quilt, would the Unseen Servant be able to? Up to the GM.
Can an Unseen Servant process auditory, visual, or mental orders from other entities the caster gives permission to?
- Up to the GM. I would rule no.
- However, if the GM rules 'no', there is a simple workaround of having it implement a simple Turing machine out of rocks. (That is a reason perhaps to rule 'yes'.)
Does the Unseen Servant have access to a method to deal existential instantiation? Can it randomly pick between abstract concepts? Can it randomly pick between physical objects?
Now that we have some basic questions out of the way, we need to analyze a very specific word:
simple tasks that a human servant could do
What's 'simple'? The notion of Kolmogorov complexity implies that simplicity is always relative to your set of pre-understood assumptions (you cannot say "execute plan C" and expect the GM to understand, unless you have previously described what plan C is in normal English (or whatever language you're playing in)). Thus there is a notion of simplicity i.e. if you tell this to the GM, will it bog down the game? As the contrapositive, is it always obvious what the next part of the task is? (What happens if the next part is no longer obvious? Probably the Unseen Servant stops and awaits further orders.) The GM might reasonably rule on various definitions of 'simple', such as GM fiat. I'd personally additionally rule:
- with no more than a low-resolution sketch with at most a few symbols, fewer than a certain number of words, and up to 30 seconds of additional ('psychic') explanation... can the player explain a task unambiguously? without bogging down the game to prep this?
If yes, then I'd say it works, subject to all the above restrictions and caveats. That would mean for example you could describe an incredibly simple Turing machine, or something effectively almost as good and even simpler. For example:
"I psychically command this Unseen Servant to whenever these pebbles are in any of the formations on this piece of paper in relation to its (metaphorical) hand, to rearrange them and move its unseen hand 1 inch to the right or left as shown."
One might use this with a reasonably large program consisting of pages and pages (assuming it is near instantaneous for the GM to implement or they are okay with ruling that it just works), but for a reasonably compact Turing machine like the one above, that one can conceptualize and explain simply, you might not even need the paper.
Of course, then one might perhaps make the technomage roll to try to reinvent computer science, with a very high DC... it might take a while to figure out, akin to trying to invent a powerful homebrew spell, to... rederive fundamental mathematics de novo. Or maybe the GM is fine with clever players helping their Barbarians with combat tactics. I'm in the latter camp, but at some point one may need to invoke the "trying to rederive mathematics" check.
Anyway, actually compiling into this pebble-based Unseen Servant language and extracting output from it would require... an infrastructure of a lot of Unseen Servants, and/or a lot of time manipulation and/or miniaturization. For practical purposes, here are how I'd answer OP's original questions:
Can an Unseen Servant fulfill conditional tasks? (ex : "pour wine into each empty glass" - in other words, if the glass if already filled, don't pour wine in it, else do it)
Yes (conditions happen all the time in simple tasks). This only works because the task is simple. If one tried to write 50 nested conditions, it would no longer be simple, and no longer work.
Can it fulfill sequential tasks? (ex: "pour wine into my glass, then bring it to me")
Yes, because it is a simple task. If one tried to write a sequence of 50 things, it would no longer be simple, and no longer work.
Can it fulfill looping tasks? (ex: "Pour wine into my glass every minute for 20 minutes")
In general yes, because a loop is simple. However, due to the way this was phrased, it is up to the GM, because Unseen Servants do not necessarily have internal clocks (but probably do; the workaround is trivial).
If it can do all three separately, can it do them all together? (ex: "Every minute for 20 minutes, for each empty glass, if it's empty, pour wine into it then bring it to their respective owner, else don't touch it")
In general yes, but if this was very complicated, no, because it must once again be a "simple task" a human servant could do.
Can an Unseen Servant be fed a series of instructions via text (ex: "do what is written on this paper") or speech (ex: "do what any of my Magic Mouths will tell you to do when one starts giving orders" - so if you have several Magic Mouths, the trigger of the second Magic Mouth's speech might be something caused by one of the first Magic Mouth's instructions to the Unseen Servant... which essentially results in something like a function call in programming)? For this to work, the Unseen Servant must either have sight+reading abilities, or hearing+language abilities. The spell specifies you give telepathic commands to the Servant, but does not say if textual/verbal commands from your own voice work as well. The closest thing is a comparison to a human servant, so it might or might not work out.
Up to the GM. If the GM rules no (one might reasonably rule that the the Unseen Servant has no understanding of symbols on a page other than the fact that they are symbols in certain recognizable patterns, in which case the only way to react to them is the meaning your character has; alternatively one might rule that it can understand Common just like a human servant), it still possible to have the Unseen Servant notice the fact that the Magic Mouth is talking. In this manner, the "triggering condition" verbiage of the Magic Mouth spell may be used as input to the task of an Unseen Servant.
I'd rule that an Unseen Servant can read lips, but because scientific papers in real life have noticed that even experienced lip-readers are only semi-accurate, this is an inference task, and thus in rare circumstances may suffer from existential instantiation if say there is a tie and the priors are underspecified. Unless the GM allows a compendium of illustrations of mouths and rules for resolving ambiguity (which might... make the task take hours...), one might have to implement one's own lip-reading algorithm by compiling down the the Unseen-Servant-manipulating-pebbles programming language described earlier.
Can an Unseen Servant wait for a given time interval before doing a task step ? (how it would work out : as it takes a turn (6 seconds) for an Unseen Servant to move 15 feet, it therefore takes it 1 second to move 2.5 feet, so if you tell an Unseen Servant to move in circles for 2.5X feet before doing a step, then you essentially delay the step by X seconds)
Up to the GM, but since it's reasonable and the workaround (burning piece of cord) is easy, I'd allow it.
Even with a conservative interpretation of the rules, one may have perhaps three Unseen Servants implementing the above Turing machine (or some other Turing machine). Thus, theoretically, a general purpose computer may be made with Unseen Servants... but it would of course be really slow. Anything in combat-time will likely be at the dictates of the GM.