diff options
Diffstat (limited to 'console/src/jsMain')
-rw-r--r-- | console/src/jsMain/kotlin/main.kt | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/console/src/jsMain/kotlin/main.kt b/console/src/jsMain/kotlin/main.kt index 37c99b4..f810c55 100644 --- a/console/src/jsMain/kotlin/main.kt +++ b/console/src/jsMain/kotlin/main.kt @@ -7,7 +7,7 @@ import moe.nea89.website.* import styled.injectGlobal import kotlin.time.Duration.Companion.milliseconds -val isnickrude = true +var isnickrude = true val defaultFileSystem = fileSystem { "etc" { "passwd" text "hunter2" @@ -21,7 +21,14 @@ val defaultFileSystem = fileSystem { } "flag" text "CTF{12345abcdefghijklmonp3.1.4.1.5.9.2.8}" } - +fun redirect(arg: String){ + if(arg.matches("(https://|http://).*")){ + window.location.href = arg + } + else{ + window.location.href = "https://$arg" + } +} fun main() { var startupmsg = "type help to get a list of commands" val root = document.body!!.append.div() @@ -97,5 +104,12 @@ fun main() { console.addLine("bro you don have the password smh") } }) + console.registerCommand(command("vscode", "vsc"){ + console.addLine("ew microsoft") + redirect("https://www.youtube.com/watch?v=lpiB2wMc49g") + }) + console.registerCommand(command("testredirect"){ + redirect(args[0]) + }) }
\ No newline at end of file |