text:
No one, please!
I absolutely hate the digit 1. So, I need your help to convert numbers to their "proper forms".
Numbers in proper form never have two 1s in a row. 101 is okay, but 110 is hideous.
To convert, simply skip all the improper numbers and count normally. For instance...
1 -> 1
2 -> 2
...
10 -> 10
11 -> 12
12 -> 13
...
108 -> 109
109 -> 120
110 -> 121
111 -> 122

and so on.
Your program should take an integer and output it in proper form. This is code-golf, so shortest code in bytes wins.

Related.

Is there an upper bound on input?

I don't get the 109 -> 120 conversion...

@kirbyfan64sos Since 108 maps to 109, 109 would map to the next number, which is 110. But that one has two 1s in a row, so it goes to the next number until it reaches one that does not. Which is 120, since all of 110-119 are excluded.

@RetoKoradi Ah! Thanks!

So, wait... two 1s in a row is bad but four 1s in a row is ok? 120 = 1111000

@Corey Ogburn It's not about binairy. See it as how a list of numbers would be when you count up to the given number with the no-11 rule for each number in the list

OOH! I followed @MartinBüttner Related link and made a stupid assumption.

Why does 1 return 1, 2 return 2 and 10 return 10 BUT 12 return 13 and 108 return 109?

@leymannx The number on the left represents the number in the series.  So the first value in the series is 1, the second value in the series is 2, yadda yadda(lobster bisque), the tenth value in the series is 10, and the eleventh value in the series is 12, because we skipped 11 as talex finds it an abomination unto the lord.  This idea continues on, hence why the 108th value in the series is 109, and the 110th value in the series is 120, as we skip everything from 110 to 119.  Hope I clarified well enough.

