<commit_before>local component = require("component")
local computer = require("computer")
local modem = component.modem
local event = require("event")
local serial = require("serialization")
local filesystem = require("filesystem")
local internet = component.internet
local shell = require("shell")
local term = require("term")
local json = require("json")
local interface = require("interface")
local configLib = require("config")
local gpu = component.gpu
local w,h = gpu.getResolution()
local numrobots = 0
local defaultCfg = {
  serveraddress = "http://exampleserver.com/receiver.php"
}
local conf = configLib.loadConfig("atcclient.cfg",defaultCfg)
local function downloadLatest()
  local url = conf.serveraddress
  local success, response = pcall(component.internet.request, url)
  if success then
    local resdata = ""
    while true do
      local data, responseChunk = response.read()
      if data then
        resdata = resdata .. data
      else
        if responseChunk then
          return false, responseChunk
        else
          return true, resdata
        end
      end
    end
  else
    return false, reason
  end
end

local function robotRefresh(address)
  modem.send(address,10000, serial.serialize({type="location"}))
end

local function robotDelete(address)<commit_msg>Default config should be the same as example.cfg in /etc/<commit_after>local component = require("component")
local computer = require("computer")
local modem = component.modem
local event = require("event")
local serial = require("serialization")
local filesystem = require("filesystem")
local internet = component.internet
local shell = require("shell")
local term = require("term")
local json = require("json")
local interface = require("interface")
local configLib = require("config")
local gpu = component.gpu
local w,h = gpu.getResolution()
local numrobots = 0
local defaultCfg = {
  serveraddress = "http://exampleserver.com/getrobots.php"
}
local conf = configLib.loadConfig("atcclient.cfg",defaultCfg)
local function downloadLatest()
  local url = conf.serveraddress
  local success, response = pcall(component.internet.request, url)
  if success then
    local resdata = ""
    while true do
      local data, responseChunk = response.read()
      if data then
        resdata = resdata .. data
      else
        if responseChunk then
          return false, responseChunk
        else
          return true, resdata
        end
      end
    end
  else
    return false, reason
  end
end

local function robotRefresh(address)
  modem.send(address,10000, serial.serialize({type="location"}))
end

local function robotDelete(address)
{'fraction_non_alphanumeric': 0.09731162438470277, 'fraction_numerical': 0.004543733434305188, 'mean_word_length': 3.901669758812616, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2192198', 'n_tokens_mistral': 727, 'n_tokens_neox': 705, 'n_words': 228}