Then the bufferUntil is useless right?
Not at all.
A carriage return is like pressing enter/return on the keyboard right? So isn't that a line feed allready?
Ever seen a typewriter? There is a lever that you use to return the carriage to the left side of the typewriter, and advance the paper so you can type on the next line. So, the carriage return and line feed are separate activities. The enter key on a PC emulates the carriage return/line feed. How do you suppose it does that? Hint: it was two separate activities.
frameCount prints the current frame number, so when you start a processing sketch it starts with 1 and then it just counts.
"it just counts" when? Details are crucial. What causes it to increment?
The processing pde has a console, if i use println("something"); then it goes to the processing console
That explains how you know what Processing received. You seem to know what the Arduino sent, too. How?
Afcorse i could use a byte and multiply it by 4 by the arduino which is more easy (but 4 times less precise) but for the purpose of learning i don't.
I used frameCount for now cause it's easy to see if things are going correct since it's produces 1,2,3,4,5,6,7,8,9,10,11 etc. If you look in the output below, you see a bit of it coming back.
Then why complicate with that 9999 or h crap. Just use the Serial.println() function on the Arduino and bufferUntil('\n'); in the Processing application.
The Processing application sends a string ("0", "1", ... , "10", "11"). You need to read that string, convert it to a number, and send that number back to Processing (as a string) to validate the communication process.