Burlesque, 10 bytes
{11~[n!}FO
Older versions:
ro{11~[n!}f[

ro{Sh"11"~=n!}f[

Please add a link the the language :)

done. It's been around since 2012, there's also an article on RosettaCode and the esowiki as well.

Bash + GNU utils, 36
seq $1$1|grep -v 11|sed -n "$1{p;q}"

Try it Online

Surely 1$1 suffices, rather than $1$1?

Jelly, 8 bytes
1w11¬$#Ṫ

Try it online!
Almost entirely printable ASCII! Takes input from STDIN
How it works
1w11¬$#Ṫ - Main link. No arguments
     $   - Group the previous 2 links into a monad f(k):
  11     -   Yield 11
 w       -   Yield 1 if 11 is a sublist of k's digit else 0
    ¬    -   Map 1 to 0 and 0 to 1
1     #  - Count up k = 1, 2, 3, ... until n integers return true under f(k)
       Ṫ - Return the last k

Jelly, 8 bytes
²wÐḟ11ị@

Try it online!
An alternate approach, still only 8 bytes though. Relies on the assumption that the output is always less than the square of the input
How it works
²wÐḟ11ị@ - Main link. Takes n on the left
²        - n²
  Ðḟ     - Filter-false the range [1, 2, ..., n²] on:
    11   -   11
 w       -   Is a sublist of the digits
      ị@ - Take the n'th value in this list

The assumption in your second answer is not correct, see A322054. f(A322054(n)) = 10^n and f(A322054(n))/10^n converges to 0.

@ovs How about $n^2$ as an upper bound? Also, yep, I'm an idiot, fixed

$n^2$ seems to work. FYI your original assumption would have failed at around $12\cdot10^{73}$.

JavaScript, 53 bytes
n=>[...Array(n*2).keys()].filter(a=>!/11/.test(a))[n]

Alternate (using comprehensions, same length):
n=>[for(i of Array(n*2).keys())if(!/11/.test(i))i][n]

Nice to see, but overkill for this task. http://codegolf.stackexchange.com/a/61594/21348

Actually, @edc65, the answer you tagged is invalid since 108 returns 119 on that one, so this is only JavaScript one that works right now.

@Samathingamajig It's still overkill now that the author of that answer corrected it.

The second solution in this post doesn't work now because array comprehensions have be stricken from the ecmascript standard and modern browsers

@Samathingamajig Languages are defined by their implementation, not their specification, and answers aren't required to use the latest version of their language, so this is still valid.

@pppery, quote from @ Doorknob (from that post): "If your answer relies on interpreter-/compiler-specific behavior, yes, you need to specify which interpreters/compilers your answer will work on. ..."  So this post needs to be edited to make clear what interpreter works for the second solution, as it doesn't work in any modern one that I know of.

Quoting from the site you linked to, "Historically supported in Firefox 30 till 58."

Perl 5, 34 Bytes
Looping a counter and changing the occasional double-one.
map{$i++;$i=~s/11/12/}1..pop;say$i

Test
$ perl -M5.012 -e 'map{$i++;$i=~s/11/12/}1..pop;say$i' 111
$ 122

Python 2, 50
lambda n:[i for i in range(n*2)if'11'not in`i`][n]

An anonymous function that lists the numbers not containing 11 in order, and takes the nth one. The off-by-one error of zero-indexing cancels with the inclusion of 0 in the list.
In theory, this will fail for sufficiently high numbers where f(n)>2*n, but this shouldn't happen until n is at least 10**50.

51 bytes:
n=input();i=0
while n:i+=1;n-='11'not in`i`
print i

Counts up numbers i until the quota of n numbers without 11 is met.
A function is the same length because of the off-by-one corrections needed.
f=lambda n,i=0:n+1and f(n-('11'not in`i`),i+1)or~-i

Pyth, 13 11 bytes
e.f!}`hT`ZQ

Saved 2 bytes thanks to @FryAmTheEggman.
Live demo and test cases.
13-byte version
e.f!}"11"+ZkQ

Context: Pyth, Pyth, and Pyth.

@PeterMortensen The third one is unrelated to the Pyth used here - it's from 8 years before this Pyth was created, actually. Pyth is just a popular name for Python inspired languages.

Python 3 74
Still need a bit of golfing.
n=int(input())
c=0
for x in ' '*n:
 c+=1
 while'11'in str(c):c+=1
print(c)

It's pretty brute force right now.

JavaScript (ES6) 43 bytes
As an anonymous function
n=>eval('for(i=0;/11/.test(i)||n--;i++);i')

Note: the very simplest way would be 44:
n=>{for(i=0;/11/.test(i)||n--;i++);return i}

Test running the snippet below.

f=n=>eval('for(i=0;/11/.test(i)||n--;i++);i')

var o='',v=0,r,c;
for(r=0;r<30;r++)
{
  o += '
';
  for(c=0;c<10;c++)
  {

    o += '' +v + '⇨' + f(v) + '	';
    v++;
  }
  o += '
'

}
O.innerHTML=o

This fails for entering 108, it returns 119

@Samathingamajig you're right, I stand corrected after 5 years, better late than never. Should work now

41 n=>eval('for(i=0;/11/.test(i)||n--;)++i'), not supporting 0

Haskell, 51 bytes
([x|x<-[0..],notElem('1','1')$zip=<<tail$show x]!!)

Usage example: ([x|x<-[0..],notElem('1','1')$zip=<<tail$show x]!!) 110 -> 121.
How it works:
[x|x<-[0..]                                   ]    -- take all x starting with 0
           ,                                       -- where
                   ('1','1')                       -- the pair of two chars '1'
            notElem                                -- is not part of
                             zip=<<tail            -- the list of pairs of neighbor elements of
                                        show x     -- the string representation of x
                                               !!  -- take nth element, where n is the parameter

MUMPS, 37 bytes
t(i) f j=1:1 s:j'[11 k=k+1 q:k=i
    q j

Pretty straightforward. The only "interesting" thing here is the construct j'[11 - '[ is the "does not contain" operator, so that "abc"'["ab" is false and "abc"'["cd" is true. Despite both operands of j'[11 being numbers, MUMPS remains unperturbed. It will happily autocoerce both operands to strings and move on with its life. Hooray!
(Incidentally, if you're okay with the program never terminating, we can shorten this to 35 bytes: t2(i) f j=1:1 s:j'[11 k=k+1 w:k=i j)

Brachylog, 15 bytes
∧{ℕ₁≜¬s11&}ᶠ↖?t

Try it online!
∧{ℕ₁≜¬s11&}ᶠ↖?t
∧{ …      }ᶠ↖?t get the N'th output from …
  ℕ₁≜             try a number, starting with 1
     ¬s11         doesn't contain 11
         &        output that number

05AB1E (legacy), 7 6 bytes
µN11å≠

-1 byte switching to the legacy version of 05AB1E, where the index is output implicitly after a while-loop µ. In the new 05AB1E version we have to push the N explicitly, and it'll output the top of the stack after the while-loop instead (so the N would be NN or ND).
Try it online or verify all test cases.
Explanation:
µ       # Loop until the counter_variable is equal to the (implicit) input-integer:
        # (the counter_variable is 0 by default)
 N11å   #  Check if the 0-based loop-index `N` contains 11 as substring
     ≠  #  Invert this boolean (1→0; 0→1)
        #  (implicitly pop the top of the stack, and increase the counter_variable by
        #  1 if it's truthy)
        # (after which the index `N` is output implicitly as result)

05AB1E's µ is like a much better version of Jelly's # :/

@cairdcoinheringaahing Yeah, it's pretty useful for challenges like this. Especially that it by default increases the counter_variable at the end of every iteration if the top is truthy.

GolfScript, 29 24 18 bytes
~0\{{).`11`?)}do}*

Try it online!
This is my first code golf, so this is probably the least effecient way of doing things
-5 bytes by not being dumb and using the increment symbol as well as just keeping the input on the stack and decrementing instead of wasting space saving it as a variable and comparing it, probably more things I could save on
-6 bytes the loop is fixed size and I don't need the input after the loop so I can just use repeat

Perl 5, 47 bytes
@_[$_]=++$i!~/11/?$i:redo for 1..<>;print$_[-1]

PHP, 43 bytes
while(preg_match('/11/',$i)){$i++;}print$i;

Julia 1.0, 44 42 bytes
x->(r=1:9x)[.!occursin.("11",repr.(r))][x]

Try it online!

Perl 5 -p, 25 bytes
$\++while$\=~/11/||$_--}{

Try it online!

Japt, 9 8 bytes
È¥srB}iU

Try it

Husk, 11 10 bytes
Edit: -1 byte thanks to Razetime
!fö¬€ḋ3QdN

Try it online!
Finds index of input among natural numbers filtered to exclude those with digit-sublists that include [1,1].

-1

Very clever!  Thanks!

Raku, 24 bytes
{grep(?1^/11/,^∞)[$_]}

Try it online!
grep(..., ^∞) filters the numbers from zero to infinity according to the given test object, and [$_] indexes into that sequence with the function argument, returning the number at that index.
/11/ matches any number whose decimal representation contains two consecutive one digits.  The sense of the match can be inverted by writing True ^ /11/, where ^ creates an exclusive-or junction matcher that succeeds only if exactly one of its operands succeeds.  True will always succeed, so the overall junction can only succeed if the /11/ fails.  Finally, True can be expressed more concisely as ?1, that is, 1 coerced to a Boolean.
none(/11/) also works as a matcher, but is longer.

AWK, 33 bytes
{for(;$1;)$1-=!index(++b,11)}$0=b

Try it online!
It works by running a loop that increments a counter blindly each iteration, but only decrements the control variable if the blind counter does NOT include the string 11. Once the loop exits, the blind counter is printed as the answer.
 {                            }     - code block run for each input line
  for(;$1;)                         - loop until $1 is 0
           $1-=!index(   ,11)       - decrement $1 if "b" doesn't include "11"
                      ++b           - blindly increment a counter
                               $0=b - set $0 to blind count, prints automatically

Python 3, 64 bytes
[print(e) for e in map(str,range(int(input())+1))if not'11'in e]

Try it online!

Java (JDK), 76 bytes
p->{int c=1,s=0;while((c+s+"").indexOf("11")>=0&&++s>0||c++
 1,048,576

you don't actually need the "s in Find()

Pip, 11 bytes
LaW11N Ui_i

Attempt This Online!
Explanation
             i is 0; a is first command-line argument (implicit)
La           Loop (a) times:
  W           Loop while
   11N        11 is a substring of
       Ui     i, incremented:
         _     No-op
          i  Once the loop completes, output i


text:
Primes numbers with prime index
Write a program or function that outputs/returns the first 10000 prime-indexed prime numbers.
If we call the nth prime p(n), this list is
3, 5, 11, 17, 31, 41, 59 ... 1366661

because
p(p(1)) = p(2) = 3
p(p(2)) = p(3) = 5
p(p(3)) = p(5) = 11
p(p(4)) = p(7) = 17
...
p(p(10000)) = p(104729) = 1366661

Standard loopholes are forbidden, and standard output methods are allowed. You may answer with a full program, a named function, or an anonymous function.

You should generally try to post challenges in the sandbox first (see the link on the right side) in order to work out the issues.

Optimizing for runtime is not what we do in a code-golf challenge; the shortest program always wins.

Primes with prime subscripts: A006450.

@bilbo Answers for code golf are usually accepted after a week, and should be accepted as the shortest successful code. If you wanted code speed, there is a tag for that. See this page about the tag code-golf.

The answer you accepted isn't even the fastest. My Matlab/Octave answer runs in 0.16 seconds, and I'd imagine the (winning by size) J answer by @ZGarb has a similar runtime.

So weird I just did this the other day for a different reason in excel haha, small world of tasks

@ThomasKwa: I was surprised by seeing my answer as accepted one too. Maybe that decision can be undone? I would prefer that! And when it comes to speed, please distinguish solutions calculating the primes themself and the ones depending on preexisting prime functions or tables. I  think, this challenge should be reworked/reworded and/or split into different variants with different rules or whatever it takes to clearness and fairness...

I'm new here and in my opinion, I thought the solutions execution time must be taken in consideration in shorten contests. I have attended more solutions in conventional languages. Perhaps can I add a tag related to speed but there is only fastest-algorithm and fastest-code and I attended also a shorten solution. Is it possible to remove the accepted flag for more time to the contest?

@bilbo It's considered bad practice to change the winning criterion of the contest after answers have already been posted. If you want to create a new contest scored by something other than [tag:code-golf] (shortest code), post it in the Sandbox first. (In its current form, in my opinion, this challenge wouldn't be a good fit for fastest-code or fastest-algorithm, so you'd need to change something else about it too.)

All contests need an objective winning criterion; they are off topic otherwise. If you're going to judge answers by size and speed, you need to disclose a way to combine both. This should be done when the contest is posted, not 14 hours and 10 answers later. I have undone all speed-related edits, since the only other option would be to close this post for being off topic.

Now we need to do this recursively, so we can see which number is prime indexed the longest.

MATLAB/Octave, 25 bytes
p=primes(2e6)
p(p(1:1e4))

It doesn't get much more straightforward than this.

Python, 72 bytes
P=p=1;l=[]
while p<82e5/6:l+=P%p*[p];P*=p*p;p+=1
for x in l:print l[x-1]

This terminates with a "list index out of range error" after printing the 10000 numbers, which is allowed by default.
Uses the Wilson's Theorem method to generate a list l of the primes up to the 10000th prime. Then, prints the primes with the positions in the list, shifted by 1 for zero-indexing, until we run out of bounds after the 10000th prime-th prime.
Conveniently, the upper bound of 1366661 can be estimated as 82e5/6 which is 1366666.6666666667, saving a char.
I'd like a single-loop method, printing prime-indexed primes as we add them, but it seems to be longer.
P=p=1;l=[]
while p<104730:
 l+=P%p*[p]
 if len(l)in P%p*l:print p
 P*=p*p;p+=1

This is way better than the garbage I was writing. +1

This only prints 1229 numbers

@aditsu I think I see my mistake. Are you able to run this code with the bigger bound?

It will probably take a long time :p

I think it finished ＼（＠；◇；＠）／ , it seems correct

J, 11 bytes
p:<:p:i.1e4

Outputs the primes in the format
3 5 11 17 31 41 59 67 83 109 127 ...

Explanation
        1e4  Fancy name for 10000
      i.     Integers from 0 to 9999
    p:       Index into primes: this gives 2 3 5 7 11 ...
  <:         Decrement each prime (J arrays are 0-based)
p:           Index into primes again

Haskell, 65 bytes
p=[x|x<-[2..],all((>0).mod x)[2..x-1]]
f=take 10000$map((0:p)!!)p

Outputs: [3,5,11,17,31,41,59,67,83,109,127.....<five hours later>...,1366661]
Not very fast. How it works: p is the infinite list of primes (naively checking all mod x ys for y in [2..x-1]) . Take the first 10000 elements of the list you get when 0:p!! (get nth element of p) is mapped on p. I have to adjust the list of primes where I take the elements from by prepending one number (-> 0:), because the index function (!!) is zero based.

Mathematica, 26 25 23 bytes
Prime@Prime@Range@1*^4&

Pure function returning the list.

Prime is Listable so a simple Prime@Prime@Range@1*^4& will do

I know the feeling ... In any case, I think this is the prettiest Mathematica solution I have seen on here!

Let me guess, the @ operator has higher precedence than ^ when writing Range@10^4? That's classic Mathematica messing up your game of golf. Good trick!

AWK - 129 bytes
...oookay... too long to win points for compactness... but maybe it can gain some honor for the speed?
The x file:
BEGIN{n=2;i=0;while(n<1366662){if(n in L){p=L[n];del L[n]}else{P[p=n]=++i;if(i in P)print n}j=n+p;while(j in L)j=j+p;L[j]=p;n++}}

Running:
$ awk -f x | nl | tail
  9991  1365913
  9992  1365983
  9993  1366019
  9994  1366187
  9995  1366327
  9996  1366433
  9997  1366483
  9998  1366531
  9999  1366609
 10000  1366661

Readable:
BEGIN {
        n=2
        i=0
        while( n<1366662 ) {
                if( n in L ) {
                        p=L[n]
                        del L[n]
                } else {
                        P[p=n]=++i
                        if( i in P ) print n
                }
                j=n+p
                while( j in L ) j=j+p
                L[j]=p
                n++
        }
}

The program computes a stream of primes using L as "tape of numbers" holding found primes jumping around on L to flag the nearby numbers already known to have a divisor. These jumping primes will advance while the "tape of numbers" L is chopped off number by number from its beginning.
While chopping off the tape head L[n] being empty means there is no known (prime) divisor.
L[n] holding a value means, this value is a prime and known to divide n.
So either we have found a prime divisor or a new prime.
Then ths prime will be advanced to the next L[n+m*p] on the tape found being empty.
This is like the Sieve of Eratosthenes "pulled thru a Klein's bottle". You always act on the tape start. Instead of firing multiples of primes thru the tape, you use the primes being found already as cursors jumping away from the tape start by multiple distances of their own value until a free position is found.
While the outer loop generates one prime or not prime decission per loop, the primes found get counted and stored in P as key, the value of this (key,value) pair is not relevant for the program flow.
If their key i happens to be in P already (i in P), we have a prime of the p(p(i)) breed.
Running:
$ time awk -f x.awk | wc -l
10000

real    0m3.675s
user    0m3.612s
sys     0m0.052s

Take into account that this code does not use external precalculated prime tables.
Time taken on my good old Thinkpad T60, so I think it deserves to be called fast.
Tested with mawk and gawk on Debian8/AMD64

good 129 bytes in gawk: now with Debian10/AMD64 on my corei7-i870@3.6Ghz:
real 0m2,417s
user 0m2,205s
sys 0m0,042s

you can save one byte with: BEGIN{n=2;i=0;while(n<1366662){if(n in L){p=L[n];del L[n]}else{P[p=n]=++i;if(i in P)print n}j=n+p;while(j in L)j+=p;L[j]=p;n++}}

PARI/GP, 25 bytes
apply(prime,primes(10^4))

CJam, 19
3D#{mp},_1e4<:(\f=p

You can try it online, but you'll need a little patience :p
For the record, the last number is 1366661.

Husk, 11 10 bytes
(or 6 5 bytes to list the first 10,000 prime-indexed prime numbers, followed by [the infinite number of] all the rest of them)
Thanks to user and Razetime for suggesting the 6 5-byte version!
↑!4İ⁰Ṡm!İp

Try it online! (unfortunately times-out on TIO before printing all 10,000 prime-indexed primes, but at least outputs what it's found so far...)
↑!4İ⁰Ṡm!İp
↑               # print the first
 !4             # 4th index of
   İ⁰           # powers of 10 (so, the first 10,000), of
     Ṡ          # hook: apply function to its own argument
      m!        # map index function to
        İp      # prime numbers
                # (implied by hook) to prime numbers

Nice answer. The 10000 primes restriction is a shame - too many bytes are wasted on that.

If you output an infinite list, it will still have the first 10000 items ;)

@user & Razetime - thanks for the suggestion from both of you - I've incorporated it (& credited you both)!

It didn't actually occur to me to print an infinite list - that's all Razetime, but thanks anyway.

Perl, 55 bytes
use ntheory':all';forprimes{print nth_prime$_,$/}104729

Uses @DanaJ's Math::Prime::Util module for perl (loaded with the pragma ntheory). Get it with:
cpan install Math::Prime::Util
cpan install Math::Prime::Util::GMP

Python 3, 76 109 bytes - disqualified -  requalified?
edit: I am sorry, I was going for primes but missed the putting, didn´t reach the goal of "primes with primeindex". Your are free to grab and enhance. I'll be glad to be learning from you.
Based on Wilson Theorem
def p(x):
 c=n=2
 for i in range(3,x):
  c*=i-1
  if c%i!=0:
   print(n,i)
   n+=1

without index, 62 bytes
def p(x):
 c=2
 for i in range(3,x):
  c*=i-1
  if c%i!=0:print(i)

Anyone can give me an example or good link, how to make a lambda function from it?
edit: just to have it done right: 109bytes
def p(x):
 c=n=2
 p=[2]
 for i in range(2,x):
  c*=i-1
  if c%i!=0:
   p.append(i)
   if n in p: print(p[-1])
   n+=1

I think you've misunderstood the question.  Your functions seem to output all prime numbers (and the first one precedes them with an index).  The question defines 'prime-indexed prime numbers' as those in the list of all primes that have an index value that is also a prime.  For instance, 7 - the 4th prime - isn't prime-indexed because 4 isn't a prime...

I am sorry. You are right, I misunderstood it :( Thank you very much for spending your time on clearing this up for me!

Japt, 11 bytes
Èj ©°Tj}jL²

Test it

Vyxal H, 8 7 6 5 bytes
Saved 1 + 1 bytes thanks to Aaron Miller
²ʀǎ‹ǎ

Try it Online!
H flag - Push 100 to the stack
²ʀǎƛ‹ǎ
²        Squared (10,000)
 ʀ       Range [0, 10,000)
  ǎ      Map each a in that range to the ath prime
   ‹     Decrement each, because the challenge uses 1-indexing
    ǎ    Get the nth prime for each of those

7 bytes

@AaronMiller Thanks, forgot about auto-closing!

I completely forgot about the H tag, which presets the stack to 100, allowing for 5 bytes

05AB1E, 7 bytes (non-competing)
Code:
4°L<Ø<Ø

Try it online!, note that I have changed the 4 into a 2. If you have a lot of time, you can change the 2 back to 4, but this will take a lot of time. I need to fasten the algorithm for this.
Explanation:
4°       # Push 10000 (10 ^ 4)
  L      # Create the list [1 ... 10000]
   <     # Decrement on every element, [0 ... 9999]
    Ø    # Compute the nth prime
     <   # Decrement on every element
      Ø  # Compute the nth prime

05AB1E, 6 bytes
тnp<Ø

Try it online!
     Ø  # prime numbers with...
    <   # 1-based...
     Ø  # indices in...
  Åp    # first...
т       # 100...
 n      # ^ 2...
  Åp    # primes
        # implicit output

Jelly, 6 bytes
ȷ4RÆN⁺

Try it online!
Obviously, this times out on TIO. Here is a version that prints as it goes, which reaches \$57493\$ (the \$765\$th term) before timing out
How it works
ȷ4RÆN⁺ - Main link. Takes no arguments
ȷ4     - 10000
  R    - [1, 2, 3, ..., 9999, 10000]
     ⁺ - Do twice:
   ÆN  -   n'th prime of each

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Coin Tossing Time Travelers
In the future when Time Travel (abbreviated as TT) will be common, coin tossing will become a serious mind-sport. To prepare for the future we create a competition for programs where time traveling will be really happening from the viewpoints of the entries.
The competition is a round-robin style King of the Hill consisting of coin tossing matches between Java classes.
Rules of the coin tossing match

There are two players and 100 rounds.
In every round a coin is tossed and based on the result one of the players scores 1 point. Each player has 50% chance to score a point.
After the tossing both players have a chance to control the time by pulling levers.
If you pull a blue lever (revert stopper) no TT is possible to the round the lever was used or any earlier round anymore. TT's attempting to go to these rounds will have no effect.
If you pull a red lever (reverter) you try to revert the time back to a former round. If succeeded the opponent's memory will be reverted to its memory before the chosen round and the coin toss results starting from the chosen round will also be deleted. The only possible sign for your opponent about the TT will be the number of its unused levers which will not be reverted back.
Each player has 5 blue and 20 red unused levers at the start of the match. These levers are not affected by TT's.
If no TT happens at the end of a 100th round the game ends and the player with the higher score wins.

Details

Rounds have a 1-based indexing (form 1 to 100).
Before round x you are provided the number of available blue and red levers, the coin toss results until turn x (inclusive) and the memory of your (last) x-1th round.
Pulling a blue lever in round x stops any TT's that have a destination at round x or before (it blocks a TT if it happens on that same exact round too).
Reverting to round x means that the next round will be round x.
If both players choose to revert at the end of a round the time is reverted to the earlier destination which is not blocked. The player(s) who tried to revert to this time will keep their memory.

Technical details

You should write a Java class implementing the provided Bot interface.
Add your bot to the project.
Add an instance of your Bot to the Bot in the file Controller.java.
Your class should not keep information between calls. (In most cases having only final variables outside of functions satisfies this requirement.)
You can give information to the controller in the memory field of your returned Action object. This will be given back to you in the next turn if no TT happened. If a TT happens, you will receive the corresponding earlier memory of yours.
You can use the totalScore() method of the Game class to get the score of a history string.

Protocol

At every turn your takeTurn(...) method is called with 5 arguments:

the number of unused blue levers
the number of unused red levers
the coin tossing history, a string consisting of 1's and 0's marking your wins and losses in the previous rounds. The first character corresponds to the first coin tossing. (In the first round the length of the string will be 1.)
a string, your stored memory from the previous round
the 1-based index of this round

At every turn your method returns an Action object containing

an integer in the move field describing your action:

0 for no action
-1 to pull a blue lever and block TT's going through this round
a positive integer x, not larger than the current round, to pull a red lever and try to revert back to round x
Invalid integers are treated as 0.

a string containing your memory from this round which you want to preserve. Note that storing memory is not a crucial part of the challenge. You can make good entries without storing any useful data in the string. At the first round the string will be an empty string.

Your method should take no more time than 10 ms per round on average in a match.
Regularly failing the time-limit results in disqualification.

Scoring

Winning a match earns 2 points and a draw earns 1 point for both players. Loss earns no points.
A bot's score will be the total number of points it collected.
The number of matches played between each pair of contestants will depend on the number of entries and their speed.

Two simple example bots are posted as answers.
The controller and the first couple Bots are available here.
Test results with bots submitted until November 3.:
Total Scores:
Oldschool: 3163
Random: 5871
RegretBot: 5269
Nostalgia: 8601
Little Ten: 8772
Analyzer: 17746
NoRegretsBot: 5833
Oracle: 15539
Deja Vu: 5491
Bad Loser: 13715

(The controller is based on the Cat catcher challenge's controller. Thanks for @flawr providing it as a base for this one.)
Bonus: a nice 6-minute film based on a similar concept.

I don't understand what this rule means. If you pull a blue lever (revert stopper) no TT is possible through that round anymore. TT's attempting to go through the round will have no effect. What is "going through a round"?

@feersum If I understand correctly, pulling the blue lever permanently "locks in" the current round (and thus all previous rounds) so that the results cannot be modified by time travel.  If anyone attempts to TT to a time earlier than when you pulled the blue lever, they will be unable to.

@feersum @PhiNotPi is right, is this version clearer? If you pull a blue lever (revert stopper) no TT is possible to the round the lever was used or any earlier round anymore. TT's attempting to go to these rounds will have no effect.

When you pull the red lever, can you choose the same round you're currently on to redo the coin toss for that round?

@TheNumberOne Yes, that is what the Random example bot does.

I feel like this probably has an optimal statistical solution. But, it doesn't seem obvious what that is.

Is it allowed to calculate something (like a lookup table) before the game starts, and then use it during the game? What are the space/time limits?

Analyzer
This analyzes the past to make the best predictions for the future.
EDIT: Avoids blue levered times. Uses blue levers effectively. Uses red levers more effectively. Added scariness for Halloween season.
EDIT: Fixed off by 1 error.
EDIT: Improved computeWinningProbability function. Now uses red levers and blue lever more aggressively.
//Boo!
package bots;

import main.Action;
import main.Game;

import java.util.*;
import java.util.stream.Collectors;

/**
 * Created 10/24/15
 *
 * @author TheNumberOne
 */
public class Analyzer implements Bot{

    @Override
    public String getName(){
        return "Analyzer";
    }

    @Override
    public Action takeTurn(int blue_levers, int red_levers, String history,
                           String memory, int roundNumber) {
        /*System.out.println(Game.totalScore(history) + " : " + history);
        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
        }*/
        int roundsLeft = 100 - roundNumber;
        int myScore = (Game.totalScore(history) + roundNumber) / 2; //My number of wins.
        int enemyScore = roundNumber - myScore;                     //Enemy's number of wins.
        Map<Integer, Double> bestRounds = new HashMap<>();
        int timeLimit = 0;

        Scanner scanner = new Scanner(memory);
        if (scanner.hasNext()){     //No memory, first turn.
            boolean triedTimeTravel = scanner.nextBoolean();
            if (triedTimeTravel){
                int time = scanner.nextInt();
                if (roundNumber > time) {     //Failed.
                    timeLimit = time;
                }
            }
            timeLimit = Math.max(timeLimit, scanner.nextInt());
            int size = scanner.nextInt();
            for (int i = 0; i < size; i++) {
                bestRounds.put(scanner.nextInt(), scanner.nextDouble());
            }
        } else {
            bestRounds.put(1, 0.5);
        }

        clean(bestRounds, roundNumber, timeLimit);
        double winningProb = computeWinningProbability(myScore, enemyScore, roundsLeft);
        String newMemory = computeMemory(bestRounds, roundNumber, winningProb);

        if (winningProb >= new double[]{1.5, .75, .7, .65, .6, .55}[blue_levers]){ //Ensure success ... slowly.
            return getAction(-1, newMemory, timeLimit, roundNumber);
        }

        int bestRound = bestRound(bestRounds);
        double bestRoundProb = bestRounds.get(bestRound);

        if ((winningProb <= bestRoundProb - .05 || winningProb < .5 && bestRoundProb > winningProb) && red_levers > 0){
            return getAction(bestRound, newMemory, timeLimit, roundNumber);  //Let's find the best past.
        } else {
            return getAction(0, newMemory, timeLimit, roundNumber); //Let's wait it out :)
        }
    }

    //Should be combined with computeMemory.
    private static Action getAction(int actionNum, String newMemory, int timeLimit, int roundNumber){
        if (actionNum == -1){
            timeLimit = Math.max(timeLimit, roundNumber);
            newMemory = "false " + timeLimit + " " + newMemory;
            return new Action(actionNum, newMemory);
        }
        if (actionNum == 0){
            return new Action(actionNum, "false " + timeLimit + " " + newMemory);
        }
        if (actionNum > 0){
            return new Action(actionNum, "true " + actionNum + " " + timeLimit + " " + newMemory);
        }
        return null;
    }

    private static int bestRound(Map<Integer, Double> bestRounds) {
        int best = 0;           //If no previous rounds ... just go forward a round.
        double bestScore = -1;
        for (Map.Entry<Integer, Double> entry : bestRounds.entrySet()){
            if (entry.getValue() > bestScore){
                best = entry.getKey();
                bestScore = entry.getValue();
            }
        }
        return best;
    }

    private static String computeMemory(Map<Integer, Double> map, int roundNumber, double winningProb) {
        StringBuilder builder = new StringBuilder();
        builder.append(map.size() + 1).append(" ");
        for (Map.Entry<Integer, Double> entry : map.entrySet()){
            builder.append(entry.getKey()).append(" ").append(entry.getValue()).append(" ");
        }
        builder.append(roundNumber + 1).append(" ").append(winningProb);
        return builder.toString();
    }

    private static void clean(Map<Integer, Double> data, int round, int timeLimit) {
        data
                .entrySet()
                .stream()
                .filter(entry -> entry.getKey() > round || entry.getKey() <= timeLimit)
                .map(Map.Entry::getKey)
                .collect(Collectors.toList()).forEach(data::remove);
    }

    private static double computeWinningProbability(int myScore, int enemyScore, int roundsLeft){ //Too complex for IntelliJ
        int height = myScore - enemyScore;
        double total = 0.0;
        for (int i = Math.max(height - roundsLeft, 2); i <= height + roundsLeft; i += 2){
            total += prob(roundsLeft, height, i);
        }
        total += prob(roundsLeft, height, 0) / 2;
        return total;
    }

    private static double prob(int roundsLeft, int height, int i){
        double prob = 1;
        int up = i - height + (roundsLeft - Math.abs(i - height))/2;
        int down = roundsLeft - up;
        int r = roundsLeft;
        int p = roundsLeft;
        while (up > 1 || down > 1 || r > 1 || p > 0){  //Weird algorithm to avoid loss of precision.
            //Computes roundsLeft!/(2**roundsLeft*up!*down!)

            if ((prob >= 1.0 || r <= 1) && (up > 1 || down > 1 || p > 1)){
                if (p > 0){
                    p--;
                    prob /= 2;
                    continue;
                } else if (up > 1){
                    prob /= up--;
                    continue;
                } else if (down > 1){
                    prob /= down--;
                    continue;
                } else {
                    break;
                }
            }
            if (r > 1) {
                prob *= r--;
                continue;
            }
            break;
        }
        return prob;
    }

}

Score (since Nov 2):
Total Scores:
Oldschool: 3096
Random: 5756
RegretBot: 5362
Nostalgia: 8843
Little Ten: 8929
Analyzer: 17764
NoRegretsBot: 5621
Oracle: 15528
Deja Vu: 5281
Bad Loser: 13820

Impressive! Your bot blocks effectively and reverts at optimal times. It's going to be very tough to create a bot that can top this one.

I'm not sure that this bot is stoppable, without using a bunch of entries specifically designed to mess with this bot and boost another bot.

Oracle
I shamelessly copied some code from Analyzer (for parsing the memory). This submission tries to pull a blue lever early and then slowly builds up his lead. I think the performance of this bot makes up for the ugly code :)
package bots;

import java.util.*;
import java.util.Map.Entry;
import main.*;

public class Oracle implements Bot {

    @Override
    public String getName() {
        return "Oracle";
    }

    @Override
    public Action takeTurn(int blue_levers, int red_levers, String history, String memory, int roundNumber) {
        int roundsLeft = 100 - roundNumber;
        Map<Integer, Integer> rounds = new HashMap<>();
        int myScore = (Game.totalScore(history) + roundNumber) / 2;
        int difference = myScore*2 - roundNumber;
        int highestBlockedRound = -1;
        int bestScore = 0;
        boolean hasUsedBlueLever = false;

        Scanner scanner = new Scanner(memory);
        if (scanner.hasNext()) {
            //timeTravel toRound highestBlockedRound hasUsedBlueLever bestScore rounds round1 percent1 round2 percent2 round3 percent3...
            boolean triedTravel = scanner.nextBoolean();
            int time = scanner.nextInt();
            if (triedTravel){
                if (roundNumber > time) {
                    highestBlockedRound = time;
                }
            }
            highestBlockedRound = Math.max(highestBlockedRound, scanner.nextInt());

            hasUsedBlueLever = scanner.nextBoolean();
            bestScore = scanner.nextInt();

            int size = scanner.nextInt();
            for (int i = 0; i < size && i < roundNumber; i++) {
                int number = scanner.nextInt();
                int diff = scanner.nextInt();
                if (number < roundNumber) {
                    rounds.put(number, diff);
                }
            }
        }
        rounds.put(roundNumber, difference);
        final int blockedRound = highestBlockedRound;

        int roundToRevert = 0;
        if (rounds.size() > 2) {
            Optional<Entry<Integer, Integer>> bestRound = rounds.entrySet()
                    .stream()
                    .filter(x -> x.getKey() >= blockedRound && x.getKey() <= roundNumber)
                    .sorted(Comparator
                        .comparingInt((Entry<Integer, Integer> x) -> x.getValue()*-1)
                        .thenComparingInt(x -> x.getKey()))
                    .findFirst();
            if (bestRound.isPresent()) {
                roundToRevert = bestRound.get().getKey();
            }
        }

        if (roundsLeft + Game.totalScore(history) <= 0 && red_levers > 0) {
            roundToRevert = highestBlockedRound+1;
        } else if (blue_levers > 0 && roundToRevert == roundNumber && ((hasUsedBlueLever && difference >= bestScore*1.5) || (!hasUsedBlueLever && difference > 1))) {
            roundToRevert = -1;
            hasUsedBlueLever = true;
            bestScore = difference;
            highestBlockedRound = roundNumber;
        } else if (red_levers > 0 && roundToRevert > 0 && rounds.get(roundToRevert) > difference+2) {
            roundToRevert += 1;
        } else {
            roundToRevert = 0;
        }

        StringBuilder sb = new StringBuilder();
        sb.append(roundToRevert > 0).append(' ');
        sb.append(roundToRevert).append(' ');
        sb.append(highestBlockedRound).append(' ');
        sb.append(hasUsedBlueLever).append(' ');
        sb.append(bestScore).append(' ');
        sb.append(rounds.size()).append(' ');
        rounds.entrySet().stream().forEach((entry) -> {
            sb.append(entry.getKey()).append(' ').append(entry.getValue()).append(' ');
        });
        String mem = sb.toString().trim();
        scanner.close();
        return new Action(roundToRevert, mem);
    }
}

Good job! I knew I wasn't being aggressive enough with my red levers. Now  to improve Analyzer. ;)

RegretBot
At the end of our life the match, we regret our past failures, and attempt to go back and fix them.
package bots;

import main.Action;
import main.Game;

public final class RegretBot implements Bot {

    @Override
    public String getName() {
        return "RegretBot";
    }

    @Override
    public Action takeTurn(int blue_levers, int red_levers, String history, String memory, int roundNumber) {
        int actionNum = 0;
        if(roundNumber == 100) {
            // if it's the end of the game and we're losing, go back
            //  in time to the first loss, in hopes of doing better
            if(Game.totalScore(history)<=0 && red_levers > 0) {
                actionNum = history.indexOf("0")+1;
            }
            // if we're winning at the end, pull a blue lever if we can,
            //  to prevent our opponent from undoing our victory
            else if(blue_levers > 0) {
                actionNum = -1;
            }
        }
        // we don't need no stinkin' memory!
        return new Action(actionNum, null);
    }

}

Nostalgia
package bots;

import main.Action;
import main.Game;

public class Nostalgia implements Bot {

    @Override
    public String getName() {
        return "Nostalgia";
    }

    @Override
    public Action takeTurn(int blue_levers, int red_levers, String history,
            String memory, int roundNumber) {

        int current_score = Game.totalScore(history);

        // wait until the end to use blue levers
        if (current_score > 0 && blue_levers >= (100 - roundNumber)) {
            return new Action(-1, memory);
        }

        // become increasingly likely to go back as the gap between the good old days
        // and the horrible present increases
        if (current_score < 0 && red_levers > 0) {
            //identify the best time to travel back to
            int best_score = -100;
            int good_old_days = 1;
            int past_score = 0;

            int unreachable_past = 0;
            if(memory != "") {
              unreachable_past = Integer.parseInt(memory, 10);
            }

            for(int i = unreachable_past; i<roundNumber ; i++) {
              if(history.charAt(i) == '1') {
                past_score += 1;
                if(past_score > best_score) {
                  best_score = past_score;
                  good_old_days = i + 1;
                }
              }
              else {
                past_score -= 1;
              }
            }
            if(roundNumber >= 95 || Math.random() < (best_score - current_score) / 100.0) {
              return new Action(good_old_days, Integer.toString(good_old_days));
            }
        }

        // if neither action was needed do nothing
        return new Action(0, memory);
    }
}

Not tested, just a quick stab at trying to make a bot that's difficult to block (because it decides when to pull the red lever mostly randomly) but that makes decent decisions.
Edit: I missed this rule:

If you pull a blue lever (revert stopper) no TT is possible through that round anymore

That seems like a good reason to use memory -- if you remember trying to TT to a given round, you may have failed, so you shouldn't try to TT to that round again. Edited my bot to try to avoid this.

Little Ten
Little Ten does a lot of multiplying and dividing by 10, using numbers that are multiples of 10, and going back to rounds that are multiples of 10.
package bots;

import main.Action;
import main.Game;

public class LittleTen implements Bot {

    @Override
    public String getName() {
        return "Little Ten";
    }

    @Override
    public Action takeTurn(int blue_levers, int red_levers, String history, String memory, int roundNumber) {
        int score = Game.totalScore(history);
        char c = history.charAt(history.length() - 1);
        if (memory.isEmpty())
            memory = "1";

        if (roundNumber == 100) {
            if (score >= 0)
                // We're tied or ahead by the end of the match. Prevent time
                // travel if we can; otherwise whatever happens happens.
                return new Action(blue_levers > 0 ? -1 : 0, memory);
            else {
                // Travel to earlier rounds the farther behind we are if we can
                // (of course using 10 as a reference)
                if (red_levers > 0) {
                    int i = Integer.parseInt(memory);
                    int round = score <= -10 ? i : 100 - ((100 - i) / (11 + (score <= -10 ? -10 : score)));
                    return new Action(round, memory);
                }
            }
        }
        else if (score >= 7 + roundNumber / 20 && blue_levers > 0) {
            // We're ahead; we don't want to lose our lead, especially if the
            // match is close to ending. But we don't want to use up our blue
            // levers too quickly.
            int choice = (int) (Math.random() * 100),
                bound = (roundNumber / 10 + 1) * 5 - ((6 - blue_levers) * 5 - 2);
            if (choice < bound) {
                memory = String.valueOf(roundNumber);
                return new Action(-1, memory);
            }
        }
        else if (score <= -3) {
            // Possibly use a red lever if we're falling too far behind
            if (red_levers > 0) {
                int choice = (int) (Math.random() * 100),
                    bound = score <= -11 ? 90 : 10 * (-3 - score + 1);
                if (choice < bound) {
                    // Check the first round that is the lower multiple of ten
                    // and decide if we've been successful up to that point; if
                    // so, travel back to that round, otherwise go back 10 more
                    int round = roundNumber / 10 * 10;
                    if (round < 10)
                        return new Action(1, memory);
                    String seq = history.substring(0, round-1);
                    int minRound = Integer.parseInt(memory);
                    while (Game.totalScore(seq) <= 0 && round > 10 && round > minRound) {
                        round -= 10;
                        seq = history.substring(0, round-1);
                    }
                    if (round == 0)
                        round = 1;
                    return new Action(round, memory);
                }
            }
        }
        return new Action(0, memory);
    }
}

Edit: Changed the mechanics a little now that the explanation of what happens when a blue lever is pulled is clearer. Also did a bit of rebalancing.

Random
Random's strategy is the following:

block with a 10% chance if in the lead and has blue levers left
travel back one turn (replaying the last round) with 10% chance if behind in score and has red levers left

package bots;

import main.Action;
import main.Game;

public class RandomBot implements Bot {

    @Override
    public String getName() {
        return "Random";
    }

    @Override
    public Action takeTurn(int blue_levers, int red_levers, String history,
            String memory, int roundNumber) {

        // if in the lead and has blocks left, blocks with a 10% chance
        if (Game.totalScore(history) > 0 && blue_levers > 0
                && Math.random() > 0.9) {
            return new Action(-1, null);
        }

        // if behind and has travels left, travel back the current step to
        // replay it with a 10% chance
        if (Game.totalScore(history) < 0 && red_levers > 0
                && Math.random() > 0.9) {
            return new Action(roundNumber, null);
        }

        // if neither action were needed do nothing
        return new Action(0, null);
    }
}

NoRegretsBot
package bots;

import main.Action;
import main.Game;

public final class NoRegretsBot implements Bot {

    @Override
    public String getName() {
        return "NoRegretsBot";
    }

    @Override
    public Action takeTurn(int blue_levers, int red_levers, String history, String memory, int roundNumber) {
        // every 20 turns, pull a blue lever to lock in the past
        // hopefully this will thwart some of those pesky time-travelers
        return new Action(roundNumber%20==0?-1:0, null);
    }

}

Bad Loser
This bot uses no memory and is surprisingly good (but it doesn't beat Analyzer or Oracle).
package main;

import bots.Bot;

/**
 * Created 11/2/15
 *
 * @author TheNumberOne
 */
public class BadLoser implements Bot{
    @Override
    public String getName() {
        return "Bad Loser";
    }

    @Override
    public Action takeTurn(int blue_levers, int red_levers, String history, String memory, int roundNumber) {
        if (history.contains("00") && red_levers > 0){       //Subtract a zero for better performance against
            return new Action(history.indexOf("00") + 1, "");// Analyzer and Nostalgia, and worse performance
                                                             // against everything else.
        }
        int wins = 0;
        for (char c : history.toCharArray()){
            wins += c - '0';
        }
        if (wins >= new int[]{101, 51, 40, 30, 20, 10}[blue_levers]){
            return new Action(-1, "");
        }
        return new Action(0, "");
    }
}

Oldschool
This bot never does any action as Oldschool doesn't believe in time traveling.
package bots;

import main.Action;

public class OldschoolBot implements Bot {

    @Override
    public String getName() {
        return "Oldschool";
    }

    @Override
    public Action takeTurn(int blue_levers, int red_levers, String history,
            String memory, int roundNumber) {
        // never tries to block or travel at all
        return new Action(0, null);
    }
}

Deja Vu Bot
This bot tries to track when it pulls the blue to avoid red pulls into that region. Will only pull red levers when significantly behind in the score.
package bots;

import main.*;

public class Dejavu implements Bot
{
    @Override
    public String getName()
    {
        return "Deja Vu";
    }

@Override
public Action takeTurn(int blue_levers, int red_levers, String history,
                       String memory, int roundNumber) {

    if(roundNumber == 1)
    {
        memory = "-1";
    }
    int[] blevers = getBlueLevers(memory);
    char[] hist = history.toCharArray();
    int ms = 0;
    int ts = 0;
    int rl = -1;
    boolean bl = false;
    boolean url = false;

    for(int i = 0; i < hist.length; i++)
    {
        switch(hist[i])
        {
            case '1':
            ms++;
            break;
            case '0':
            ts++;
            break;
        }
    }

    if(ts - ms >= 10)
    {
        for(rl = hist.length - 1; ts - ms <= 5 && rl >= 0; rl--)
        {
            switch(hist[rl])
            {
                case '1':
                ms--;
                break;
                case '0':
                ts--;
                break;
            }
        }
        url = true;
    }

    if(ms - ts >= 7)
    {
        bl = true;
        url = false;
        memory += "," + roundNumber;
    }

    for(int i = 0; i < blevers.length; i++)
    {
        if(rl <= blevers[i])
        {
            rl = blevers[i] + 1;
        }
    }

    if(url)
    {
        return new Action(rl, memory);
    }
    else if(bl)
    {
        return new Action(-1, memory);
    }
    else
    {
        return new Action(0, memory);
    }
}

private int[] getBlueLevers(String s)
{
    String[] b = s.split(",");

    int[] bl = new int[b.length];
    for(int i = 0; i < b.length; i++)
    {
        bl[i] = Integer.parseInt(b[i]);
    }

    return bl;
}

}

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Cave Rangers - Exploring the Darkness
Your geologist buddy nearly kicked down your office door as he burst in, eyes wide in excitement, and asked you to come with him to a site he just discovered. On the way he explains that he thinks he literally just struck gold. Only problem is, it's buried deep underground in a cavern with a very unstable roof. It's too dangerous to go spelunking, so he wants you to program one of his cave exploring robots to collect as much gold as it can before he pulls it back up. He also mentions that he's probed the cavern and found some wildlife that could be harmful to the robots, and also that he'd dropped some equipment down there that might still be useable. Each robot is equipped with two arms and a range of sensors. When you arrive at the scene, he tells you he's planning on recruiting more coders, and whoever does the best job will be rewarded.
Now, down to the nitty-gritty. The sensors pass information to your program as ASCII characters. Here's a list of what each character means and descriptions for anything the bot might encounter in the cave:
Code    Name/Description

Y       Your bot
        You do things

@       Other bots
        They do other things

-       Ground
        This doesn't do things

C       Centipede
        These will bite you and leave a poison effect
        The bite will cost 1 health
        The poison effect will last for 3 turns, costing 2 health each turn

B       Bats
        If bats end up in the same space you are, your bot runs in a random direction during its turn rather than what you told it to do

L       Lion (because reasons)
        Lions deal heavy damage, 10 health, each time they attack

F       Food
        Eating this will give you 5 health
        Can only be used once

W       Water
        Drinking this will cure poison effects early
        Can only be used once

R       Revealer
        This will increase the range of your visibility to an 11x11 grid
        The extra range will only be 75% correct, but the original range won't be effected

K       Knife
        You do twice as much damage to other bots if you have a knife

G       Gold
        The whole reason you're doing this in the first place

N       Nurse Nina
        She mend you good
        Restores your health by 10 while you occupy the same space as her

}       Boulder
        You can't walk over boulders, and neither can anything else

P       Pit
        If you fall in a pit, you will be stuck for 3 turns

The size of the cavern grows based on how many bots are participating. It starts as a 30x30, and it gets an extra 10x10 for every bot. So 2 bots will explore a 50x50 cavern.
Bots start with 20 health, but they don't have a maximum limit on health.
Input:
You'll receive input through STDIN in the following format:
20,5,10,1,0,True,False    <-health, number gold pieces, number of turns your bot has lasted, number of until the poison wears off, number of turns until you are no longer stuck in a pit, if you have a revealer, if you have a knife
-----
-G}--
--Y-L
-C---
---B-

The first line contains information about your bot, and the rest is the grid that your bot can see. If your bot is against one of the 4 walls of the cavern, you will get a grid that looks more like this (in the case of being all the way to the West):
---
}--
Y--
---
---

The cavern does not wrap around, and neither does your vision. The walls of the cavern are not marked, the only indication your bot receives that it is nearing a wall is its view being diminished. With the Revealer, you might get something like this:
--------C--
LW--------B
---K-N-----
--------BR-
-F---------
--B--Y---@N
-W@---F----
------K-F--
----@-}----
R@---G}--}-
--------G-R

