maybe changing these to being mutable changes things idk
This commit is contained in:
parent
84fd85f768
commit
3d4cfdb1c5
2 changed files with 14 additions and 14 deletions
|
@ -10,9 +10,9 @@ fun getMeow(): String {
|
||||||
// source of characters to randomize
|
// source of characters to randomize
|
||||||
val mainSrc = "meowrp"
|
val mainSrc = "meowrp"
|
||||||
// length of meow
|
// length of meow
|
||||||
val meowLength = (0..42).random()
|
var meowLength = (0..42).random()
|
||||||
// generate meow based on length and randomized characters
|
// generate meow based on length and randomized characters
|
||||||
val mainMeow =
|
var mainMeow =
|
||||||
java.util
|
java.util
|
||||||
.Random()
|
.Random()
|
||||||
.ints(meowLength.toLong(), 0, mainSrc.length)
|
.ints(meowLength.toLong(), 0, mainSrc.length)
|
||||||
|
@ -114,9 +114,9 @@ fun getMeow(): String {
|
||||||
":nkobounce_purple:",
|
":nkobounce_purple:",
|
||||||
)
|
)
|
||||||
// choose a random cat emote out of list
|
// choose a random cat emote out of list
|
||||||
val randomCat = catEmotes.asSequence().shuffled().find { true }
|
var randomCat = catEmotes.asSequence().shuffled().find { true }
|
||||||
// choose a random balloon out of list
|
// choose a random balloon out of list
|
||||||
val randomBalloon = balloon.asSequence().shuffled().find { true }
|
var randomBalloon = balloon.asSequence().shuffled().find { true }
|
||||||
|
|
||||||
// if the neocat returns empty, don't use a balloon, else return cat and random balloon
|
// if the neocat returns empty, don't use a balloon, else return cat and random balloon
|
||||||
return if (randomCat == "") {
|
return if (randomCat == "") {
|
||||||
|
@ -132,25 +132,25 @@ fun getBeep(): String {
|
||||||
val eSrc = "e"
|
val eSrc = "e"
|
||||||
val pSrc = "p"
|
val pSrc = "p"
|
||||||
|
|
||||||
val bLength = (1..8).random()
|
var bLength = (1..8).random()
|
||||||
val eLength = (1..16).random()
|
var eLength = (1..16).random()
|
||||||
val pLength = (1..8).random()
|
var pLength = (1..8).random()
|
||||||
|
|
||||||
val bGen =
|
var bGen =
|
||||||
java.util
|
java.util
|
||||||
.Random()
|
.Random()
|
||||||
.ints(bLength.toLong(), 0, bSrc.length)
|
.ints(bLength.toLong(), 0, bSrc.length)
|
||||||
.asSequence()
|
.asSequence()
|
||||||
.map(bSrc::get)
|
.map(bSrc::get)
|
||||||
.joinToString("")
|
.joinToString("")
|
||||||
val eGen =
|
var eGen =
|
||||||
java.util
|
java.util
|
||||||
.Random()
|
.Random()
|
||||||
.ints(eLength.toLong(), 0, eSrc.length)
|
.ints(eLength.toLong(), 0, eSrc.length)
|
||||||
.asSequence()
|
.asSequence()
|
||||||
.map(eSrc::get)
|
.map(eSrc::get)
|
||||||
.joinToString("")
|
.joinToString("")
|
||||||
val pGen =
|
var pGen =
|
||||||
java.util
|
java.util
|
||||||
.Random()
|
.Random()
|
||||||
.ints(pLength.toLong(), 0, pSrc.length)
|
.ints(pLength.toLong(), 0, pSrc.length)
|
||||||
|
@ -201,9 +201,9 @@ fun getBeep(): String {
|
||||||
":neubot_half_battery_charging:",
|
":neubot_half_battery_charging:",
|
||||||
)
|
)
|
||||||
|
|
||||||
val randomBot = botEmotes.asSequence().shuffled().find { true }
|
var randomBot = botEmotes.asSequence().shuffled().find { true }
|
||||||
// choose a random balloon out of list
|
// choose a random balloon out of list
|
||||||
val randomBalloon = balloon.asSequence().shuffled().find { true }
|
var randomBalloon = balloon.asSequence().shuffled().find { true }
|
||||||
|
|
||||||
return if (randomBot == "") {
|
return if (randomBot == "") {
|
||||||
"$bGen$eGen$pGen"
|
"$bGen$eGen$pGen"
|
||||||
|
|
|
@ -64,7 +64,7 @@ fun Application.configureRouting(client: HttpClient) {
|
||||||
}
|
}
|
||||||
// meow button
|
// meow button
|
||||||
post {
|
post {
|
||||||
val meow = getMeow()
|
var meow = getMeow()
|
||||||
if (call.receiveText() == Config().superSecret) {
|
if (call.receiveText() == Config().superSecret) {
|
||||||
call.response.status(HttpStatusCode(201, "Meow Posted"))
|
call.response.status(HttpStatusCode(201, "Meow Posted"))
|
||||||
makePost(client, meow, Config().instanceDomain)
|
makePost(client, meow, Config().instanceDomain)
|
||||||
|
@ -88,7 +88,7 @@ fun Application.configureRouting(client: HttpClient) {
|
||||||
|
|
||||||
// beep
|
// beep
|
||||||
route("/beep") {
|
route("/beep") {
|
||||||
val beep = getBeep()
|
var beep = getBeep()
|
||||||
// get meow timeout
|
// get meow timeout
|
||||||
get {
|
get {
|
||||||
if (beepTimedOut) {
|
if (beepTimedOut) {
|
||||||
|
|
Loading…
Reference in a new issue