Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Javascript Problem

Featured Replies

No matter what I pick (yes or no), I'm getting the default return....

--------------------------------------

 

var user = prompt("You look like you're in shape, I may let you pass to my kingdom. Are you brave, yes or no?").toLowerCase();
 
 
switch(user) {
    case user == "yes":
        var strong = prompt("Are you strong?");
        var smart = prompt("Are you smart?");
        if(strong === yes && smart === yes){
            console.log("You may pass!");
        }
        else {
            ("You cannot pass, it is much to dangerous for you in there!");
        }
    break;
    case user == "no":
        var swift = prompt("You coward! You may not pass! Are you swift enough to escape my sword!");
        var strong2 = prompt("Are you strong enough to take a hit/ get past the barrier to escape me?");
        if(swift === yes || strong2 === yes) {
            console.log("The knight charges for you, you duck and run away");
        }
        else{
            console.log("The knight slices you in half, you lay dead on the kingdom bridge");
        }
    break;
    case user == "maybe":
        var friendly = prompt("You seem confused, have my sword, IF, you feel you have the power to wield it?");
        if (prompt === yes){
            console.log("Take it, it is of no use to me against most of the people who pass through here!");
            console.log("A troll passes by and you slice him in half, well done!");
        }
        else{
            console.log("Be gone then.");
        }
        break;
    default:
    console.log("You weren't even brave enough to put yes or no, shame on you!");
}

You're using case incorrectly. 

switch (user) {
    case "yes":
        ...
    case "no":
        ...
    case "maybe":
        ...
    default:
        ...
}

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.