Output:
You get two moves per turn, which you output in the following format:
MNNANW    <- Moves are groups of 3 characters representing the action and the direction

Possible actions are the following:
M    Move - Move your bot in the specified direction
A    Attack - Attack the square in the specified direction
H    Hold - Do nothing

Possible directions are the following:
NN - North (up)
NE - Northeast (up-right)
EE - East (right)
SE - Southeast (down-right)
SS - South
SW - Southwest
WW - West
NW - Northwest

The moves are applied from left to right.
Turns:
Turns progress in the following fashion:

Poison effects are applied to any player who has been poisoned
Non-bots move and attack
2a. Lions, Centipedes, and Bats move randomly
2b. Lions and Centipedes will attack everything that is directly adjacent to it (including diagonally)
2c. The bat effect will only be applied to a bot if it is on the same space as the bat
2d. Nurse Nina will stay in a location for 3 turns, and then jump to a random location.
Bots move
3a. If your bot gives invalid output, it won't move
3b. Your bot will try to get as close to the space designated by the output as possible (see the note at the bottom for more detail)
3c. One attack to a Centipede, Lion, or Bat will kill it
3d. Attacking another bot without a knife will do 5 damage, and 10 with a knife

Rules:

Stick to common languages that can be run on OS X or Linux.
You can optionally write up to and not exceeding 1kb data to a file

