 
   payload = SD.open(scriptName);
   if(!payload){
-    #ifdef debug 
-      Serial.println("couldn't find script: '"+String(scriptName)+"'");
-    #endif
+#ifdef debug 
+    Serial.println("couldn't find script: '"+String(scriptName)+"'");
+#endif
     return;
   }else{
     Keyboard.begin();

/*
Copyright (c) 2017 Seytonic, Spacehuhn (Licensed under MIT)
For more information see: github.com/seytonic/malduino
*/

#include <SPI.h>
#include <SD.h>
#include "Keyboard.h"

//#define debug true // <-- uncomment to turn serial output on
#define CSpin 4 //Chip-Select of the SD-Card reader
#define ledPin 3
#define blinkInterval 50

      buf[bufSize] = payload.read();
      if(buf[bufSize] == '\r' || buf[bufSize] == '\n' || bufSize >= buffersize){
        if(buf[bufSize] == '\r' && payload.peek() == '\n') payload.read();
        
        //---------REPEAT---------     
        int repeatBufferSize = 0;
        int repeats = 0;
        unsigned long payloadPosition = payload.position();
        
        for(int i=0;i<12;i++){
          if(payload.available()){
            repeatBuffer[repeatBufferSize] = payload.read();
            repeatBufferSize++;
          }else break;
        }

        if(repeatBufferSize > 6){
          if(equals(repeatBuffer, 0, 6, "REPEAT", 6)){
            repeats = getInt(repeatBuffer, 6);
          }
        }

        for(int i=0;i<repeats;i++) runLine();
        
        payload.seek(payloadPosition);
        //------------------------
        
        runLine();
        bufSize = 0;
      }
      else bufSize++;
    }
    if(bufSize > 0){
      runLine();
      bufSize = 0;
    }
    payload.close();
