bootbox
-
is there a way to add this into netsblox? i tried, but it did not seem to work! it gives me an error. how do i do this on netsblox?
---------to see what i mean, you are running it right now! press
Ctrl+Shift+I
and select console.type
bootbox.alert("see?")
-
@topgamerpro16 You'll have to install the library first before using it.
Put this into a JSFunction block:const libs = ['https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js', 'https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js', 'https://cdnjs.cloudflare.com/ajax/libs/bootbox.js/5.4.0/bootbox.min.js'];
let finished = false;
function loadCss() {
const link = document.createElement('link');
link.setAttribute('rel', 'stylesheet');
link.setAttribute('type','text/css');
link.href = 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css';
link.onload = () => (finished = true);
document.head.appendChild(link);
}
function loadLib(lib, last = false) {
const script = document.createElement('script);
script.src = lib;
script.onload = (function () {
if (last) {
return loadCss;
} else if (libs.indexOf(lib) === libs.length - 2) {
return () => loadLib(libs[libs.length - 1], true);
} else {
return () => loadLib(libs[libs.indexOf(lib) + 1]);
}
})();
document.head.appendChild(script);
}
loadLib(libs[0]);
return () => finished;then:
wait until [call [the JSFunction]]
-
@programmeruser is it you from snap?
also, thats a hella lotta code! ill try it.
-
oh and tell whoever was asking about left and middle clicking, tell them to run this:
main = false;
middle = false;
context = false;
x = 0;
y = 0;
document.addEventListener("mousemove", function(e) {x = e.movementX; y = e.movementY;}, false);
document.documentElement.requestPointerLock();
document.addEventListener("mousedown", function(e) {
switch (e.button) {
case 0:
main = true;
break;
case 1:
middle = true;
break;
case 2:
context = true;
break;
};
any = true;
});
document.addEventListener("mouseup", function(e) {
switch (e.button) {
case 0:
main = false;
break;
case 1:
middle = false;
break;
case 2:
context = false;
break;
};
any = false;
});
setInterval(function() {
x = 0; y = 0;
}, 1);ignore the pointerlock, and anything that affects the variables x or y.
also, to get them, just call main, context, or middle.
-
@programmeruser said in bootbox:
const script = document.createElement('script);
one more thing just to have a little fun.....
ya misd sumtheeng
also that doesnt work even if i make it a legitimate string.
i tri
-
@topgamerpro16 what do you mean? Do you mean the person who asked about how to move the mouse?
-
@programmeruser i mean about right left clicking and middle clicking and right clicking.
-
Anyways, try looking for a js dialog library that doesn't have so many dependencies.