Scoring:
Bots will only be in the cavern until only one remains, or until 50 turns have gone by, whichever comes first.
Your bot will be judged on the sum of the number of gold coins it collected and how many turns it lasted.
Controller code can be downloaded for testing here (make a folder called "bots" in the same directory that you download it to, and put your bot inside "bots") You'll need NumPy to run it. Feel free to dig through it, but you'll have to excuse the mess...
Here's some code for a random bot:
#!/usr/bin/python
import random as r

a = ['M','A','H']
d = ['NN','NE','EE','SE','SS','SW','WW','NW']

print(a[r.randint(0,2)]+d[r.randint(0,7)]+a[r.randint(0,2)]+d[r.randint(0,7)])

****Your bot will always move in the general direction your output specifies, but if it is obstructed by a rock or a wall, the exact direction depends on the circumstance. For instance, if your bot is against a wall like so:
---
}--
Y--
---
---

and your output is
MNWMSW

your bot will move one space down. It couldn't move North or West, so that move had no effect. It could move South (and did) but couldn't move West. However, if your bot tried to move Northeast, it would go directly to that space (diagonal movement is diagonal, not procedural)
Leaderboard
These are the average scores of 4 games.
The bot of Survival:    54.75
Coward:                 52.25
Pufferfish:             50.00
Randombot:              50.00
Indiana Jones:          47.50
TheoremBot:             46.50

