<commit_before>var buttonContainer = document.getElementById('buttonContainer');

function addButton(name, codeString) {
  var button = document.createElement('button');
  button.innerHTML = name;
  button.addEventListener('click', ()=>{
    addMessage(codeString, true);
    socket.emit('command', codeString);
  });
  buttonContainer.appendChild(button);
  buttonContainer.appendChild(document.createElement('br'));
};


var codeStrings = {
  scanArea: 'for i=-1,7 do sendScan.plane(i); end return true;',
  scanClose: 'for i=-2,3 do sendScan.volume(-3, -3, i, 8, 8, 1) end return true;',
  forward: 'return pos.forward();',
  back: 'return pos.back();',
  up: 'return pos.up();',
  down: 'return pos.down();',
  turnLeft: 'orient.turnLeft(); return true;',
  turnRight: 'orient.turnRight(); return true;',
};

for (name in codeStrings) {
  addButton(name, codeStrings[name]);
}<commit_msg>buttons now use scan level setting<commit_after>var buttonContainer = document.getElementById('buttonContainer');

function addButton(name, codeString) {
  var button = document.createElement('button');
  button.innerHTML = name;
  button.addEventListener('click', ()=>{
    addMessage(codeString, true);
    socket.emit('command', codeString);
  });
  buttonContainer.appendChild(button);
  buttonContainer.appendChild(document.createElement('br'));
};

var scanLevel = document.getElementById('scanWhileMoving').value;
var codeStrings = {
  scanArea: 'for i=-1,7 do sendScan.plane(i); end return true;',
  scanClose: 'for i=-2,3 do sendScan.volume(-3, -3, i, 8, 8, 1) end return true;',
  forward: 'return mas.moveAndScan("forward", '+ scanLevel +');',
  back: 'return mas.moveAndScan("back", '+ scanLevel +');',
  up: 'return mas.moveAndScan("up", '+ scanLevel +');',
  down: 'return mas.moveAndScan("down", '+ scanLevel +');',
  turnLeft: 'orient.turnLeft(); return true;',
  turnRight: 'orient.turnRight(); return true;',
};

for (name in codeStrings) {
  addButton(name, codeStrings[name]);
}
{'fraction_non_alphanumeric': 0.17587939698492464, 'fraction_numerical': 0.009045226130653266, 'mean_word_length': 5.570957095709571, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6303441', 'n_tokens_mistral': 623, 'n_tokens_neox': 609, 'n_words': 146}