diff --git a/sumorobot.js b/sumorobot.js index 903c934..40b0d48 100755 --- a/sumorobot.js +++ b/sumorobot.js @@ -410,16 +410,12 @@ window.onload = function() { sumostart = true; /* if we are in Python mode */ if (pythonEnabled) { - /* add the an empty block ID to the functions */ - var code = $("#blocklyCode").val().replace(/sumorobot./g, "").replace(/\)/g, ", \"\")"); - /* is_enemy doesn't need the , */ - code = code.replace(/\(, ""\)/g, "(\"\")"); - /* send the code to the SumoRobot */ - sumorobot.send("start:" + code); + /* send the code from the textarea to the SumoRobot */ + sumorobot.send("start:" + $("#blocklyCode").val()); /* otherwise when we are in blockly mode */ } else { - /* send the code to the SumoRobot */ - sumorobot.send("start:" + sumocode.replace(/sumorobot./g, "")); + /* send the code from the blocks to the SumoRobot */ + sumorobot.send("start:" + sumocode); } });