How much health does each bot have? And what does the edge of the cavern look like?

They start with 20 and can collect as much as they want. Added this info above

The edges of the cavern aren't marked, your program will only get the bits that you could potentially walk on.

Do you really not know your health?

Could you input the length and width of the bot's vision?

I meant to add health, the post and code has been updated. I don't think the length and width of the bot's vision is necessary

What would happen with MNEHNN on -----\n---}-\n--Y--\n-----\n-----? Would the bot go north or east? Also, is N or Y displayed when you're on a Nurse?

@LegionMammal978 The bot would go north in that case -- the bot will always try to move N/S before E/W. If you're on the same place as Nurse, then your bot's Y will overwrite her 'N', but she'll still heal your bot.

I found a few bugs in the controller. 1: Nurse Nina doesn't work. 2: If a bot attacks the same lion (or centipede or bat) in both its moves, an error occurs.

Fixed Nurse Nina, but I can't replicate the 2nd problem. I changed the code a little anyway, but what's the error you're getting?

I was getting ValueError: list.remove(x): x not in list, but the changes you made probably fixed it. Bots that attack the same occupied space with both their moves should trigger this.

Found another bug: If a bot is killed by inexact count (so its health goes into the negative numbers), it still appears in other bots' vision. (But doesn't take any turns)

Fixed, thanks for bug hunting @ppperry

Found another controller bug: If a bot with a revealer wanders sufficiently close the the edge of the cavern that his normal view is limited, the controller crashes.

I've been working on that issue and updated my code this morning, have you re-downloaded the controller code since then?

@TheBeanstalk I did not redownload it. You seem to have fixed that bug.

Indiana Jones, Python 2
This bot is not afraid of anything. It will try to get the gold; and if it can't find any, it will try to stab opponents with knives.
#!/usr/bin/env python
import sys
import random
data = sys.stdin.readlines()
health, gold, turns, poison_remaining, pit_remaining, revealer, knife = eval(data[0])
lines = data[1:]

myloc = [-1, -1]

width, height = len(lines[0]), len(lines)

for y, line in enumerate(lines):
    if line.find('Y')>-1:
        myloc = [line.index('Y'), y]
if myloc[0]<width/2:
    padding = int(width/2-myloc[0])
    lines = ['-'*padding+line for line in lines]
    myloc[0]+=padding
elif myloc[0]>width/2+1:
    padding = int(myloc[0]-width/2-1)
    lines = [line+'-'*padding for line in lines]

if myloc[1]<height/2:
    padding = int(height/2-myloc[1])
    lines = ['-'*width]*padding + lines
    myloc[1]+=padding
elif myloc[1]>height/2+1:
    padding = int(myloc[1]-height/2-1)
    lines = lines + ['-'*width]*padding

