-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMobileBasic.dll
More file actions
60 lines (59 loc) · 23.2 KB
/
MobileBasic.dll
File metadata and controls
60 lines (59 loc) · 23.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* ================================//
* Интерпретатор языка JsMobileBasic
* ~~~~~~~~~~by PROPHESSOR~~~~~~~~~~
* ================================//
*/
var $JsMobileBasic={name:"JsMobileBasic",version:"Alpha 9",author:"PROPHESSOR",url:"http://vk.com/JsMobileBasic",Mobile:$Config.Mobile,Debug:!0,canvas:document.getElementById("c"),graphic:!1},$Init={File:[function(){if($Init.File[1]||$JsMobileBasic.Mobile)$Init.File[1]&&!$JsMobileBasic.Mobile?debug("\u041c\u043e\u0434\u0443\u043b\u044c File \u0443\u0436\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d!","background:black;color:#00ff00;"):debug("\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u044c\u0441\u044f \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438");
else try{$File=require("fs"),$Init.File[1]=!0}catch(b){debug("\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u041f\u041e\u041b\u041d\u0423\u042e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u043f\u0440\u043e\u0435\u043a\u0442\u0430!"),debug("{ \u041e\u0448\u0438\u0431\u043a\u0430: "+b+" };"),$Init.File[2]=!0}},!1],
OS:[function(){if($Init.OS[1]||$JsMobileBasic.Mobile)$Init.OS[1]&&!$JsMobileBasic.Mobile?debug("\u041c\u043e\u0434\u0443\u043b\u044c OS \u0443\u0436\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d!","background:black;color:#00ff00;"):debug("\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u044c\u0441\u044f \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438");
else try{$OS=require("os"),$Init.OS[1]=!0}catch(b){debug("\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u041f\u041e\u041b\u041d\u0423\u042e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u043f\u0440\u043e\u0435\u043a\u0442\u0430!"),
debug("{ \u041e\u0448\u0438\u0431\u043a\u0430: "+b+" };"),$Init.OS[2]=!0}},!1],NW:[function(){if($Init.NW[1]||$JsMobileBasic.Mobile)$Init.NW[1]&&!$JsMobileBasic.Mobile?debug("\u041c\u043e\u0434\u0443\u043b\u044c NW \u0443\u0436\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d!","background:black;color:#00ff00;"):debug("\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u044c\u0441\u044f \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438");
else try{$NW=require("nw.gui"),$Init.NW[1]=!0}catch(b){debug("\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 GUI \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u041f\u041e\u041b\u041d\u0423\u042e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u043f\u0440\u043e\u0435\u043a\u0442\u0430!"),debug("{ \u041e\u0448\u0438\u0431\u043a\u0430: "+b+" };"),$Init.NW[2]=!0}},!1,!1],Path:[function(){if($Init.Path[1]||$JsMobileBasic.Mobile)$Init.Path[1]&&
!$JsMobileBasic.Mobile?debug("\u041c\u043e\u0434\u0443\u043b\u044c NW \u0443\u0436\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d!","background:black;color:#00ff00;"):debug("\u0420\u0430\u0431\u043e\u0442\u0430 \u043f\u0443\u0442\u044f\u043c\u0438 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u044c\u0441\u044f \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438");
else try{$Path=require("path"),$Init.Path[1]=!0}catch(b){debug("\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0443\u0442\u044f\u043c\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u041f\u041e\u041b\u041d\u0423\u042e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u043f\u0440\u043e\u0435\u043a\u0442\u0430!"),debug("{ \u041e\u0448\u0438\u0431\u043a\u0430: "+b+" };"),$Init.Path[2]=!0}},!1,!1],
Proc:[function(){if($Init.Proc[1]||$JsMobileBasic.Mobile)$Init.Proc[1]&&!$JsMobileBasic.Mobile?debug("\u041c\u043e\u0434\u0443\u043b\u044c Proc \u0443\u0436\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d!","background:black;color:#00ff00;"):debug("\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u044c\u0441\u044f \u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438");
else try{$Proc=require("child_process"),$Init.Proc[1]=!0}catch(b){debug("\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0443\u0442\u044f\u043c\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u041f\u041e\u041b\u041d\u0423\u042e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u043f\u0440\u043e\u0435\u043a\u0442\u0430!"),debug("{ \u041e\u0448\u0438\u0431\u043a\u0430: "+b+" };"),$Init.Proc[2]=!0}},
!1,!1]};$JsMobileBasic.Mobile?null:debug("#===== \u0412\u043a\u043b\u044e\u0447\u0451\u043d \u0440\u0435\u0436\u0438\u043c \u043e\u0442\u043b\u0430\u0434\u043a\u0438 =====#","color:gray;");$JsMobileBasic.Mobile?null:debug($JsMobileBasic.name,"background:gray;color:yellow;");$JsMobileBasic.Mobile?null:debug($JsMobileBasic.version,"background:gray;color:yellow;");$JsMobileBasic.Mobile?null:debug($JsMobileBasic.author,"background:gray;color:yellow;");
$JsMobileBasic.Mobile?null:debug($JsMobileBasic.url,"background:gray;color:yellow;");$JsMobileBasic.Mobile?null:debug("// ======\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0441\u0440\u0435\u0434\u044b======//","color:gray;");void 0==$Config&&console.error("\u041d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 index.html!");
$Config.fullscreen&&require&&($Init.NW[0](),$Init.NW[2]||NW.Window.get().enterKioskMode());
if("graphic"==$Config.type){$JsMobileBasic.graphic=!0;$JsMobileBasic.Mobile?null:debug("\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u0430!","background:black;color:yellow;");$JsMobileBasic.$style=document.createElement("style");$JsMobileBasic.$style.innerHTML="html{overflow: hidden;} body{margin:0;padding:0;}";document.head.appendChild($JsMobileBasic.$style);var c=document.getElementById("c"),ctx=c.getContext("2d");"*"==$Config.canvas_size[0]&&
"*"==$Config.canvas_size[1]?($JsMobileBasic.Mobile?null:debug("Canvas \u0440\u0430\u0441\u0442\u044f\u043d\u0443\u0442 \u043d\u0430 \u0432\u0435\u0441\u044c \u044d\u043a\u0440\u0430\u043d","background:black;color:#00ff00;"),$JsMobileBasic.Mobile||($Config.canvas_size[2]?debug("\u0412\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043e"):debug("\u0412\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u043e")),c.height=
window.innerHeight,c.width=window.innerWidth,$Config.canvas_size[2]&&(c.style="display:block; margin:0; padding:0; position:fixed; top:0px; left: 0px; width:100%; height:100%;")):($JsMobileBasic.Mobile?null:debug($Config.canvas_size),c.height=$Config.canvas_size[1],c.width=$Config.canvas_size[0])}else $JsMobileBasic.Mobile?null:debug("\u0413\u0440\u0430\u0444\u0438\u043a\u0430 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f!","background:black;color:yellow;"),
c=window,ctx=!1,void 0!=document.getElementById("c")&&document.body.removeChild(document.getElementById("c"));document.getElementsByTagName("title")[0].innerHTML=$Config.name;$JsMobileBasic.Mobile?null:debug("\u0418\u043c\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430: "+$Config.name,"background:brown;color:yellow;");var $Player=[document.getElementById("player0")];
$JsMobileBasic.Mobile?null:debug("// ======\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430======//","color:gray;");var $NW,$Files,$OS,$Path,$Proc,$Mouse={x:0,y:0,lcount:0,rcount:0},$Gel={$Sprite:{}},$Font={family:"arial",size:"10"},$Element={},$Menu={$Bar:{}},PI=Math.PI,G=9.8,RAD2DEG=180/PI,DEG2RAD=PI/180;function setColor(b){ctx.fillStyle=b;ctx.strokeStyle=b;return!0}
function setLineWidth(b){ctx.lineWidth=b;return!0}function fillRect(b,d,e,f){ctx.fillRect(b,d,e,f);return!0}function cls(){clearRect(0,0,screenWidth(),screenHeight());document.getElementById("p").innerHTML="";return!0}function fillScreen(b){ctx.save();setColor(b);fillRect(0,0,screenWidth(),screenHeight());ctx.restore();return!0}function drawRect(b,d,e,f){ctx.strokeRect(b,d,e,f);return!0}function drawPlot(b,d){ctx.save();setLineWidth(1);drawLine(b,d,b+1,d+1);ctx.restore();return!0}
function clearRect(b,d,e,f){ctx.clearRect(b,d,e,f);return!0}function drawLine(b,d,e,f){ctx.beginPath();ctx.moveTo(b,d);ctx.lineTo(e,f);ctx.stroke();return!0}function drawCube(b,d,e,f,g){ctx.strokeRect(b,d,e,f);ctx.strokeRect(b+g/Math.sqrt(2),d+g/Math.sqrt(2),e,f);drawLine(b,d,b+g/Math.sqrt(2),d+g/Math.sqrt(2));drawLine(b+e,d,b+e+g/Math.sqrt(2),d+g/Math.sqrt(2));drawLine(b,d+f,b+g/Math.sqrt(2),d+f+g/Math.sqrt(2));drawLine(b+e,d+f,b+e+g/Math.sqrt(2),d+f+g/Math.sqrt(2));return!0}
function drawArc(b,d,e,f,g,h){void 0==f&&(f=15*Math.PI/7);void 0==g&&(g=13*Math.PI/2);void 0==h&&(h=!1);ctx.beginPath();ctx.arc(b,d,e,f,g,h);ctx.stroke();return!0}function fillArc(b,d,e,f,g,h){void 0==f&&(f=15*Math.PI/7);void 0==g&&(g=13*Math.PI/2);void 0==h&&(h=!1);ctx.beginPath();ctx.arc(b,d,e,f,g,h);ctx.fill();return!0}
function fillRect4(b,d,e,f,g,h,l,k){b=[[b,d],[e,f],[g,h],[l,k]];ctx.beginPath();for(d=0;d<b.length;d++)0==d?ctx.moveTo(b[d][0],b[d][1]):ctx.lineTo(b[d][0],b[d][1]);ctx.fill();return!0}function drawRect4(b,d,e,f,g,h,l,k){b=[[b,d],[e,f],[g,h],[l,k]];ctx.beginPath();for(d=0;d<b.length;d++)0==d?ctx.moveTo(b[d][0],b[d][1]):ctx.lineTo(b[d][0],b[d][1]);ctx.stroke();return!0}
function fillTriangle(b,d,e,f,g,h){b=[[b,d],[e,f],[g,h]];ctx.beginPath();for(d=0;d<b.length;d++)0==d?ctx.moveTo(b[d][0],b[d][1]):ctx.lineTo(b[d][0],b[d][1]);ctx.fill();return!0}function drawTriangle(b,d,e,f,g,h){b=[[b,d],[e,f],[g,h]];ctx.beginPath();for(d=0;d<b.length;d++)0==d?ctx.moveTo(b[d][0],b[d][1]):ctx.lineTo(b[d][0],b[d][1]);ctx.stroke();return!0}function drawString(b,d,e){ctx.fillText(b,d,e);return!0}function setFontSize(b){ctx.font=b+"px "+$Font.family;$Font.size=b;return!0}
function setFont(b){ctx.font=$Font.size+"px "+b;$Font.family=b;return!0}function makeLinearGradient(b,d,e,f){return ctx.createLinearGradient(b,d,e,f)}function makeRadialGradient(b,d,e,f,g,h){return ctx.createRadialGradient(b,d,e,f,g,h)}function setGradientColor(b,d,e){b.addColorStop(d,e);return!0}function gelLoad(b,d){$Gel[d]=new Image;$Gel[d].src=b;return!0}
function spriteGel(b,d){$Gel.$Sprite[d]=new Sprite;$Gel.$Sprite[d].src=b;debug("\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435! \u0424\u0443\u043d\u043a\u0446\u0438\u044f spriteGel \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e! \u041e\u0431\u043d\u043e\u0432\u0438\u0442\u0435\u0441\u044c \u0434\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438!");return!1}
function drawGel(b,d,e){1==$Gel[b].resize?ctx.drawImage($Gel[b],d,e,$Gel[b].w,$Gel[b].h):ctx.drawImage($Gel[b],d,e);return!0}function gelSize(b,d,e){$Gel[b].resize=!0;$Gel[b].w=d;$Gel[b].h=e;return!0}function drawGelFragment(b,d,e,f,g,h,l,k,m){if(void 0==k||void 0==m)k=f,m=g;ctx.drawImage($Gel[b],d,e,f,g,h,l,k,m);return!0}function makeTexture(b,d){void 0==d?d="repeat":null;return ctx.createPattern($Gel[b],d)}function input(b){return prompt(b)}
function println(b){var d=document.getElementById("p");d.style="position:fixed;top:0px;left:0px;width:100%;height:100%;";d.innerHTML+=b+"<br/>";return!0}function playSound(b,d,e){void 0===e&&(e=0);if(void 0===$Player[e]){var f=document.createElement("audio");f.id="player"+e;document.getElementById("audio").appendChild(f);$Player[e]=document.getElementById("player"+e)}$Player[e].src=b;d?$Player[e].setAttribute("loop","1"):$Player[e].setAttribute("loop","0");$Player[e].play();return!0}
function pauseSound(b){void 0===b&&(b=0);if(-1==b){for(var d in $Player)$Player[d].pause();return!0}if(void 0===$Player[b])return debug("\u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u043a\u0430\u043d\u0430\u043b\u0435 \u043d\u0435\u0442 \u043f\u043b\u0435\u0435\u0440\u0430"),!1;$Player[b].pause();return!0}function sqrt(b){return Math.sqrt(b)}function random(b,d){return Math.floor(Math.random()*d+b)}function sin(b){return Math.sin(b)}function cos(b){return Math.cos(b)}
function tan(b){return Math.tan(b)}function ctg(b){return 1/Math.tan}function asin(b){return Math.asin(b)}function acos(b){return Math.acos(b)}function atan(b){return Math.atan(b)}function mod(b,d){return b%d}function abs(b){return Math.abs(b)}function pow(b,d){return Math.pow(b,d)}function log(b){return Math.log(b)}function exp(b){return Math.exp(b)}function limit(b,d,e){b<d&&(b=d);b>e&&(b=e);return b}var min=Math.min,max=Math.max;function rad(b){return 90==b?PI/2:270==b?3*PI/2:b*DEG2RAD}
function deg(b){return b*RAD2DEG}function len(b){return b.length}function str(b){return b.toString}function val(b){return parseInt(b)}function upper(b){return b.toUpperCase}function lower(b){return b.toLowerCase}function mid(b,d,e){return b.substr(d,e)}function chr(b){return String.fromCharCode(str)}function asc(b){return b.charCode}function split(b,d){return b.split(d)}function replace(b,d,e){b.replace(d,e)}int=val;
function saveData(b,d,e){$Init.File[0]();$Init.NW[0]();$Init.Path[0]();b=$Path.join($NW.App.dataPath,b+".json");d=toJSON(d);$File.writeFile(b,d,function(b){if(b)return alert("\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438: "+b.message),!1;e&&e()})}
function readData(b){$Init.File[0]();$Init.NW[0]();$Init.Path[0]();b=$Path.join($NW.App.dataPath,b+".json");b=$File.readFileSync(b,"utf8");var d=parseJSON(b);debug({data:b,json:d});return d}function localSaveData(b,d){"object"==typeof a&&(d=toJSON(d));window.localStorage.setItem(id,d);return!0}function localReadData(b){return parseJSON(window.localStorage.getItem(id))}function parseJSON(b){return JSON.parse(b)}function toJSON(b){return JSON.stringify(b,"",4)}
function menuAdd(b,d,e,f,g){$Init.NW[0]();if($Init.NW[2])return debug("\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u0435\u043d\u044e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e!"),!1;void 0==$Menu[b]&&($Menu[b]=new $NW.Menu);switch(f){case void 0:$Menu[b].append(new $NW.MenuItem({label:d,click:e}));break;case "subMenu":$Menu[b].append(new $NW.MenuItem({label:d,submenu:g}));break;case "checkbox":$Menu[b].append(new $NW.MenuItem({label:d,type:"checkbox",click:e}))}return!0}
function menuShow(b,d,e){if($Init.NW[2])return debug("\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e!"),!1;$Menu[b].popup(d,e);return!0}
function menuAddSeparator(b){$Init.NW[0]();if($Init.NW[2])return debug("\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u0435\u043d\u044e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e!"),!1;void 0==$Menu[b]&&($Menu[b]=new $NW.Menu);$Menu[b].append(new $NW.MenuItem({type:"separator"}));return!0}
function menuBarAdd(b,d,e){$Init.NW[0]();if($Init.NW[2])return debug("\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u0435\u043d\u044e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e!"),!1;void 0==$Menu.$Bar[b]&&($Menu.$Bar[b]=new $NW.Menu({type:"menubar",title:d}));$Menu.$Bar[b].append(new $NW.MenuItem({label:d,submenu:$Menu[e]}));return!0}
function menuBarShow(b){if($Init.NW[2])return debug("\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e!"),!1;$NW.Window.get().menu=$Menu.$Bar[b];return!0}
function getClipboard(b){$Init.NW[0]();if($Init.NW[2])return debug("\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0431\u0443\u0444\u0435\u0440\u043e\u043c \u043e\u0431\u043c\u0435\u043d\u0430 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430!"),!1;var d=$NW.Clipboard.get();void 0==b?b="text":null;return d.get(b)}
function setClipboard(b,d){$Init.NW[0]();if($Init.NW[2])return debug("\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0431\u0443\u0444\u0435\u0440\u043e\u043c \u043e\u0431\u043c\u0435\u043d\u0430 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430!"),!1;var e=$NW.Clipboard.get();void 0==d?d="text":null;e.set(b,d);return!0}
function clearClipboard(){$Init.NW[0]();if($Init.NW[2])return debug("\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0431\u0443\u0444\u0435\u0440\u043e\u043c \u043e\u0431\u043c\u0435\u043d\u0430 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430!"),!1;$NW.Clipboard.get().clear();return!0}
function menuTrayAdd(b,d,e,f){$Init.NW[0]();if($Init.NW[2])return debug("\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0442\u0440\u0435\u0435\u043c \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430!"),!1;(new $NW.Tray({title:d,icon:e,alticon:e})).menu=$Menu[f];return!0}
function execFile(b,d){$Init.Proc[0]();if($Init.Proc[2])return debug("\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430!"),!1;"object"!=typeof d&&(console.warn("\u0412\u0442\u043e\u0440\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 execFile \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043c\u0430\u0441\u0438\u0432\u043e\u043c!"),
d=[]);$Proc.execFile(b,d,function(b,d,g){b&&debug("\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c: "+b);return d})}function include(b){var d=document.createElement("script");d.src=b;d.type="text/javascript";document.getElementById("modules").appendChild(d);return!0}function getModuleName(b){return b.name}function getModuleAuthor(b){b.author}
function getModuleDescription(b){return b.description}function getModuleUrl(b){return b.url}function getModuleVersion(b){return b.version}function screenWidth(){return $JsMobileBasic.graphic?$JsMobileBasic.canvas.width:window.innerWidth}function screenHeight(){return $JsMobileBasic.graphic?$JsMobileBasic.canvas.height:window.innerHeight}function getMouseX(){return $Mouse.x}function getMouseY(){return $Mouse.y}function getLeftClicksCount(){return $Mouse.lcount}
function getRightClicksCount(){return $Mouse.rcount}function log(b){console.log(b);return!0}function debug(b,d){return $Config.Debug_Mode?($JsMobileBasic.Mobile?alert(d):(void 0===d?d="background: black; color: red;":null,console.log("%c "+b,d)),!0):!1}function exit(){window.close();return!0}
function addInputForm(b,d,e,f){var g=document.createElement("input");g.type="text";g.setAttribute("id",b);g.value=d;document.getElementsByTagName("body")[0].appendChild(g);g.style="position: absolute; left:"+e+"px; top:"+f+"px;";return!0}function addInputPassForm(b,d,e,f){var g=document.createElement("input");g.type="password";g.setAttribute("id",b);g.value=d;document.getElementsByTagName("body")[0].appendChild(g);g.style="position: absolute; left:"+e+"px; top:"+f+"px;";return!0}
function addInputRadioForm(b,d,e,f){d=document.createElement("input");d.type="radio";d.setAttribute("id",b);document.getElementsByTagName("body")[0].appendChild(d);d.style="position: absolute; left:"+e+"px; top:"+f+"px;";return!0}function add(b){var d=document.createElement("div");d.innerHTML=b;document.getElementsByTagName("body")[0].appendChild(d);return!0}function addElement(b,d){$Element[b]=document.createElement(d);document.getElementById("includeHTML").appendChild(b);return $Element[b]}
function _eventListeners(){c.addEventListener("mousemove",function(b){$Mouse.x=b.offsetX;$Mouse.y=b.offsetY;"undefined"!==typeof onMouseMove&&onMouseMove(b.pageX,b.pageY)},!1);c.addEventListener("click",function(b){$Mouse.lcount++;"undefined"!==typeof onClick&&onClick(b.pageX,b.pageY)},!1);c.addEventListener("mousedown",function(b){"undefined"!==typeof onMouseDown&&onMouseDown(b.pageX,b.pageY)},!1);c.addEventListener("mouseup",function(b){"undefined"!==typeof onMouseUp&&onMouseUp(b.pageX,b.pageY)},
!1);c.addEventListener("contextmenu",function(b){$Mouse.rcount++;"undefined"!==typeof onRightClick&&onRightClick(b.pageX,b.pageY)},!1);window.addEventListener("keypress",function(b){"undefined"!==typeof onKeyPress&&onKeyPress(b.keyCode)},!1);window.addEventListener("keydown",function(b){"undefined"!==typeof onKeyDown&&onKeyDown(b.keyCode)},!1);window.addEventListener("keyup",function(b){"undefined"!==typeof onKeyUp&&onKeyUp(b.keyCode)},!1)}
document.layers?(\u0441.captureEvents(Event.MOUSEDOWN),\u0441.onmousedown=function(b){if(document.layers||document.getElementById&&!document.all)if(2==b.which||3==b.which)return alert(message),!1}):document.all&&!document.getElementById&&(\u0441.onmousedown=function(){if(2==event.button)return alert(message),!1});document.oncontextmenu=new Function("return false");
$JsMobileBasic.Mobile?null:debug("// ======\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430======//","background:black;color: #00ff00;");
onload=function(){function b(){window.requestAnimationFrame(b);try{Loop()}catch(d){throw Error("\u0412 \u0444\u0430\u0439\u043b\u0435 Autorun.bas \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0445\u0443\u043a Loop()!");}}_eventListeners();try{Main()}catch(d){throw Error("\u0412 \u0444\u0430\u0439\u043b\u0435 Autorun.bas \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0445\u0443\u043a Main()!");}window.requestAnimationFrame||(window.requestAnimationFrame=window.webkitRequestAnimationFrame||
window.mozRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(b){return window.setTimeout(b,1E3/60)});b()};$JsMobileBasic.Mobile?null:debug("// ======\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u0439/\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a======//","color:gray;");