main #8
2 changed files with 14 additions and 14 deletions
|
@ -10,9 +10,9 @@ fun getMeow(): String {
|
|||
// source of characters to randomize
|
||||
val mainSrc = "meowrp"
|
||||
// length of meow
|
||||
val meowLength = (0..42).random()
|
||||
var meowLength = (0..42).random()
|
||||
// generate meow based on length and randomized characters
|
||||
val mainMeow =
|
||||
var mainMeow =
|
||||
java.util
|
||||
.Random()
|
||||
.ints(meowLength.toLong(), 0, mainSrc.length)
|
||||
|
@ -114,9 +114,9 @@ fun getMeow(): String {
|
|||
":nkobounce_purple:",
|
||||
)
|
||||
// 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
|
||||
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
|
||||
return if (randomCat == "") {
|
||||
|
@ -132,25 +132,25 @@ fun getBeep(): String {
|
|||
val eSrc = "e"
|
||||
val pSrc = "p"
|
||||
|
||||
val bLength = (1..8).random()
|
||||
val eLength = (1..16).random()
|
||||
val pLength = (1..8).random()
|
||||
var bLength = (1..8).random()
|
||||
var eLength = (1..16).random()
|
||||
var pLength = (1..8).random()
|
||||
|
||||
val bGen =
|
||||
var bGen =
|
||||
java.util
|
||||
.Random()
|
||||
.ints(bLength.toLong(), 0, bSrc.length)
|
||||
.asSequence()
|
||||
.map(bSrc::get)
|
||||
.joinToString("")
|
||||
val eGen =
|
||||
var eGen =
|
||||
java.util
|
||||
.Random()
|
||||
.ints(eLength.toLong(), 0, eSrc.length)
|
||||
.asSequence()
|
||||
.map(eSrc::get)
|
||||
.joinToString("")
|
||||
val pGen =
|
||||
var pGen =
|
||||
java.util
|
||||
.Random()
|
||||
.ints(pLength.toLong(), 0, pSrc.length)
|
||||
|
@ -201,9 +201,9 @@ fun getBeep(): String {
|
|||
":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
|
||||
val randomBalloon = balloon.asSequence().shuffled().find { true }
|
||||
var randomBalloon = balloon.asSequence().shuffled().find { true }
|
||||
|
||||
return if (randomBot == "") {
|
||||
"$bGen$eGen$pGen"
|
||||
|
|
|
@ -64,7 +64,7 @@ fun Application.configureRouting(client: HttpClient) {
|
|||
}
|
||||
// meow button
|
||||
post {
|
||||
val meow = getMeow()
|
||||
var meow = getMeow()
|
||||
if (call.receiveText() == Config().superSecret) {
|
||||
call.response.status(HttpStatusCode(201, "Meow Posted"))
|
||||
makePost(client, meow, Config().instanceDomain)
|
||||
|
@ -88,7 +88,7 @@ fun Application.configureRouting(client: HttpClient) {
|
|||
|
||||
// beep
|
||||
route("/beep") {
|
||||
val beep = getBeep()
|
||||
var beep = getBeep()
|
||||
// get meow timeout
|
||||
get {
|
||||
if (beepTimedOut) {
|
||||
|
|
Loading…
Reference in a new issue