uddirections = {1:'N',0:'',-1:'S'}
lrdirections = {1:'E',0:'',-1:'W'}

golds = {}
for y, line in enumerate(lines):
    if 'G' in line:
        x = line.index('G')
        direction = ((uddirections[max(min(myloc[1]-y,1),-1)]+lrdirections[max(min(x-myloc[0],1),-1)])*2)[:2]
        distance = max(abs(myloc[0]-x), abs(myloc[1]-y))
        golds[distance] = direction

bots = {}
for y, line in enumerate(lines):
    if '@' in line:
        x = line.index('@')
        direction = ((uddirections[max(min(myloc[1]-y,1),-1)]+lrdirections[max(min(x-myloc[0],1),-1)])*2)[:2]
        distance = max(abs(myloc[0]-x), abs(myloc[1]-y))
        bots[distance] = direction

foods = {}
for y, line in enumerate(lines):
    if 'F' in line:
        x = line.index('F')
        direction = ((uddirections[max(min(myloc[1]-y,1),-1)]+lrdirections[max(min(x-myloc[0],1),-1)])*2)[:2]
        distance = max(abs(myloc[0]-x), abs(myloc[1]-y))
        foods[distance] = direction

knives = {}
for y, line in enumerate(lines):
    if 'K' in line:
        x = line.index('K')
        direction = ((uddirections[max(min(myloc[1]-y,1),-1)]+lrdirections[max(min(x-myloc[0],1),-1)])*2)[:2]
        distance = max(abs(myloc[0]-x), abs(myloc[1]-y))
        knives[distance] = direction

if golds:
    direction = golds[min(golds.keys())]
elif not knife and knives:
    direction = knives[min(knives.keys())]
elif health<20 and foods:
    direction = foods[min(foods.keys())]
elif bots and knife:
    direction = bots[min(bots.keys())]
    if min(bots.keys())==1:
        print ('A'+direction)*2
        sys.exit(0)
    elif min(bots.keys())==2:
        print 'M'+direction+'A'+direction
        sys.exit(0)
else:
    print ('M'+random.choice('NS')+random.choice('NEWS'))*2
    sys.exit(0)
print ('M'+direction)*2

Just had to change one thing to get this working -- line.index('Y') will throw an error if "Y" isn't in the line, but line.find('Y') will return -1 if "Y" isn't in the line. Otherwise, it's great!

You bot cane sometimes output MSNMSN, which is invalid.

Coward, python3
A coward always runs from potential threats.
However, if he feels super strong, he will suddenly run amok
and stab everything near him.
The problem with the current implementation is that move commands are issued without knowledge whether it is the first or the second move.
#!/usr/bin/env python3.4

import sys, random

class Coward():
  """
  A coward always runs from potential threats.

  However, if he feels super strong, he will suddenly run amok
  and stab everything near him.
  """
  def __init__(self, hp, gold, turn, poison, pit, revealer, knife):
    self.hp=int(hp)
    self.gold=int(gold)
    if knife=="True": self.knife=True
    else: self.knife=False
    self.pit=int(pit)
    self.poison=int(poison)

  def readGrid(self, grid):
    self.grid=grid.split("\n")
  @property
  def _confidence(self):
    return self.hp+5*self.knife-2*self.poison
  @property
  def _lineOfY(self):
    for i, line in enumerate(self.grid):
      if "Y" in line:
        return i
  @property
  def _colOfY(self):
    return self.grid[self._lineOfY].index("Y")
  @property
  def _maxX(self):
    return len(self.grid)-1
  @property
  def _maxY(self):
    return len(self.grid[0])-1
  def move(self, step):
    d = {'NN':(0,-1),'NE':(1,-1),'EE':(1,0),'SE':(1,1),'SS':(0,1),'SW':(-1,1),'WW':(-1,0),'NW':(-1,-1)}
    c2d={(0,-1):'NN',(1,-1):'NE',(1,0):"EE",(1,1):"SE",(0,1):"SS",(-1,1):"SW",(-1,0):"WW",(-1,-1):"NW"}
    #Don't move into wall/ boulder/ pit
    #print(d, file=sys.stderr)
    for k,v in list(d.items()):
      x=self._lineOfY+v[0]
      y=self._colOfY+v[1]
      #print (k, v ,x , y, file=sys.stderr)
      if x<0 or y<0 or x>self._maxX or y>self._maxY:
        #print ("Out of bounds: ", k, file=sys.stderr)
        del d[k]
      elif self.grid[x][y]=="}" or self.grid[x][y]=="P":
        del d[k]
    #Always avoid bats, and enemys
    for dx in range(-2,3):
      for dy in range(-2,3):
        x=self._lineOfY+dx
        y=self._colOfY+dy
        if x<0 or y<0 or x>self._maxX or y>self._maxY:
          continue;
        if self.grid[x][y] in ["B", "L", "C", "@"]:
          for k in self._toDirection(dx, dy):
            if k in d: del d[k] #Too many threats from all sides can paralyze the Coward: nowhere to go...
    #print(d, file=sys.stderr)
    tomove=[]
    #Neighboring fields
    for dx in [-1,1]:
      for dy in [-1,1]:
        x=self._lineOfY+dx
        y=self._colOfY+dy
        if x<0 or y<0 or x>self._maxX or y>self._maxY:
          continue
        if self.poison>0 and self.grid[x][y]=="W":
          for k,v in d.items():
            if v==(dx,dy):
              tomove.append(k)
        if self.grid[x][y]=="N": #Always go to nurse, even if dangerous
          tomove.append(c2d[(x,y)])
        if self.grid[x][y] in ["F","K","G"]: #Go to Food, Knife or Gold, if save
          for k,v in d.items():
            if v==(dx,dy):
              tomove.append(k)
    #Further away: Go towards food, knife and gold and Nina if save.
    for target in ["N", "F", "G", "K"]:
      for dx in [-2,2]:
        for dy in [-2,2]:
          x=self._lineOfY+dx
          y=self._colOfY+dy
          if x<0 or y<0 or x>self._maxX or y>self._maxY:
            continue
          if self.grid[x][y]==target:
            l=[ k for k in self._toDirection(dx,dy) if k in d]
            if l: tomove.append(random.choice(l))
    s=list(d.keys())
    random.shuffle(s)
    tomove+=s
    try:
      return "M"+tomove[step-1]
    except IndexError:
      return ""
  def attack(self, step):
    c2d={(0,-1):'NN',(1,-1):'NE',(1,0):"EE",(1,1):"SE",(0,1):"SS",(-1,1):"SW",(-1,0):"WW",(-1,-1):"NW"}
    #If Bot next to you: always attack
    for k,v in c2d.items():
      x=self._lineOfY+k[0]
      y=self._colOfY+k[1]
      if x<0 or y<0 or x>self._maxX or y>self._maxY:
        continue
      if self.grid[x][y]=="@":
        return "A"+v
    #If Bot or monster could come closer: attack potential new position
    attDir={(-2,-2):["NW"], (-2,-1):["NW","WW"], (-2,0):["WW","NW","SW"], (-2,1):["WW","SW"], (-2,2):["SW"],(-1,-2):["NW","NN"], (-1,2):["SW","SS"], (0,2):["SW","SS","SE"],(0,-2):["NW","NN","NE"],(1,-2):["NN","NE"],(1,2):["SS","SE"],(2,-2):["NE"],(2,-1):["NE","EE"], (2,0):["NE","EE","SE"], (2,1):["EE","SE"], (2,2):["SE"]}
    for k,v in attDir.items():
      x=self._lineOfY+k[0]
      y=self._colOfY+k[1]
      if x<0 or y<0 or x>self._maxX or y>self._maxY:
        continue
      if self.grid[x][y] in ["@","L","C","B"]:
        return "A"+random.choice(v)
    return ""
  def _toDirection(self,dx,dy):
    if dx<0:
      if dy<0:
        return ["WW","NW","NN"]
      elif dy==0:
        return ["WW","NW","SW"]
      elif dy>0:
        return ["WW","SW","SS"]
    elif dx>0:
      if dy<0:
        return ["EE","NE","NN"]
      elif dy==0:
        return ["EE","NE","SE"]
      elif dy>0:
        return ["EE","SE","SS"]
    elif dx==0:
      if dy<0:
        return ["NN","NE","NW"]
      elif dy==0:
        return []
      elif dy>0:
        return ["SS","SE","SW"]
  def _nearBat(self):
    for dx in range(-2,3):
      for dy in range(-2,3):
        x=self._lineOfY+dx
        y=self._colOfY+dy
        if x<0 or y<0:
          continue;
        if self.grid[x][y]=="B":
          return True
    return False
  def makeTurn(self):
    try:
      command=""
      #If stuck, just attack
      if self.pit:
        command+=self.attack(1)+self.attack(2)
      #Always run from bats
      if self._nearBat:
        command+=self.move(1)+self.move(2)
      #If high-confidence: attack
      if self._confidence>30:
        command+=self.attack(1)+self.attack(2)
      #Else: Move somewhere
      command+=self.move(1)+self.move(2)
      #Just in case, two random attacks
      d = ['NN','NE','EE','SE','SS','SW','WW','NW']
      a=random.choice(d)
      b=random.choice([ x for x in d if x!=a])
      command+="A"+a+"A"+b
      return command[:6]
    except Exception as e:
      #print (e, file=sys.stderr)
      #Attacking is better than nothing
      d = ['NN','NE','EE','SE','SS','SW','WW','NW']
      a=random.choice(d)
      b=random.choice([ x for x in d if x!=a])
      return "A"+a+"A"+b

info=sys.stdin.readline()
grid=sys.stdin.read()
info=info.split(",")
bot=Coward(*info)
bot.readGrid(grid)
t=bot.makeTurn()
#print(t, file=sys.stderr)
print(t)

The bot of survival - Python 2
from __future__ import print_function
health,gold,survived,poison,pit,revealer,knife = input()
if pit:
    exit()
#Yes, this is python 2, despite the use of input()
lines = []
try:
    while True:
        lines.append(raw_input())
except EOFError:
    pass
CMOVES={"NW":(-1,-1),"NN":(-1,+0),"NE":(-1,+1),
        "WW":(+0,-1),             "EE":(-0,+1),
    "SW":(+1,-1),"SS":(+1,+0),"SE":(+1,+1),
}
MOVES={v:k for k,v in CMOVES.iteritems()}
import sys
def get_your_pos():
    for row,line in enumerate(lines):
        for col,square in enumerate(line):
            if square == "Y":
                return row,col
    raise ValueError("Your bot is not present.")
def isnearby(thing,p=None):
    your_pos = p or get_your_pos()
    for move in MOVES:
        yp = your_pos[0]+move[0],your_pos[1]+move[1]
        try:
            if yp[0] >= 0 and yp[1] >= 0 and lines[yp[0]][yp[1]] == thing:
                return move
        except IndexError:
            #Edge of cavern
            pass
