forked from marva/sumorobot-web
fix Python code upload
This commit is contained in:
parent
fabb2cf09c
commit
13d9a967d9
10
sumorobot.js
10
sumorobot.js
@ -408,9 +408,17 @@ window.onload = function() {
|
|||||||
/* start button listener */
|
/* start button listener */
|
||||||
$(".btn-start").click(function() {
|
$(".btn-start").click(function() {
|
||||||
sumostart = true;
|
sumostart = true;
|
||||||
|
/* if we are in Python mode */
|
||||||
if (pythonEnabled) {
|
if (pythonEnabled) {
|
||||||
sumorobot.send("start:" + $("#blocklyCode").val().replace(/sumorobot./g, "").replace(/\)/g, ", \"\")"));
|
/* 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);
|
||||||
|
/* otherwise when we are in blockly mode */
|
||||||
} else {
|
} else {
|
||||||
|
/* send the code to the SumoRobot */
|
||||||
sumorobot.send("start:" + sumocode.replace(/sumorobot./g, ""));
|
sumorobot.send("start:" + sumocode.replace(/sumorobot./g, ""));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user