for turn in range(2):
    import random
    nprio = .5
    if health > 25:
        nprio -= .2
    elif health < 10:
        nprio += .3
    if poison:
        nprio += .18
    #heal
    motive = how = None
    if random.random() < nprio:
        nurse = isnearby("N")
        if nurse:
            motive = "M"
            how = MOVES[nurse]
        elif random.random() < nprio:
            food = isnearby("F")
            if food:
                motive = "M"
                how = MOVES[food]
    #cure poison
    if poison and not motive:
        water = isnearby("W")
        if water:
            motive = "M"
            how = MOVES[water]
    if not motive:
        #Kill lions, bats, and centipedes
        for animal in ("L","B","C"):
            animal = isnearby(animal)
            if animal:
                motive = "A"
                how = MOVES[animal]
                y = get_your_pos()
                y = y[0]+animal[0],y[1]+animal[1]
                lines = map(list,lines)
                lines[y[0]][y[1]] = "-"
                break
        else:
            #Pick up knives
            if not knife:
                knife = isnearby("K")
                if knife:
                    motive = "M"
                    how = MOVES[knife]
            #Attack other bots
            else:
                prey = isnearby("@")
                if prey:
                    motive = "A"
                    how = MOVES[prey]
    #Get gold
    gold = isnearby("G")
    if gold and not motive:
        motive = "M"
        how = MOVES[gold]
    def isvalidmove(c):
        c = CMOVES[c]
        y = get_your_pos()
        y=(y[0]+c[0],y[1]+c[1])
        if y[0] >= 0 and y[1] >= 0:
            try:
                lines[y[0]][y[1]]
            except LookupError:
                pass
            else:
                return True
    if turn and not motive:
        motive = "M"
        while not (how and how not in (isnearby("}"),isnearby("P"),isnearby("@"))\
              and isvalidmove(how)):
            how = random.choice(CMOVES.keys())
    if not motive:break
    if not turn and motive == "M":
        lines = map(list,lines)
        yp = get_your_pos()
        lines[yp[0]][yp[1]] = "-"
        yp=[yp[0]+CMOVES[how][0],yp[1]+CMOVES[how][1]]
        lines[yp[0]][yp[1]] = "Y"
    print(motive+how,end="")
else:
    exit()
#Nothing found on first move
def isvaguelynearby(thing):
    your_pos = get_your_pos()
    for move in MOVES:
        yp = your_pos[0]+move[0],your_pos[1]+move[1]
        try:
            if yp[0] >= 0 and yp[1] >= 0 and board[yp[0]][yp[1]] != "P":
                dest = isnearby(thing,yp)
                if dest:
                    return move,dest
        except IndexError:
            #Edge of cavern
            pass
if random.random() < nprio:
    dests = isvaguelynearby("N")
    if not dests and random.random() < nprio:
        dests = isvaguelynearby("F")
    if dests:
        m1,m2 = MOVES[dests[0]],MOVES[dests[1]]
        print("M" + m1 + "M" + m2)
        exit()
dests = (poison and isvaguelynearby("W")) or (not knife and isvaguelynearby("K"))\
    or isvaguelynearby("G")
prey = isvaguelynearby("L") or isvaguelynearby("B") or isvaguelynearby("C") or \
       (knife and isvaguelynearby("@"))
if dests:
    m1,m2 = MOVES[dests[0]],MOVES[dests[1]]
    print("M" + m1 + "M" + m2)
elif prey:
    m1,m2 = MOVES[prey[0]],MOVES[prey[1]]
    print("M" + m1 + "A" + m2)
else:
    how = None
    while not (how and how not in     (isnearby("}"),isnearby("P"),isnearby("@"))\
          and isvalidmove(how)):
        how = random.choice(CMOVES.keys())
    print("M"+how,end="")
    lines = map(list,lines)
    yp = get_your_pos()
    lines[yp[0]][yp[1]] = "-"
    yp=[yp[0]+CMOVES[how][0],yp[1]+CMOVES[how][1]]
    lines[yp[0]][yp[1]] = "Y"
    while not (how and how not in (isnearby("}"),isnearby("P"),isnearby("@"))\
          and isvalidmove(how)):
            how = random.choice(CMOVES.keys())
    print("M"+how)

Edit: added better pit avoidance.

Pufferfish, Python 3+
I'm just that person.
#!/usr/bin/env python3.4
import random
def select():
 return "A"+["NN","NE","EE","SE","SS","SW","WW","NW"][random.randint(0,7)]
print(select()+select())

This bot has the purpose of self-sustenance. I might add golf-seeking later if I have time.

It'll make your code a little longer, but Pufferfish is able to attack twice in the same turn if it wanted to be more deadly

@TheBeanstalk Ohhh sweet!

You realize that this bot will never get any gold, and not all other bots will wander into its "kill aura"

@ppperry I do realize this; this was mainly to get the ball rolling; it is not purposed to win, but to make life slightly more difficult. As in, Black Hat Man


text:
Substitute a string with itself!
Substitute a string with itself
Your goal is to substitute a string with itself by replacing each character in the original string with the one before it, starting with the first character and wrapping around. Here are some examples to show what I mean:
1st example:
Input: program
Output: apgopra

How:
Program -> mrogram (replace p by m in program)
-> mpogpam (replace r by p in mrogram)
-> mprgpam (replace o by r in mpogpam)
-> mpropam (replace g by o in mprgpam)
-> mpgopam (replace r by g in mpropam)
-> mpgoprm (replace a by r in mpgopam)
-> apgopra (replace m by a in mpgoprm)

2nd example:
Input: robot
Output: orbro

How:
Robot -> tobot (replace r by t in robot)
-> trbrt (replace o by r in tobot)
-> trort (replace b by o in trbrt)
-> trbrt (replace o by b in trort)
-> orbro (replace t by o in trbrt)

3rd example:
Input: x
Output: x

How:
x -> x (replace x by x in x)

4th example:
Input: xy
Output: xx

How:
xy -> yy (replace x by y in xy)
-> xx (replace y by x in yy)

Sidenotes:

The string x will only contain lowercase alphanumeric characters and spaces
This is code-golf so shortest code in bytes wins!

Do my edits match your original idea?

Seems fine, I hope people understand that every round they basically encrypt an encrypted string by replacing characters every round. The examples make this clear, so I think they will.

CJam, 11 bytes
q__1m>.{er}

Test it here.
Explanation
q__    e# Read input and make two copies.
1m>    e# Rotate the second copy one character to the right.
.{er}  e# For each pair of characters from the second and third string,
       e# replace occurrences of the first with the second.

TeaScript, 17 bytes 19 21 24
TeaScript is JavaScript for golfing
xd(#lg(i,xC(1#a))

Nice and short
Try it online (watch for trailing whitespace in the input)
Ungolfed & Explanation
x.reduce     // Reduce over input
  (#         // Anonymous function expands to ((l,i,a)=>
    l.g(        // global replace...
     i          // replace var i with...
     x.cycle(1) // Cycle x 1
     [a]        // At position a
    )
  )

JavaScript ES6, 69 bytes
s=>[...s].reduce((p,c,i)=>p.replace(RegExp(c,'g'),s.slice(i-1)[0]),s)

F=s=>[...s].reduce((p,c,i)=>p.replace(RegExp(c,'g'),s.slice(i-1)[0]),s)

input.oninput=()=>output.innerHTML=F(input.value)
#input, #output {
  width: 100%;
}
<textarea id='input' rows="5">
</textarea>

You can skip the F= in your byte count.

@Ypnypn Thanks never know what to do when they don't specify this stuff

s.slice(i-1)[0] is not equal to s.slice(i-1,i) ?

@edc65 No not when i=0

There's now a replaceAll method that can save some bytes. I'm not sure which ES version introduced it, so it might not be ES6 then. s=>[...s].reduce((p,c,i)=>p.replaceAll(c,s.slice(i-1)[0]),s), 60 bytes.

Or sticking to ES6, 64 bytes (I haven't tested it): s=>[...s].reduce((p,c,i)=>p.split(c).join(c),s.slice(i-1)[0]),s)

Mathematica, 89 75 74 57 bytes
""<>Fold[#/.#2&,c=Characters@#,Thread[c->RotateRight@c]]&

""<>Fold[#/.#2&,c=Characters@#,Thread[c->RotateRight@c]]&

@alephalpha Thanks, I tried that with Transpose and failed.

Ruby, 50 48 bytes
->s{t=s.dup;t.size.times{|i|t.tr!s[i],s[i-1]};t}

Test:
f=->s{t=s.dup;t.size.times{|i|t.tr!s[i],s[i-1]};t}
f["program"]
=> "apgopra"

Pyth, 13 bytes
u:G.*HC.>Bz1z

Try it online. Test suite.

k2 - 17 char
Function taking 1 argument.
{_ssr/[x;x;-1!x]}

k2 has a builtin called _ssr for String Search and Replace. _ssr[x;y;z] will find y in x and replace it with z. So we use / to fold this functionality over each replacement we want to make. For those unfamiliar with folding (as in functional programming), essentially  _ssr/[x; (y1; y2; y3); (z1; z2; z3)] becomes _ssr[_ssr[_ssr[x; y1; z1]; y2; z2]; y3; z3]. Strings are lists of their characters, so we may simply rotate the input back a step and get the replacements, and plug right in.
  {_ssr/[x;x;-1!x]} "program"
"apgopra"
  {_ssr/[x;x;-1!x]} "robot"
"orbro"
  {_ssr/[x;x;-1!x]} (,"x")   / one-letter strings are ,"x" and parens are required
,"x"
  {_ssr/[x;x;-1!x]} "xy"
"xx"

Python, 67 64 62 57 Bytes
Straightforward solution, will look into something to shorten this. Thanks to @RandyC for saving 5 bytes.
c=input()
for x in zip(c,c[-1]+c):c=c.replace(*x)
print c

Input should be in quotes.

You can save a few bytes dropping the [:-1] since zip truncates to the shortest iterable.

@RandyC Wow, good call! Thanks.

Haskell, 76 bytes
[]#_=[];(x:y)#g@(a,b)|x==a=b:y#g|2>1=x:y#g;h x=foldl(#)x$zip x$last x:init x

Too bad, Haskell doesn't even have a build-in substitution function.

PHP, 76 bytes
function($s){$f=str_split;echo str_replace($f($s),$f(substr($s,-1).$s),$s);}

Here is the ungolfed version:
function selfSubstitute($originalString)
{
    $shiftedString = substr($originalString, -1) . $originalString;

    $splitOriginalString = str_split($originalString);
    $splitShiftedString = str_split($shiftedString);

    echo str_replace($splitOriginalString, $splitShiftedString, $originalString);
}

Haskell, 58 bytes
r(x,y)c|x==c=y|0<1=c;f s=foldl(flip$map.r)s.zip s$last s:s

Pretty similar to Christian's solution, but using map and the fact that zip ignores superfluous elements if the lists are of unequal length. It folds through the list of replacements (on the form (from,to)), updating the string by mapping the hand written replacement function r on each letter.
The expression flip$map.r was derived using LambdaBot's "Pointless" plugin.

Jelly, 10 9 7 bytes
ṙ-ż@y@ƒ

Try it online!
Having seen caird's y-based solution, I spent several hours trying to use matrix multiplication instead, but eventually I took a crack at y and arrived at this.
Speaking of caird's solution, I was about to pose the question to JHT of how to outdo J_.ịƲU for "obtaining pairs of elements from the input followed by the elements preceding them, wrapping around", but as I wrote that whole thing out I realized I never did actually try using ż!
The edit history contains some nice old explanations if anyone wants to read them.
ṙ          Rotate the input left
 -         by -1.
  ż@       Zip the input with the rotated input.
      ƒ    Starting with the input, reduce the resulting pairs by
    y@     substitution.

Jelly, 15 bytes
żṙ-$,µ,Ḣy¥¥/ḷ/¿

Try it online!
Jelly sucks at strings
How it works
żṙ-$,µ,Ḣy¥¥/ḷ/¿ - Main link. Takes a string S on the left
   $            - Group the previous two links together:
  -             -   -1
 ṙ              -   Rotate S 1 unit to the right
ż               - Zip S with rotated S; Call this M
    ,           - Pair with S; [M, S]
     µ          - Begin a new link with this pair as the argument
          ¥     - Group the previous two links together as a dyad f(p, s):
         ¥      -   Group the previous two links together as a dyad g(p, s):
       Ḣ        -     Remove the first pair in p and use it; [c, t]
        y       -     Replace c with t in s
      ,         -   Yield a pair with the modified p and the replaced s
              ¿ - While:
            ḷ/  -   The first element is truthy
           /    -   Run f(M, S)

Doesn't Jelly have transliterate built-in?

@Shaggy Yeah, that’s the y. Unfortunately the issue is that unlike e.g. the k answer, Jelly isn’t a fan of reducing by y to perform repeated transliteration, so we need to go through the whole charade of a while loop instead

Japt, 5 bytes
dUíUé

Try it
dUíUé     :Implicit input of string U
d         :For each pair XY in the following string, recursively replace X with Y
 Uí       :  Interleave U with
   Ué     :  U rotated right

J, 18 bytes
rplc~/@,~|.,.1|.|.

Try it online!

Brachylog, 29 bytes
⟨tc≡⟩⟨gcs₂ᶠ⟩{gᵗz{tᵛ&th|h}ᵐ}ˡb

Try it online!
  c                   Concatenate
 t                    the last item of the input
⟨  ≡⟩                 with the input.
       c              Concatenate
      g               that result in a singleton list
     ⟨  s₂ᶠ⟩          with a list of its length-2 substrings.
             ... b    Remove the extra element from the final result.

{             }ˡ      Left fold:
 gᵗz                  zip each element of the first element with the entire second element,
    {       }ᵐ        and for each of those pairs:
     tᵛ               the last element of both is the same
       &th            and the first element of the last element of the pair
          |           is the output, or
           h          the first element of the pair is the output.

Perl 5 -pF, 34 bytes
for$a(0..$#F){s/$F[$a]/$F[$a-1]/g}

Try it online!


text:
The time after some time
For this challenge, we are writing the time in the following form: hh:mm:ss
Some examples:

12:34:08
06:05:30
23:59:00

The challenge is to output the time after an amount of hours, minutes and seconds have elapsed, with as starting time 00:00:00. You can compare this with a timer that started at 00:00:00.
Here is an example of inputs (using STDIN) and outputs:
Input: 1h20m5s
Output: 01:20:05

Input: 0h100m0s
Output: 01:40:00

After 24 hours, the timer resets itself:
Input: 25h0m0s
Output: 01:00:00

The form of the input is always the same: XhYmZs, with X hours, Y minutes and Z seconds (assume that X, Y and Z are whole integers less than 100000 and never negative)
This is code-golf, so least amount of bytes wins this challenge

Can we write functions?

@LegionMammal978, yes

"assume that X, Y and Z are whole integers less than 99999 and never negative" is 99999h99999m99999s a valid input?

@Cruncher, yes, that is a valid input

99999 is not less than 99999.

@Luke, sorry you're right. I have corrected it in the question

CJam, 34 bytes
leu~]2%60b86400%60b3Te[{s2Te[}%':*

Try it here.

Ruby - 131 115 107 97 84 bytes
I'm still golfing it.
h,m,s=gets.split(/\w/).map &:to_i;$><<"#{(h+m/60+s/3600)%24}:#{(m+s/60)%60}:#{s%60}"

Thanks for @Doorknob for /\w/ inshead of /h|m|s/

You can split on a regex: gets.tr('ms',?h).split(?h) -> gets.split(/\w/).

@Doorknob I've just rewritten it to regexes but yours is shorter. Thanks!

I give up on trying to compete. Mma is just too verbose.

@LegionMammal978 Never give up ;)

Mathematica, 133 116 112 111 bytes
IntegerString[(f=FromDigits)[f/@StringSplit[#,_?LetterQ],60]~Mod~86400~IntegerDigits~60,10,2]~StringRiffle~":"&

C 149 112 bytes
Test it here
main(h,m,s){scanf("%dh%dm%ds",&h,&m,&s);s+=h*3600+m*60;h=s/3600;m=s/60;printf("%02d:%02d:%02d",h%24,m%60,s%60);}

Credits to @Dennis for getting rid of a lot it.

main(h,m,s){scanf("%dh%dm%ds",&h,&m,&s);s+=h*3600+m*60;m=s/60;h=m/60;printf("%02d:%02d:%02d",h%24,m%60,s%60);} (110 bytes, reads from STDIN)

@Dennis thanks, forgot it didn't have to be a command line argument. The only thing that wasn't working for me was the declaration of the variables in the function argument list; I was getting compiler errors with that.

h,m,s;main() should be more portable. main(h,m,s) works with GCC (link)

Ok, thanks. Got it down to 112.

m=s/60;h=m/60; ? After this you can get rid of the s+= too.

Python 2, 138 126 Bytes
Now I'm using regex, still quite long though..
import re
a=input();b=map(int,re.split('h|m|s',a)[:-1])
s=b[0]*3600+b[1]*60+b[2]
print(':%02d'*3)[1:]%(s/3600%24,s/60%60,s%60)

Input should be in quotes.

PHP, 80 88 93 Bytes
<?=!$s=split(~¤—’¢,fgets(STDIN)),date(~·Å–ÅŒ,$s[0]*3600+$s[1]*60+$s[2]-date(Z));

(saved as ISO-8859-1)
Works only on PHP 5 because of deprecated split function. Assumes that notices are not shown.
How it works:

¤—’¢ is "[hm]" inverted and a valid constant name, PHP uses undefined constants as string (saves one character for the quotation marks)
·Å–ÅŒ is the same for "H:i:s"
Everything is a single short handed echo statement. <?=x,y outputs x and y. Using !, the result of the $s assignment gets converted to boolean and negated, then converted to string to output. (string)false === ''
split("[hm]", "XhYmZs") splits the string to [X,Y,Zs]. Then, 3600*X+60*Y+Zs is the number of seconds. PHP converts Zs to integer as Z
We substract the timezone offset date(Z), use this result as a timestamp and print its time part as "hours:minutes:seconds". In UTC (offset 0), the timestamp 0 is 1970/01/01 00:00:00. Substracting the timezone offset normalizes the date as UTC without changing the actually used timezone (this saved 8 bytes for setting the timezone).
Conveniently, 25 hours will result in 01:00:00 (on the next day).

JavaScript 110 bytes
Where x is the input
x=x.split(/[hms]/).map(Number);for(z=2;z--;)x[z+1]-60&&(x[z]+=~~(x[z+1]/60));y=x[0]%24+":"+x[1]%60+":"+x[2]%60

I don't think this is the most efficient way
// How it works:
x=x.split(/[hms]/).map(Number);                // splitting the string into an array of numbers
for(z=2;z--;)x[z+1]-60&&(x[z]+=~~(x[z+1]/60)); // shifting excess of seconds to minutes, and then minutes to hours
y=x[0]%24+":"+x[1]%60+":"+x[2]%60              // putting them all together

AutoIt, 208 bytes
Func _($0)
$1=StringRegExp($0,"[0-9]+",3)
For $2=2 To 1 Step -1
If $1[$2]>59 Then
$1[$2]=Mod($1[$2],59)-1
$1[$2-1]+=1
EndIf
Next
Return StringFormat("%02u:%02u:%02u",$1[0]-($1[0]>23?24:0),$1[1],$1[2])
EndFunc

Too long. Test:
ConsoleWrite(_("1h20m5s") & @LF)
ConsoleWrite(_("0h100m0s") & @LF)
ConsoleWrite(_("25h0m0s") & @LF)

Pyth, 40 bytes
j\:%L"%02d">3j+%ivM:z"\d+"1K60 86400^KTK

I'm still learning. Try it here!

Perl 5, 84 (83 Bytes + 1)
Uses the overflow of seconds or minutes.
($h,$m,$s)=split/\D/;$h+=($m+=$s/60)/60;printf"%0.2d:%0.2d:%0.2d",$h%24,$m%60,$s%60

Test
$ echo 35:124:224s |perl -n 61736-time-after-some-time.pl
13:07:44

VBA (150149 bytes)
Function t(s)
x = Split(Replace(Replace(Replace(s, "s", ""), "m", " "), "h", " "))
t = Format(TimeSerial(x(0), x(1), x(2)), "HH:MM:SS")
End Function

Looks Good. VBA seems great for this task. If you use msgbox as output you can change to a Sub and save 2 bytes. You can Also Golf away all the unneeded white space around the = and after each , to knock it down around 134.

JavaScript, 97 bytes
x=>([h,m,s]=x.match(/\d+/g),[(+h+m/60|0)%24,(+m+s/60|0)%60,s%=60].map(a=>(a>9?'':'0')+a).join`:`)

Can you turn this into a Fiddle? Doesn't seem to work for me. I get Invalid left-hand side in assignment

@GustvandeWal So far FireFox is the only browser to support destructuring assignment, so a fiddle won't help unfortunately.

PowerShell, 84 Bytes
$a=$args-split'[hms]';"{0:HH:mm:ss}"-f(date 0).AddSeconds(3600*$a[0]+60*$a[1]+$a[2])

Splits the command-line input into an array of strings based on the [hms] regex. Uses the verbose built-in function .AddSeconds() to add (hours*3600, minutes*60, and seconds) to (date 0) a/k/a Monday, January 1, 0001, 12:00:00 AM, then feeds that into -f with formatting HH:mm:ss which will automatically convert it to 24-hour clock format and output it.
Example:
PS C:\Tools\Scripts\golfing> .\time-after-some-time.ps1 25h100m0s
02:40:00

Lua, 104 bytes
h,m,s=io.read():match"(%d+)h(%d+)m(%d+)"m=m+s/60;print(("%02d:%02d:%02d"):format((h+m/60)%24,m%60,s%60))

VB.NET (107 bytes)
First submission for code golf so I'm guessing character count => byte count?
MsgBox(TimeSpan.Zero.Add(TimeSpan.Parse(Regex.Replace(InputBox("XhYmZs"),"[hm]",":").Trim("s"))).ToString)

https://mothereff.in/byte-counter

Python 3, 158
import re
e=input()
b=[];p=0
for s in re.split('\D',e)[:3][::-1]:c,a=divmod(int(s),60);b+=[a+p];p=c
b[2]=(b[2]+p)%24;f=':%02d'*3;print(f[1:]%(b[2],b[1],b[0]))

Ungolfed version:
import re
def timer(elapsed):
    base=[]
    previous_carry=0
    for section in re.split('\D+',elapsed)[:3][::-1]:
        carry,amount=divmod(int(section),60)
        base+=[amount+previous_carry]
        previous_carry=carry
    base[2]=(base[2]+previous_carry)%24
    format_str = ':%02d'*3
    return format_str[1:]%(base[2],base[1],base[0])

CJam, 50 bytes
0[l"hms"Ser~][24 60 60].{md}(;+2/::+{"%02d"e%}%':*

GNU sed+date, 51 bytes
(including +1 byte for -r flag)

#!/bin/sed -rf
s/(.*h)(.*m)(.*s)/date -d"0:0 \1our\2in\3ec" +%T/e

This simply gets date to add the specified number of hours, minutes and seconds to 00:00:00 (today) and display the time part.  Recommended to set TZ=UTC or avoid running the program around a local-time change (e.g. daylight savings).