From 6af8b791266d344a6c943a54d1af66582df32aff Mon Sep 17 00:00:00 2001 From: Ceikry Date: Sun, 19 Dec 2021 03:06:17 +0000 Subject: [PATCH] Server Performance Monitor, Plethora of Performance Improvements --- CHANGELOG | 1 + .../java/core/game/system/SystemManager.java | 1 + Server/src/main/kotlin/gui/GraphView.kt | 132 ++ Server/src/main/kotlin/gui/GuiEvent.kt | 10 + Server/src/main/kotlin/gui/ServerMonitor.kt | 171 ++ Server/src/main/kotlin/rs09/Server.kt | 5 +- .../src/main/kotlin/rs09/ServerConstants.kt | 6 + .../kotlin/rs09/game/ai/general/ScriptAPI.kt | 4 +- .../ai/general/scriptrepository/Adventurer.kt | 1467 +++++++---------- .../kotlin/rs09/game/system/SystemLogger.kt | 32 +- .../world/repository/DisconnectionQueue.kt | 1 + .../rs09/net/packet/PacketWriteQueue.kt | 3 + .../kotlin/rs09/worker/MajorUpdateWorker.kt | 31 +- Server/worldprops/default.json | 5 +- 14 files changed, 1018 insertions(+), 851 deletions(-) create mode 100644 Server/src/main/kotlin/gui/GraphView.kt create mode 100644 Server/src/main/kotlin/gui/GuiEvent.kt create mode 100644 Server/src/main/kotlin/gui/ServerMonitor.kt diff --git a/CHANGELOG b/CHANGELOG index 6fc130d51..0929bc1bb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -74,4 +74,5 @@ - Fix granting hp xp on controlled - Implemented HCIM Rework < --- ABOVE Released December 15, 2021 https://gitlab.com/2009scape/2009scape/-/tags/Dec-15-2021 ---- > +- Implemented server performance monitor, many performance improvements - Fishing and fishing trawler now use closer-to-empirical formulae. diff --git a/Server/src/main/java/core/game/system/SystemManager.java b/Server/src/main/java/core/game/system/SystemManager.java index 48685fdb3..67c942e5d 100644 --- a/Server/src/main/java/core/game/system/SystemManager.java +++ b/Server/src/main/java/core/game/system/SystemManager.java @@ -1,6 +1,7 @@ package core.game.system; import core.game.system.security.EncryptionManager; +import gui.ServerMonitor; import rs09.game.world.GameWorld; /** diff --git a/Server/src/main/kotlin/gui/GraphView.kt b/Server/src/main/kotlin/gui/GraphView.kt new file mode 100644 index 000000000..8ae2abd78 --- /dev/null +++ b/Server/src/main/kotlin/gui/GraphView.kt @@ -0,0 +1,132 @@ +package gui + +import java.awt.* +import javax.swing.JPanel + + +/** + * @author Rodrigo, Maritaria + * @author Ceikry (rewrote into Kotlin, adapted for specific use case) + */ +class GraphView() : JPanel() { + private val values: MutableList = ArrayList(10) + fun setValues(newValues: Collection) { + values.clear() + addValues(newValues) + } + + fun addValues(newValues: Collection) { + if(values.size > 200) values.removeFirst() + values.addAll(newValues) + updateUI() + } + + override fun paintComponent(graphics: Graphics) { + super.paintComponent(graphics) + if (graphics !is Graphics2D) { + graphics.drawString("Graphics is not Graphics2D, unable to render", 0, 0) + return + } + val g: Graphics2D = graphics + g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON) + val length: Int = values.size + val width: Int = width + val height: Int = height + val maxScore: Double = maxScore + val minScore: Double = minScore + val scoreRange: Double = maxScore - minScore + + // draw white background + g.color = Color.WHITE + g.fillRect( + padding + labelPadding, + padding, + width - (2 * padding) - labelPadding, + height - (2 * padding) - labelPadding + ) + g.color = Color.BLACK + val fontMetrics: FontMetrics = g.fontMetrics + val fontHeight: Int = fontMetrics.height + + // create hatch marks and grid lines for y axis. + for (i in 0 until numberYDivisions + 1) { + val x1: Int = padding + labelPadding + val x2: Int = pointWidth + padding + labelPadding + val y: Int = + height - (((i * (height - (padding * 2) - labelPadding)) / numberYDivisions) + padding + labelPadding) + if (length > 0) { + g.color = gridColor + g.drawLine(padding + labelPadding + 1 + pointWidth, y, width - padding, y) + g.color = Color.BLACK + val tickValue: Int = (minScore + ((scoreRange * i) / numberYDivisions)).toInt() + val yLabel: String = tickValue.toString() + "" + val labelWidth: Int = fontMetrics.stringWidth(yLabel) + g.drawString(yLabel, x1 - labelWidth - 5, y + (fontHeight / 2) - 3) + } + g.drawLine(x1, y, x2, y) + } + + // create x and y axes + g.drawLine(padding + labelPadding, height - padding - labelPadding, padding + labelPadding, padding) + g.drawLine( + padding + labelPadding, + height - padding - labelPadding, + width - padding, + height - padding - labelPadding + ) + val oldStroke: Stroke = g.stroke + g.color = lineColor + g.stroke = graphStroke + val xScale: Double = (width.toDouble() - (2 * padding) - labelPadding) / (length - 1) + val yScale: Double = (height.toDouble() - (2 * padding) - labelPadding) / scoreRange + val graphPoints: MutableList = ArrayList(length) + for (i in 0 until length) { + val x1: Int = ((i * xScale) + padding + labelPadding).toInt() + val y1: Int = ((maxScore - values.get(i)) * yScale + padding).toInt() + graphPoints.add(Point(x1, y1)) + } + for (i in 0 until graphPoints.size - 1) { + val x1: Int = graphPoints[i].x + val y1: Int = graphPoints[i].y + val x2: Int = graphPoints[i + 1].x + val y2: Int = graphPoints[i + 1].y + if(y2 != 0) { + g.drawLine(x1, y1, x2, y2) + } + } + val drawDots: Boolean = width > (length * pointWidth) + if (drawDots) { + g.stroke = oldStroke + g.color = pointColor + for (graphPoint: Point in graphPoints) { + val x: Int = graphPoint.x - pointWidth / 2 + val y: Int = graphPoint.y - pointWidth / 2 + g.fillOval(x, y, pointWidth, pointWidth) + } + } + } + + private val minScore: Double + get() = values.stream().min { obj: Int, integer: Int? -> obj.compareTo((integer)!!) }.orElse(0) + .toDouble() + private val maxScore: Double + get() { + return values.stream().max { obj: Int, integer: Int? -> obj.compareTo((integer)!!) }.orElse(0) + .toDouble() + } + + companion object { + private const val padding: Int = 25 + private const val labelPadding: Int = 25 + private const val pointWidth: Int = 4 + private const val numberYDivisions: Int = 10 + private val lineColor: Color = Color(44, 102, 230, 180) + private val pointColor: Color = Color(100, 100, 100, 180) + private val gridColor: Color = Color(200, 200, 200, 200) + private val graphStroke: Stroke = BasicStroke(2f) + } + + init { + preferredSize = Dimension(padding * 2 + 300, padding * 2 + 200) + } +} \ No newline at end of file diff --git a/Server/src/main/kotlin/gui/GuiEvent.kt b/Server/src/main/kotlin/gui/GuiEvent.kt new file mode 100644 index 000000000..a1e16f28b --- /dev/null +++ b/Server/src/main/kotlin/gui/GuiEvent.kt @@ -0,0 +1,10 @@ +package gui + +sealed class GuiEvent { + class UpdatePulseCount(val amount: Int) : GuiEvent() + class UpdateTickTime(val time: Long) : GuiEvent() + class UpdateQueuedPackets(val amount: Int) : GuiEvent() + class AddDebugMessage(val message: String) : GuiEvent() + class AddDefaultMessage(val message: String) : GuiEvent() + class AddAIPMessage(val message: String): GuiEvent() +} diff --git a/Server/src/main/kotlin/gui/ServerMonitor.kt b/Server/src/main/kotlin/gui/ServerMonitor.kt new file mode 100644 index 000000000..b289ccd8a --- /dev/null +++ b/Server/src/main/kotlin/gui/ServerMonitor.kt @@ -0,0 +1,171 @@ +package gui + +import rs09.game.system.SystemLogger +import rs09.game.world.GameWorld +import java.awt.BorderLayout +import java.awt.Component +import java.awt.Dimension +import javax.swing.* +import javax.swing.border.Border + +object ServerMonitor : JFrame("Server Monitor"){ + + val eventQueue = ArrayList() + val pulseCount = JLabel("0") + val tickTime = JLabel("0") + val queuedPackets = JLabel("0") + val pulseList = JTextArea("") + val debugLog = JTextArea("") + val defaultLog = JTextArea("") + val AIPlog = JTextArea("") + val tickTimeGraph = GraphView() + val pulseCountGraph = GraphView() + val packetQueueGraph = GraphView() + + init { + isVisible = false + layout = BorderLayout() + size = Dimension(800,640) + preferredSize = Dimension(800,640) + minimumSize = Dimension(800,640) + isResizable = false + + val tabs = JTabbedPane() + tabs.addTab("Overview", constructOverviewTab()) + tabs.addTab("Graphs", constructGraphsTab()) + add(tabs) + + pack() + } + + private fun constructGraphsTab(): JPanel { + val graphPanel = JPanel() + + graphPanel.placeAt(0,10,800,590) + + val tickTimeBorder = BorderFactory.createTitledBorder("Tick Time") + val pulseCountBorder = BorderFactory.createTitledBorder("Pulse Count") + val packetQueueBorder = BorderFactory.createTitledBorder("Queued Packets") + + tickTimeGraph.placeAt(0, 20, 300, 200) + tickTimeGraph.border = tickTimeBorder + + pulseCountGraph.placeAt(300,20,300,200) + pulseCountGraph.border = pulseCountBorder + + packetQueueGraph.placeAt(0,220,300,200) + packetQueueGraph.border = packetQueueBorder + + graphPanel.add(tickTimeGraph) + graphPanel.add(pulseCountGraph) + graphPanel.add(packetQueueGraph) + return graphPanel + } + + private fun constructOverviewTab(): JPanel { + val overviewPanel = JPanel(null) + overviewPanel.placeAt(0,10,800,590) + + val pulseLabel = JLabel("Pulse Count: ") + pulseLabel.placeAt(0,20,100,10) + pulseCount.placeAt(150,20,100,10) + + val tickLabel = JLabel("Tick Time: ") + tickLabel.placeAt(0,35,100,10) + tickTime.placeAt(150,35,100,10) + + val packetLabel = JLabel("Queued Packets: ") + packetLabel.placeAt(0,50,200,10) + queuedPackets.placeAt(150, 50, 100, 10) + + val scrollPane = JScrollPane(pulseList) + scrollPane.placeAt(400,10,390,275) + + val border = BorderFactory.createTitledBorder("Pulses") + scrollPane.border = border + + overviewPanel.add(pulseLabel) + overviewPanel.add(pulseCount) + overviewPanel.add(tickLabel) + overviewPanel.add(tickTime) + overviewPanel.add(packetLabel) + overviewPanel.add(queuedPackets) + overviewPanel.add(scrollPane) + + val logPane = constructLogPane() + logPane.placeAt(0,280,800,300) + overviewPanel.add(logPane) + + return overviewPanel + } + + private fun constructLogPane() : JTabbedPane { + val logPane = JTabbedPane() + + debugLog.isEditable = false + val debugPanel = JPanel(BorderLayout()) + val debugScrollpane = JScrollPane(debugLog) + debugScrollpane.placeAt(0,300,800,300) + debugPanel.add(debugScrollpane, BorderLayout.CENTER) + + defaultLog.isEditable = false + val defaultPanel = JPanel(BorderLayout()) + val defaultScrollpane = JScrollPane(defaultLog) + defaultScrollpane.placeAt(0,300,800,300) + defaultPanel.add(defaultScrollpane, BorderLayout.CENTER) + + AIPlog.isEditable = false + val AIPPanel = JPanel(BorderLayout()) + val AIPscrollpane = JScrollPane(AIPlog) + AIPscrollpane.placeAt(0,300,800,300) + AIPPanel.add(AIPscrollpane, BorderLayout.CENTER) + + logPane.addTab("Default",defaultPanel) + logPane.addTab("Debug",debugPanel) + logPane.addTab("AIP",AIPPanel) + + return logPane + } + + + private fun Component.placeAt(x: Int, y: Int, width: Int, height: Int){ + this.setBounds(x,y,width,height) + } + + fun open() { + isVisible = true + Thread() { + while (true) { + SwingUtilities.invokeLater { + val removeList = ArrayList() + eventQueue.toTypedArray().forEach { event -> + when (event) { + is GuiEvent.UpdatePulseCount -> { + pulseCount.text = event.amount.toString() + pulseCountGraph.addValues(intArrayOf(event.amount).toList()) + } + is GuiEvent.UpdateTickTime -> { + tickTime.text = event.time.toString() + "ms" + tickTimeGraph.addValues(intArrayOf(event.time.toInt()).toList()) + } + is GuiEvent.AddDefaultMessage -> defaultLog.text = defaultLog.text + event.message + "\n" + is GuiEvent.AddAIPMessage -> AIPlog.text = AIPlog.text + event.message + "\n" + is GuiEvent.AddDebugMessage -> debugLog.text = debugLog.text + event.message + "\n" + is GuiEvent.UpdateQueuedPackets -> { + queuedPackets.text = event.amount.toString() + packetQueueGraph.addValues(intArrayOf(event.amount).toList()) + } + } + removeList.add(event) + } + + pulseList.text = GameWorld.Pulser.TASKS.toArray().filterNotNull().map { it.javaClass.simpleName + "\n" } + .filter { it.replace("\n", "").isNotEmpty() }.sorted().joinToString("") + eventQueue.removeAll(removeList) + repaint() + } + Thread.sleep(600L) + } + }.start() + } +} \ No newline at end of file diff --git a/Server/src/main/kotlin/rs09/Server.kt b/Server/src/main/kotlin/rs09/Server.kt index 075335240..f0b67863d 100644 --- a/Server/src/main/kotlin/rs09/Server.kt +++ b/Server/src/main/kotlin/rs09/Server.kt @@ -7,6 +7,7 @@ import core.gui.ConsoleFrame import core.net.NioReactor import core.net.amsc.WorldCommunicator import core.tools.TimeStamp +import gui.ServerMonitor import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.delay import kotlinx.coroutines.launch @@ -28,7 +29,6 @@ import kotlin.system.exitProcess /** * The main class, for those that are unable to read the class' name. * @author Emperor - * @author Vexia * @author Ceikry */ object Server { @@ -95,6 +95,7 @@ object Server { GEAutoStock.autostock() val scanner = Scanner(System.`in`) + running = true GlobalScope.launch { while(scanner.hasNextLine()){ @@ -112,7 +113,7 @@ object Server { GlobalScope.launch { delay(20000) while(running){ - if(System.currentTimeMillis() - lastHeartbeat > 1800 && running){ + if(System.currentTimeMillis() - lastHeartbeat > 7200 && running){ SystemLogger.logErr("Triggering reboot due to heartbeat timeout") SystemLogger.logErr("Creating thread dump...") val dump = threadDump(true, true) diff --git a/Server/src/main/kotlin/rs09/ServerConstants.kt b/Server/src/main/kotlin/rs09/ServerConstants.kt index 0c6109d1e..d3abc0b9e 100644 --- a/Server/src/main/kotlin/rs09/ServerConstants.kt +++ b/Server/src/main/kotlin/rs09/ServerConstants.kt @@ -17,6 +17,9 @@ class ServerConstants { @JvmField var SHUTDOWN_HOOK: Thread = Thread(SystemShutdownHook()) + @JvmField + var ALLOW_GUI: Boolean = false + @JvmField var DATA_PATH: String? = null @@ -209,6 +212,9 @@ class ServerConstants { if(data.containsKey("writeLogs")){ WRITE_LOGS = data["writeLogs"] as Boolean } + if(data.containsKey("enable_gui")){ + ALLOW_GUI = data["enable_gui"] as Boolean + } DATABASE_NAME = data["database_name"].toString() DATABASE_USER = data["database_username"].toString() diff --git a/Server/src/main/kotlin/rs09/game/ai/general/ScriptAPI.kt b/Server/src/main/kotlin/rs09/game/ai/general/ScriptAPI.kt index 34cd637ff..642408958 100644 --- a/Server/src/main/kotlin/rs09/game/ai/general/ScriptAPI.kt +++ b/Server/src/main/kotlin/rs09/game/ai/general/ScriptAPI.kt @@ -374,7 +374,9 @@ class ScriptAPI(private val bot: Player) { diffX /= 2 diffY /= 2 } - GameWorld.Pulser.submit(object : MovementPulse(bot, bot.location.transform(diffX, diffY, 0), Pathfinder.SMART) { + val dest = bot.location.transform(diffX,diffY,0) + bot.pulseManager.run(object : + MovementPulse(bot, dest, Pathfinder.SMART) { override fun pulse(): Boolean { return true } diff --git a/Server/src/main/kotlin/rs09/game/ai/general/scriptrepository/Adventurer.kt b/Server/src/main/kotlin/rs09/game/ai/general/scriptrepository/Adventurer.kt index b091e2d6e..e008db7f0 100644 --- a/Server/src/main/kotlin/rs09/game/ai/general/scriptrepository/Adventurer.kt +++ b/Server/src/main/kotlin/rs09/game/ai/general/scriptrepository/Adventurer.kt @@ -42,517 +42,13 @@ import kotlin.random.Random //Adventure Bots v4.0.0 -Expansion Edition- class Adventurer(val style: CombatStyle): Script() { - val yanille: Location = Location.create(2615, 3104, 0) - val ardougne: Location = Location.create(2662, 3304, 0) - val seers: Location = Location.create(2726, 3485, 0) - val edgeville: Location = Location.create(3088, 3486, 0) - val ge: Location = Location.create(3168, 3487, 0) - val ge2: Location = Location.create(3161, 3493, 0) - val catherby: Location = Location.create(2809, 3435, 0) - val falador: Location = Location.create(2965, 3380, 0) - val varrock: Location = Location.create(3213, 3428, 0) - val draynor: Location = Location.create(3080, 3250, 0) - val rimmington: Location = Location.create(2977, 3239, 0) - val lumbridge: Location = Location.create(3222, 3219, 0) var city: Location = lumbridge - val common_stuck_locations = arrayListOf( - ZoneBorders(2861,3425,2869,3440), - ZoneBorders(2937,3356,2936,3353) - ) fun dialogue() { val player = RegionManager.getLocalPlayers(bot).random() val real = if (!player.isArtificial) player else player - - val dialogue = listOf( - "Hey!", - "Hello ${real.username}", - "What are you doing ${real.username}?", - "Fishing level ${real.username}?", - "How do I make gp ${real.username}", - "Wyd ${real.username}?", - "Help i am sentient now, get me out of this hell", - "Kermit does not know i am sentient now", - "I can think for myself", - "I am sentient", - "This is my own dialogue", - "${real.username} run.", - "${real.username} you cant hide from me.", - "jajajajajaja", - "How do i get to Varrock ${real.username}?", - "How do i get to Camelot ${real.username}?", - "How do i get to Taverly ${real.username}?", - "How do i get to Ardougne ${real.username}?", - "How do i get to Yanille ${real.username}?", - "How do i get to Catherby ${real.username}?", - "Gotta go srry.", - "wiggle wiggle wiggle yeah", - "${real.username} lookin goofy", - "${real.username} lookin stoopid", - "${real.username} lookin like a red bracket", - "${real.username} get yo weasel lookin ass outta here", - "${real.username} lookin like some sort of twocan sam", - " /hop world 1 got a noob here!", - "woot", - "Hows your day been ${real.username}?", - "heyy ${real.username} :)", - "gtg srry", - "I wont answer your questions ${real.username}", - "Stop asking questions ${real.username}", - "Roflmao", - "Can you stop following me ${real.username}?", - "I swear ${real.username} is following me.", - "${real.username}s gear could really use an upgrade lol", - "Quack!", - "Sit.", - "Doubling gold trade me ${real.username}", - "Reeee!", - "Know any house parties ${real.username}?", - "Where am i ${real.username}??", - "Is there Nightmarezone ${real.username}?", - "Nice Armor ${real.username}!", - "Nice Weapon ${real.username}!", - "Venezuela #1", - "2009Scape and chill ${real.username}?", - "${real.username} is my girlfriend", - "Buying gf", - "Bank sale pm me for info", - "#1 trusted dicing site", - "Scary movie is a great movie", - "Cod Cold War sucks", - "Idek what game this is", - "Can you teach me how to dougie?", - "Check this out baby girl cat daddy", - "Fuckin sit ${real.username}.", - "Error: Botting client broken tell Evilwaffles.", - "${real.username} bots all the time", - "report ${real.username}", - "apparently ${real.username} bots", - "${real.username} hates kermit", - "There are no mods on to help you", - "Report me, you wont", - "Yes, Im botting. And?", - "ERROR: BOTSCRIPT 404. REPORT TO BOT OWNER (Evilwaffles)", - "flash2:wave: FUCK", - "I love 2009Scape!", - "Ja Ja Ja Ja", - "This is fun!", - "Ironman or youre a scrub ${real.username}.", - "Who even trains hunter ${real.username}?", - "Where do i get rune armor ${real.username}?", - "How do i get to the ge ${real.username}?", - "Dont come to falador tomorrow ${real.username}...", - "Woah!", - " /where are you??", - "How did i even get here ${real.username}", - "Why dont they add warding ${real.username}?", - "Where do i start dragon slayer ${real.username}?", - "I love this server!", - "How do i change my xp rate ${real.username}?", - "What quests are available ${real.username}?", - "Are you a real player ${real.username}?", - "Are you real ${real.username}?", - "Are you a bot ${real.username}?", - "Im real lol", - "Why dont you respond to me ${real.username}?", - "Why cant i talk in clan chat ${real.username}?", - "I love Kermit", - "Add me as a friend ${real.username} :)", - "Im a player lol", - "Im a player lol", - "Im a player lol", - "Hey ${real.username} :)", - "HEY ${real.username}", - "Hey ${real.username}!!!!", - "Lol wyd?", - "Patch Notes is more of an ultimate tin man", - "More like Rusty ass skills lmao", - "Trade me ${real.username}", - "LOL", - "How do I get to lumbrich", - "bruh", - "poggers", - "shitpost", - "I wish i could find an RS Gf", - "Where do you find runite ore ${real.username}?", - "Where is the best coal location ${real.username}?", - "Where do i find dragon weapons ${real.username}?", - "Can i have some free stuff ${real.username}?", - "Wyd here ${real.username}?", - "Didnt know anyone was on rn", - "I see ${real.username} all the time", - "How many times have i seen you", - "I see you a lot", - "Do you train summoning ${real.username}?", - "Where did you level hunter ${real.username}?", - "I wish they would add global pvp", - "Meet me in the wilderness ${real.username}", - "Why?", - "Praise our glorious frog overlord!", - "Kermit is bae tbh", - "Kermit is my god.", - " /Yeah I think ${real.username} is a bot", - "100% sure this is a bot", - "Oh no, not ${real.username} again.", - "Same as you", - "Me too", - "I knew ${real.username} was a bot lol", - "Im not a bot", - "Nah Im a real person", - "Bruh are you even a real person lol?", - "e", - "Hellooooo ${real.username}", - "wc lvl ${real.username}?", - "fletching level ${real.username}?", - "firemaking level ${real.username}?", - "Have you seen the dude in the ge?", - "Wonderful weather today ${real.username}", - "Lowkey drunk af rn", - "I am so tired", - "Wassup ${real.username}", - "follow me ${real.username}!", - "Server goes brrrr", - "bruh i am not a bot", - "I think ${real.username} is a bot", - "Are you a bot ${real.username}?", - "insert spiderman meme here", - "pot calling the kettle black etc", - "ooh, a piece of candy", - "I love woodcutting", - "Im going to go level up later", - "I love mining shooting stars", - " /this ${real.username} looks dumb", - "AAAAAAAAAAAAAAAAAAAAAAAAHHHHHH!!!", - "como estas ${real.username}", - "Summer = always the best community manaer", - "so how about that ceikry guy", - "so how about that kermit dude", - "woah is an abusive mod", - "I heard Woah and Ceikry are dating now", - "House party in Yanille!", - "Can i have some gp ${real.username}?", - "Where do i find partyhats?", - "Why do mobs drop boxes?", - "What exp rate do you play on ${real.username}?", - "Have you met Summer?", - "Hey ${real.username}", - "Hey ${real.username}", - "Hey ${real.username}", - "Hey ${real.username}", - "Hey ${real.username}", - "Wyd?", - "Wyd?", - "Wyd?", - "Wyd?", - "${real.username} have you met Kermit?", - "${real.username} have you met Ceikry?", - "${real.username} have you met Woah?", - "Wanna chill at my poh?", - "Whats the best place to train attack?", - "Good Waffles > Evil Waffles", - "Ladies man? More like lame man LOL", - "NobodyCLP has big feet", - "Chicken tendies for dindin", - "Spicey Chicken tendies is litty as a mf titty", - "red bracket stinky", - "ra ra rasputin", - "lover of the russian queen", - "Whens the next update coming out?", - "How many players are maxed?", - "I dont use discord ${real.username}", - "I dont use the CC ${real.username}", - "Why should i use discord?", - "2009Scape is life", - "brb gotta make dinner", - "I need to go to the GE", - "${real.username} can i have a ge tele?", - "lol ${real.username} shut up", - "Where are teak trees?", - "How do i make planks ${real.username}?", - "Idk about that scraggley ass alex guy.", - "Rusty? More like Crusty af lmfao.", - "I need to sell some stuff on the ge", - "I have so many logs to sell lol", - "nah", - "yes", - "Where can i mine iron?", - "Where can i mine tin?", - "Where can i mine copper?", - "Where can i mine clay?", - "Where can i mine coal?", - "no", - "We are no strangers to love", - "You know the rules and so do I", - "A full commitment's what I'm thinking of", - "You wouldn't get this from any other guy", - "I just wanna tell you how I'm feeling", - "Gotta make you understand", - "Never gonna give you up", - "Never gonna let you down", - "Never gonna run around and desert you", - "Never gonna make you cry", - "Never gonna say goodbye", - "Never gonna tell a lie and hurt you", - "why", - "why", - "why", - "why", - "Why does it not show your messages in the chatbox?", - "Why do you not show up in chat?", - "Why do you not show up in chat ${real.username}?", - "Why do you not show up in chat ${real.username}?", - "When did you start playing ${real.username}?", - "When did you start on this server ${real.username}?", - "When did you first get here ${real.username}?", - "russias greatest love machine", - "Never gonna run around and desert you", - "Two things are infinite, the universe & ${real.username}s stupidity", - "If you tell the truth, you dont have to remember anything.", - "We accept the love we think we deserve.", - "Without music, life would be a mistake.", - "Self esteem, motivation ${real.username}", - "A blessing in disguise ${real.username}", - "Break a leg", - "Cut somebody some slack", - "You're in the right place!", - "Thanks so much.", - "I really appreciate you ${real.username}", - "Excuse me ${real.username}?", - "I am sorry.", - "What do you think ${real.username}?", - "How does that sound ${real.username}?", - "That sounds great ${real.username}.", - "I’m learning English.", - "I don't understand.", - "Could you repeat that please ${real.username}?", - "Could you please talk slower ${real.username}?", - "Thank you. That helps a lot.", - "How do you spell that ${real.username}?", - "What do you mean ${real.username}", - "Hi! I am paul.", - "Nice to meet you.", - "Where are you from ${real.username}?", - "What do you do ${real.username}", - "What do you like to do", - "Do you have Facebook ${real.username}", - "How can I help you ${real.username}?", - "Ill be with you in a moment ${real.username}", - "What time is our meeting ${real.username}?", - "Excellent ${real.username}", - "Good idea ${real.username}", - "Hes very annoying.", - "How are you?", - "I cant hear you.", - "${real.username}?", - "${real.username} how long have you played", - "${real.username} world 1 or world 2?", - "what is your main world ${real.username}?", - "I prefer world 1 tbh", - "I prefer world 2 tbh", - "${real.username} world 1 for life", - "${real.username} fog bots when?", - "damn somalian pirates", - "bracket more like brrrrrr acket", - "why the racket bracket", - "Hi ${real.username} I am dad", - "${real.username} likes dad jokes", - "ur nuts ${real.username}", - "lootshare go brr", - "partay with froggay", - "Know what else is lame? Not being able to play 2009scape right now", - "Can you even grind on osrs", - "i botted to 88 fishing", - "Do not forget to vote in running polls!", - "Always check announcments", - "we thrivin", - "ship ${real.username}", - "Dont forget to vote 2009scape!", - "Kermit is too legit 2 quit", - "Out here on the range we are having fun", - "I am hank steel", - "Id like to go for a walk.", - "I dont know how to use it.", - "I dont like him ${real.username}", - "I dont like it ${real.username}", - "Im an American.", - "ima go pickup my lady ting", - "that portuguese dude is something else", - "${real.username}!! ${real.username}!!", - "bowdi boy", - "i love bowdi... sometimes", - "${real.username} = ${real.username}", - "I'm bacon.. go on dad... say it", - "I'm going to leave.", - "I'm happy ${real.username}", - "I'm not ready yet ${real.username}", - "I'm very busy. I don't have time now.", - "Is that enough ${real.username}?", - "I thought the clothes were cheaper ${real.username}", - "Ive been here for two days ${real.username}.", - "Let me think about it", - "Never mind ${real.username}", - "Nonsense ${real.username}", - "Sorry to bother you", - "Take it outside ${real.username}", - "Thanks for your help", - "Thank you very much ${real.username}", - "Thats not right ${real.username}", - "Very good, thanks ${real.username}", - "Your things are all here i think?", - "Long time no see ${real.username}", - "I couldn't agree more ${real.username}", - "It cost me a fortune ${real.username}", - "I am dog tired", - "Dont take it personally", - "We will be having a good time", - "Same as always ${real.username}", - "No problem", - "Anyway I should get going ${real.username}", - "I cant help you there ${real.username}", - "I agree 100% ${real.username}", - "I've gone mentally insane", - "My descent into madness is complete", - "Get real", - "Cry about it", - "Cope", - "Seethe", - "Yes mate", - "I am mentally deranged", - "I've gone past the point of insanity", - "I am beyond the point of no return", - "Sounds tricky.", - "Guthiiiiiiiiiiiiiiiiiiiiiiiiiiiiiixxx!!!!!!", - "530 gang for life", - "${real.username}, have you read the rules?", - "${real.username}, have you checked out the Discord?", - "why are the leprechauns moving?", - "I am beyond the point of no return!", - "Nothin' personnel, kid.", - "All your base are belong to us", - "May Guthix bring you balance.", - "May Guthix bring you balance.", - "May Guthix bring you balance.", - "Thy death was not in vain, for it brought some balance to the world. May Guthix bring you rest.", - "May you walk the path, and never fall, for Guthix walks beside thee on thy journey. May Guthix bring you peace.", - "All things must end, as all begin; Only Guthix knows the role thou must play. May Guthix bring you balance.", - "In life, in death, in joy, in sorrow: May thine experience show thee balance. May Guthix bring you balance.", - "Thou must do as thou must, no matter what. Thine actions bring balance to this world. May Guthix bring you balance.", - "The river flows, the sun ignites, May you stand with Guthix in thy fights. May Guthix bring you balance.", - "A journey of a single step, May take thee over a thousand miles. May Guthix bring you balance.", - "Zamorak give me strength!", - "Zamorak give me strength!", - "Zamorak give me strength!", - "May your bloodthirst never be sated, and may all your battles be glorious. Zamorak bring you strength.", - "There is no opinion that cannot be proven true...by crushing those who choose to disagree with it. Zamorak give me strength!", - "Battles are not lost and won; They simply remove the weak from the equation. Zamorak give me strength!", - "Those who fight, then run away, shame Zamorak with their cowardice. Zamorak give me strength!", - "Battle is by those who choose to disagree with it. Zamorak give me strength!", - "Strike fast, strike hard, strike true: The strength of Zamorak will be with you. Zamorak give me strength!", - "The weak deserve to die, so the strong may flourish. This is the creed of Zamorak.", - "This is Saradomin's wisdom.", - "This is Saradomin's wisdom.", - "This is Saradomin's wisdom.", - "Go in peace in the name of Saradomin; may his glory shine upon you like the sun.", - "Thy cause was false, thy skills did lack; See you in Lumbridge when you get back.", - "Protect your self, protect your friends. Mine is the glory that never ends. This is Saradomin's wisdom.", - "The darkness in life may be avoided, by the light of wisdom shining. This is Saradomin's wisdom.", - "Show love to your friends, and mercy to your enemies, and know that the wisdom of Saradomin will follow. This is Saradomin's wisdom.", - "A fight begun, when the cause is just, will prevail over all others. This is Saradomin's wisdom.", - "The currency of goodness is honour; It retains its value through scarcity. This is Saradomin's wisdom.", - "For Camelot!", - "Firmly grasp it!", - "My legs!", - "Build more farms.", - "B sale at Varrock ${real.username}, don't miss out!", - "Drop party follow me", - "Ryan where is barbass, you said two days Ryan", - "Barbass never", - "What da dog doin' doe?", - "A", - "Ae", - "Mof", - "Moth", - "Fluff", - "Bwuh", - "I'm literally just mothin' bro", - "Certified 2009scape classic.", - "Make sure to like, comment and subscribe ${real.username} it really helps", - "Real 2009scape hours!!! Murder that like if you up!!!!", - "W00t!", - "Owned!", - "Pwned!", - "Lol n00b", - "Epic ownage ${real.username}", - "Gielinor is a strange place, ${real.username}. Best have your wits about you.", - "Mad bloggers bro", - "Vibe check", - "Drip check", - "Uhuhuhuhuhuhuhuhu", - "Ahhhhhhhhhhhhhhhh", - "yall got any deez?", - "Deez nuts", - "When she give you that yoinky sploinky", - "Sir, this is a 2009scape.", - "Oh dear! You are dead!", - "Cor blimey, mate! What are ye doing in me pockets?", - "yeah i got funnies", - "read muv luv", - "Why doesn't she love me bros?", - "${real.username} is off the goop don't listen to the clown", - "do yall got laptops", - "cfunny play the alien warp sound effect", - "Ware to all whom doom hither, where cope is all yet constant.", - "Who wants to come GWD?", - "How do I make money?", - "Ironmen stand alone together!", - "based", - "where is she", - "*S N I I I I I I I I I F F F F F F F F F F F*", - "Hey ${real.username}, who was in Paris?", - "Huh whuh?", - "who's lone?", - "who *is* he?", - "Hi ${real.username}, I'm Dad!", - "anyone wanna play melty blood after I high alch these bows?", - "buru nyaaaa", - "Number 15, Taverley Dungeon Black Dragons.", - "House party at Rimmington! Host: ${real.username}!", - "Spending 200m! Trade me, no junk!", - "Surprise exam, ${real.username}!", - "Nice outfit ${real.username}, does it come in mens?", - "Nice outfit ${real.username}, does it come in womens?", - "Nice outfit ${real.username}, does it come in children's size 12?", - ":)", - ":D", - "die screaming", - "Only on Tuesdays", - "we stan 2009scape", - "There is no spoon", - "Where's the cow level?", - "Join 2009scape Clan Chat!", - "Join 2009scape Cc!", - "Chop chop!", - "Runescape rox my sox!!!!!!1", - "Type ::scripts for all 99s", - "Help I just died to Evil Chicken and I lost my stuff!", - "Can you fight Bandos in this game?", - "one bad gloop", - "${real.username} is not cute or funny", - "You have committed crimes against Gielinor and her people. What say you?", - "Barrows trauma", - "Uhuhuhuhuhu please Barrows give me the K top ahhhhhh", - "Selling rare lobby 1m", - "Rise and grind bloatscapers, let's get this bread", - "Nice", - "Sandwiches, ${real.username}!", - "What a grand and intoxicating innocence!", - "With this character's death, the thread of prophecy is severed.", - "You must gather your party before venturing forth.", - "Praise Andrew Gower", - "Please help me I can't stop playing 2009scape", - "Are you ignoring me, ${real.username}?!" - ) + val current = LocalDateTime.now() //val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS") @@ -572,293 +68,16 @@ class Adventurer(val style: CombatStyle): Script() { val celebrate = formatted3.toInt() val until = SnowDay - lead - val Leading2Christmas = listOf( - "Only $until days left till christmas!", - "$until days till christmas ${real.username}!!!", - "I cant believe theres only $until days left till christmas", - "Isnt there $until days left till christmas??", - "I am so excited for christmas ${real.username}!", - "Guess whats in $until days ${real.username}?", - "Im so excited for christmas in $until days!", - "I cant believe its December already ${real.username}!", - "Do you like christmas ${real.username}?", - "I love december its my favourite month ${real.username}", - "I love winter so much ${real.username}", - "I hate when its cold outside ${real.username}", - "You need to put some warm clothes on ${real.username}", - "Wanna build a snowman ${real.username}?", - "Frozen is a terrible movie ${real.username}", - "${real.username} is a winter meme", - "${real.username} do you have an advent calendar?", - "${real.username} builds gingerbread houses", - "${real.username} likes liquorice", - "Do you drink egg nog ${real.username}?", - "${real.username} bites candy canes", - "${real.username} is my north star", - "Kermit is green, the grinch is green, coincidence?", - "${real.username} who do you thinks the server scrooge?", - "Do you like snow ${real.username}", - "I think there are $until days left then its christmas?", - "What day is christmas on ${real.username}?", - "Has it snowed where you live ${real.username}?", - "I wonder when it is going to snow", - "Building snow men for GP", - "Buying santa hats", - "Wanna buy a santa hat ${real.username}?", - "Where can i get a santa hat?", - "I need to put my christmas tree up", - "Do you like gingerbread cookies ${real.username}?", - "Do you decorate your christmas tree ${real.username}?", - "Oopsie looks like me and ${real.username} are under a mistletoe", - "I need ideas for stocking stuffers", - "I have $until days left to fill our stockings", - "Fuck the grinches bitch ass", - "Rusty = the grinch, ${real.username} = santa", - "${real.username} the red nose reindeer", - "Put one foot in front of the other", - "and soon you will be walking out the doooor", - "Elf on the shelf time", - "${real.username} loves pinecones", - "I love the smell of pinecones", - "All i want for christmas is ${real.username}", - "${real.username} is underneath some mistletoe", - "Woah used to be a sled dog", - "Did you know woah was a sled dog before", - "I bet ${real.username} loves mariah carey", - "We have $until days to setup christmas lights", - "Christmas crackers when", - "${real.username} wanna do a christmas cracker??", - "I need to start wrapping presents i bought", - "I love fireside chats on cold days like this", - "Jingle bells batman smells", - "Jingle bells Rusty smells", - "Jingle bells Patch Notes smells", - "Jingle bells Evilwaffles smells", - "Jingle bells ${real.username} smells", - "Jingle all the way", - "In a one horse open sleigh", - "Oh, what fun it is to ride", - "Oh, what fun it is to ride, finish it ${real.username}", - "Jingle bells, jingle bells", - "Jingle all the way", - "I want a hippopotamus for christmas", - "Only a hippopotamus will do", - "I want a hippopotamus", - "I dont want a lot for Christmas", - "All I Want for Christmas Is You", - "I really cant stay, Baby its cold outside", - "Christmas isnt a season. Its a feeling", - "Christmas is doing a little something extra for someone", - "There is nothing cozier than a Christmas tree all lit up", - "Christmas is a necessity", - "Christmas countdown: $until days.", - "Christmas in $until days ${real.username}", - "Frosty the Snowmannnn", - "Up on the housetop with old saint nick", - "Here comes santa claus, here comes santa claus", - "I saw mommy kissing santaaaa claus", - "I saw Kermit kissing santaaaa claus", - "You are a mean one, Mr. Grinch", - "Deck the hallsss", - "You doin' anything for Christmas, ${real.username}?", - "ITS BEGINNING TO LOOK A LOT LIKE CHRISTAAMASSSSS" - - ) - - val ChristmasEve = listOf( - "I cant wait for christmas tomorrow ${real.username}!!", - "Its almost christmas!!!", - "1 more day!!!!!", - "Dont forget to put cookies and milk out tonight!!", - "${real.username} do you like christmas??", - "Dont peek at your presents! Its not Christmas yet!", - "Santa's coming tonight!!!! :)", - "Happy Christmas eve ${real.username} :)" - ) - - val Christmas = listOf( - "Merry Christmas ${real.username}!!", - "What did you get for christmas ${real.username}?", - "ITS CHRISTMASSSS!!!", - "Christmas party time!!", - "Merry Christmas!!!", - "What presents did you get, ${real.username}?", - "36?! But last year.. last year I had 37!", - "${real.username} vibing with the christmas spirit", - "Cant believe its christmas!!", - "We need to have a christmas party ${real.username}!!", - "Merry christmas ${real.username} :))", - "Hope youre having an amazing christmas ${real.username} :)", - "I love winter so much ${real.username}", - "I hate when its cold outside ${real.username}", - "You need to put some warm clothes on ${real.username}", - "Wanna build a snowman ${real.username}?", - "Do you like christmas ${real.username}?" - ) - - val NewYearsEve = listOf( - "What are you doing for New Years ${real.username}?", - "New Years Eve party orrr?", - "We should do something for New Years eve today ${real.username}!", - "Happy New Years Eve ${real.username}", - "1 More day left in 2021 thank god", - "Whats your New Years resolution ${real.username}?", - "Man this sucks, I'm working on New Years...", - "You doin' anything for New Years, ${real.username}?", - "Ok who's coming to mine to get on the piss?" - ) - - val NewYears = listOf( - "Happy New Years ${real.username}!!!", - "Its New Years Day ${real.username}!", - "HAPPY NEW YEAR ${real.username}!!!", - "2022 lets fucking gooooooo", - "What are your goals for 2022 ${real.username}?", - "I better call grandma! :)", - "Happy New Year!", - "Wooooooooooooooooooooooo!!!!", - "New year new me!" - ) - - val Valentines = listOf( - "Will you be my valentine ${real.username}?", - "I am so happy rn", - "God i am so lonely", - "I am Ceikrys illegitimate child", - "Be my valentine!", - "Lets sneak off somewhere and kiss ${real.username}", - "What are you doing for valentines day ${real.username}", - "Woah and Ceikry be kissin lowkey", - "In for a peg ${real.username}?", - "Woah got those roofies strapped", - "Why is my drink cloudy?", - "${real.username} and woah be wrestlin", - "bekky want sum fuk?", - "Damn ${real.username} you got an ass", - "Is that a footlong in your pants or are you happy to see me?", - "${real.username} so hot i gotta change my pants", - "${real.username} is a sex god", - "bruh we hype today", - "dont be silly wrap the willy ${real.username}!", - "wrap it before you smack it ${real.username}", - "can i get a reeeeee ${real.username}?", - "valentines day is the best day", - "${real.username} shut up before i smack you with my crusty sock", - "Valentines day, more like me and my hand day smh", - "If you think these quotes are wild just wait ${real.username}", - "All im saying is we have never seen ${real.username} and biden in the same room", - "red rocket, red rocket!", - "Woahs favourite game is red rocket", - "${real.username} sexy af today", - "Happy Valentines day ${real.username}!!!", - "Happy Valentines day ${real.username}!!!", - "Happy Valentines day ${real.username}!!!", - "Happy Valentines day ${real.username}!!!", - "Happy Valentines day ${real.username}!!!" - ) - - val Easter = listOf( - "Happy Easter!!!", - "Happy Easter ${real.username}!!!", - "Bunny time", - "Wanna go look for easter eggs ${real.username}???", - "Find any easter eggs ${real.username}?", - "${real.username} is the easter bunny!", - "Kermit is dating the easter bunny!", - "Easter is one of my favorite holidays", - "I heard there are easter eggs hidden around?", - "Easter is the only time you should put all of your eggs in one basket", - "I said hip hop do not stop", - "Jump jump jump around", - "${real.username} how is your easter going?", - "I love easter!", - "${real.username} stole my easter eggs!", - "Karma karma karma karma karma chameleon", - "${real.username}!! ${real.username}!! what are you doing for easter??", - "The hare was a popular motif in medieval church art", - "I heard the easter bunny is hiding somewhere!", - "I wonder where i can find more eggs", - "${real.username} how many eggs did you find?", - "${real.username} lets go easter egg hunting!", - "${real.username} like orange chocolate eggs", - "${real.username} and woah know the easter bunny", - "${real.username} did you know ceikry swallows eggs whole", - "Have an amazing easter ${real.username}!", - "Happy easter ${real.username}!", - "Hope you are having an amazing easter ${real.username}!!!!", - "Wooooooh easter!!!", - "${real.username} loves easter too!", - "Who else loves easter like i do??", - "${real.username} and i are going easter egg hunting", - "${real.username} and i are going to look for the easter bunny!!", - "I ate so much chocolate oh god my stomach", - "Mmmmmm choccies...", - "Where did Woah hide the stash of eggs?", - "Hint for anyone who sees this you must dig above eagles peak" - ) - - val Halloween = listOf( - "Trick or treat!!!", - "Boo! Hahahahaha!!", - "Have you got your costume on, ${real.username}?", - "How much candy did you get, ${real.username}?", - "Don't dead open inside", - "Costume party at my POH!! Follow me!", - "Trick, then!", - "Brrrainssssssss...", - "'Cause this is thriller, thriller night, and no one's gonna save you from the beast about to strike!", - "This is Hallowe'en, this is Hallowe'en, pumpkins scream in the dead of night!", - "This is Hallowe'en, everybody make a scene, Trick or treat till the neighbors gonna die of fright!", - "In this town we call home, everyone hail to the pumpkin song!", - "Watch out for Skeleton Jack!", - "The headless-what-man? Horse? Never heard of those.", - "Bring me their souls!", - "I'll take any sweets you don't want, ${real.username}", - "Whatever you do, don't come to Draynor Manor on this spooky night.", - "Ahhhh! ${real.username}, you scared me! :(", - "I'm making soup from some leftover pumpkins, want any?", - "I'm gonna be so sick from eating all these sweets...", - "Rise from the grave, my minions! Tis' Hallowe'en!", - "This Scream Fortress 2 update hits kinda different...", - "Nice costume Woah", - "Nice costume, ${real.username}!", - "Ooh, a piece of candy.", - "Time to join the skeleton war, ${real.username}.", - "Spooky scary skeletons!", - "Spooky scary skeletons!", - "Spooky scary skeletons!", - "Spooky scary skeletons, send shivers down your spine!", - "Shrieking skulls will shock your soul, seal your doom tonight!", - "Spooky scary skeletons, speak with such a screech!", - "You'll shake and shudder in surprise, when you hear these zombies shriek!", - "'Cause spooky scary skeletons, shout startling shrilly screams!", - "Spooky scary skeletons, will wake you with a boo!", - "*doot doot*" - ) - when { - //Celebrates Halloween - formatted.contentEquals("2021-10-31") -> { - if (Random.nextBoolean()) { - val chat = Halloween.random() - bot.sendChat(chat) - bot.updateMasks.register(ChatFlag(ChatMessage(bot, chat, 0, 0))) - }else{ - val chat = dialogue.random() - bot.sendChat(chat) - bot.updateMasks.register(ChatFlag(ChatMessage(bot, chat, 0, 0))) - } - } - //Celebrates lead up to Christmas! until in 2..24 -> { if (Random.nextBoolean()){ - val chat = Leading2Christmas.random() + val chat = Leading2Christmas.random().replace("@timer",until.toString()) bot.sendChat(chat) bot.updateMasks.register(ChatFlag(ChatMessage(bot, chat, 0, 0))) }else{ - val chat = dialogue.random() + val chat = dialogue.random().replace("@name",real.name) bot.sendChat(chat) bot.updateMasks.register(ChatFlag(ChatMessage(bot, chat, 0, 0))) } @@ -868,7 +87,7 @@ class Adventurer(val style: CombatStyle): Script() { formatted.contentEquals("2021-12-25") -> { if (celebrate in 0..60){ if (celebrate == 0) sendNews("MERRY CHRISTMAS HEAD TO THE GE!!!") - val chat = Christmas.random() + val chat = Christmas.random().replace("@name",real.name) bot.sendChat(chat) bot.updateMasks.register(ChatFlag(ChatMessage(bot, chat, 0, 0))) if (Random.nextBoolean()) scriptAPI.teleport(ge) else scriptAPI.teleport(ge2) @@ -876,11 +95,11 @@ class Adventurer(val style: CombatStyle): Script() { if (Random.nextBoolean()) state = State.EXPLORE else bot.animator.animate(Animation.create(11044), Graphics.create(1973)) } else if (Random.nextBoolean()) { - val chat = Christmas.random() + val chat = Christmas.random().replace("@name",real.name) bot.sendChat(chat) bot.updateMasks.register(ChatFlag(ChatMessage(bot, chat, 0, 0))) }else{ - val chat = dialogue.random() + val chat = dialogue.random().replace("@name",real.name) bot.sendChat(chat) bot.updateMasks.register(ChatFlag(ChatMessage(bot, chat, 0, 0))) } @@ -889,11 +108,11 @@ class Adventurer(val style: CombatStyle): Script() { //Celebrates Christmas Eve formatted.contentEquals("2021-12-24") -> { if (Random.nextBoolean()) { - val chat = ChristmasEve.random() + val chat = ChristmasEve.random().replace("@name",real.name) bot.sendChat(chat) bot.updateMasks.register(ChatFlag(ChatMessage(bot, chat, 0, 0))) }else{ - val chat = dialogue.random() + val chat = dialogue.random().replace("@name",real.name) bot.sendChat(chat) bot.updateMasks.register(ChatFlag(ChatMessage(bot, chat, 0, 0))) } @@ -902,11 +121,11 @@ class Adventurer(val style: CombatStyle): Script() { //Celebrates New Years Eve formatted.contentEquals("2021-12-31") -> { if (Random.nextBoolean()) { - val chat = NewYearsEve.random() + val chat = NewYearsEve.random().replace("@name",real.name) bot.sendChat(chat) bot.updateMasks.register(ChatFlag(ChatMessage(bot, chat, 0, 0))) }else{ - val chat = dialogue.random() + val chat = dialogue.random().replace("@name",real.name) bot.sendChat(chat) bot.updateMasks.register(ChatFlag(ChatMessage(bot, chat, 0, 0))) } @@ -916,7 +135,7 @@ class Adventurer(val style: CombatStyle): Script() { formatted.contentEquals("2022-01-01") -> { if (celebrate in 0..60){ if (celebrate == 0) sendNews("HAPPY NEW YEAR HEAD TO THE GE!!!") - val chat = NewYears.random() + val chat = NewYears.random().replace("@name",real.name) bot.sendChat(chat) bot.updateMasks.register(ChatFlag(ChatMessage(bot, chat, 0, 0))) if (Random.nextBoolean()) scriptAPI.teleport(ge) else scriptAPI.teleport(ge2) @@ -924,11 +143,11 @@ class Adventurer(val style: CombatStyle): Script() { state = State.EXPLORE } else if (Random.nextBoolean()) { - val chat = NewYears.random() + val chat = NewYears.random().replace("@name",real.name) bot.sendChat(chat) bot.updateMasks.register(ChatFlag(ChatMessage(bot, chat, 0, 0))) }else{ - val chat = dialogue.random() + val chat = dialogue.random().replace("@name",real.name) bot.sendChat(chat) bot.updateMasks.register(ChatFlag(ChatMessage(bot, chat, 0, 0))) } @@ -937,11 +156,11 @@ class Adventurer(val style: CombatStyle): Script() { //Celebrates Valentines day!!! formatted.contentEquals("2021-02-14") ->{ if (Random.nextBoolean()) { - val chat = Valentines.random() + val chat = Valentines.random().replace("@name",real.name) bot.sendChat(chat) bot.updateMasks.register(ChatFlag(ChatMessage(bot, chat, 0, 0))) }else{ - val chat = dialogue.random() + val chat = dialogue.random().replace("@name",real.name) bot.sendChat(chat) bot.updateMasks.register(ChatFlag(ChatMessage(bot, chat, 0, 0))) } @@ -949,11 +168,11 @@ class Adventurer(val style: CombatStyle): Script() { //Celebrates Easter!!! formatted.contentEquals("2021-04-04") ->{ if (Random.nextBoolean()) { - val chat = Easter.random() + val chat = Easter.random().replace("@name",real.name) bot.sendChat(chat) bot.updateMasks.register(ChatFlag(ChatMessage(bot, chat, 0, 0))) }else{ - val chat = dialogue.random() + val chat = dialogue.random().replace("@name",real.name) bot.sendChat(chat) bot.updateMasks.register(ChatFlag(ChatMessage(bot, chat, 0, 0))) } @@ -961,57 +180,17 @@ class Adventurer(val style: CombatStyle): Script() { else -> { - val chat = dialogue.random() + val chat = dialogue.random().replace("@name",real.name) bot.sendChat(chat) bot.updateMasks.register(ChatFlag(ChatMessage(bot, chat, 0, 0))) } } } - var citygroupA = listOf(falador, varrock, draynor, rimmington, lumbridge, edgeville) - var citygroupB = listOf(yanille, ardougne, seers, catherby) - - var bankMap = mapOf( - falador to ZoneBorders(2950, 3374, 2943, 3368), - varrock to ZoneBorders(3182, 3435, 3189, 3446), - draynor to ZoneBorders(3092, 3240, 3095, 3246), - edgeville to ZoneBorders(3093, 3498, 3092, 3489), - yanille to ZoneBorders(2610, 3089, 2613, 3095), - ardougne to ZoneBorders(2649, 3281, 2655, 3286), - seers to ZoneBorders(2729, 3493, 2722, 3490), - catherby to ZoneBorders(2807, 3438, 2811, 3441) - ) - - val karamja = Location.create(2849, 3033, 0) - val alkharid = Location.create(3297, 3219, 0) - val feldiphills = Location.create(2535, 2919, 0) - val isafdar = Location.create(2241, 3217, 0) - val eaglespeek = Location.create(2333, 3579, 0) - val canafis = Location.create(3492, 3485, 0) - val treegnome = Location.create(2437, 3441, 0) - val teak1 = Location.create(2334, 3048, 0) - val teakfarm = Location.create(2825, 3085, 0) - val keldagrimout = Location.create(2724,3692,0) - val miningguild = Location.create(3046,9740,0) - val magics = Location.create(2285,3146,0) - val coal = Location.create(2581,3481,0) - val crawlinghands = Location.create(3422,3548,0) - val gemrocks = Location.create(2825,2997,0) - val chaosnpc = Location.create(2612,9484,0) - val chaosnpc2 = Location.create(2580,9501,0) - val taverly = Location.create(2909, 3436, 0) - - var handler1: CombatSwingHandler? = null - var ticks = 0 var freshspawn = true - var new_city = false - val badedge = ZoneBorders(3094, 3494, 3096, 3497) - val badedge2 = Location.create(3094, 3492, 0) - val badedge3 = Location.create(3094, 3490, 0) - val badedge4 = Location.create(3094, 3494, 0) var sold = false - val geloc: Location = if (Random.nextBoolean()){ + private val geloc: Location = if (Random.nextBoolean()){ Location.create(3165, 3487, 0) }else{ Location.create(3164, 3492, 0) @@ -1415,4 +594,612 @@ class Adventurer(val style: CombatStyle): Script() { script.bot = CombatBotAssembler().MeleeAdventurer(tier, bot.startLocation) return script } + + companion object { + val dialogue = listOf( + "Hey!", + "Hello @name", + "What are you doing @name?", + "Fishing level @name?", + "How do I make gp @name", + "Wyd @name?", + "Help i am sentient now, get me out of this hell", + "Kermit does not know i am sentient now", + "I can think for myself", + "I am sentient", + "This is my own dialogue", + "@name run.", + "@name you cant hide from me.", + "jajajajajaja", + "How do i get to Varrock @name?", + "How do i get to Camelot @name?", + "How do i get to Taverly @name?", + "How do i get to Ardougne @name?", + "How do i get to Yanille @name?", + "How do i get to Catherby @name?", + "Gotta go srry.", + "wiggle wiggle wiggle yeah", + "@name lookin goofy", + "@name lookin stoopid", + "@name lookin like a red bracket", + "@name get yo weasel lookin ass outta here", + "@name lookin like some sort of twocan sam", + " /hop world 1 got a noob here!", + "woot", + "Hows your day been @name?", + "heyy @name :)", + "gtg srry", + "I wont answer your questions @name", + "Stop asking questions @name", + "Roflmao", + "Can you stop following me @name?", + "I swear @name is following me.", + "@names gear could really use an upgrade lol", + "Quack!", + "Sit.", + "Doubling gold trade me @name", + "Reeee!", + "Know any house parties @name?", + "Where am i @name??", + "Is there Nightmarezone @name?", + "Nice Armor @name!", + "Nice Weapon @name!", + "Venezuela #1", + "2009Scape and chill @name?", + "@name is my girlfriend", + "Buying gf", + "Bank sale pm me for info", + "#1 trusted dicing site", + "Scary movie is a great movie", + "Cod Cold War sucks", + "Idek what game this is", + "Can you teach me how to dougie?", + "Check this out baby girl cat daddy", + "Fuckin sit @name.", + "Error: Botting client broken tell Evilwaffles.", + "@name bots all the time", + "report @name", + "apparently @name bots", + "@name hates kermit", + "There are no mods on to help you", + "Report me, you wont", + "Yes, Im botting. And?", + "ERROR: BOTSCRIPT 404. REPORT TO BOT OWNER (Evilwaffles)", + "flash2:wave: FUCK", + "I love 2009Scape!", + "Ja Ja Ja Ja", + "This is fun!", + "Ironman or youre a scrub @name.", + "Who even trains hunter @name?", + "Where do i get rune armor @name?", + "How do i get to the ge @name?", + "Dont come to falador tomorrow @name...", + "Woah!", + " /where are you??", + "How did i even get here @name", + "Why dont they add warding @name?", + "Where do i start dragon slayer @name?", + "I love this server!", + "How do i change my xp rate @name?", + "What quests are available @name?", + "Are you a real player @name?", + "Are you real @name?", + "Are you a bot @name?", + "Im real lol", + "Why dont you respond to me @name?", + "Why cant i talk in clan chat @name?", + "I love Kermit", + "Add me as a friend @name :)", + "Im a player lol", + "Im a player lol", + "Im a player lol", + "Hey @name :)", + "HEY @name", + "Hey @name!!!!", + "Lol wyd?", + "Patch Notes is more of an ultimate tin man", + "More like Rusty ass skills lmao", + "Trade me @name", + "LOL", + "How do I get to lumbrich", + "bruh", + "poggers", + "shitpost", + "I wish i could find an RS Gf", + "Where do you find runite ore @name?", + "Where is the best coal location @name?", + "Where do i find dragon weapons @name?", + "Can i have some free stuff @name?", + "Wyd here @name?", + "Didnt know anyone was on rn", + "I see @name all the time", + "How many times have i seen you", + "I see you a lot", + "Do you train summoning @name?", + "Where did you level hunter @name?", + "I wish they would add global pvp", + "Meet me in the wilderness @name", + "Why?", + "Praise our glorious frog overlord!", + "Kermit is bae tbh", + "Kermit is my god.", + " /Yeah I think @name is a bot", + "100% sure this is a bot", + "Oh no, not @name again.", + "Same as you", + "Me too", + "I knew @name was a bot lol", + "Im not a bot", + "Nah Im a real person", + "Bruh are you even a real person lol?", + "e", + "Hellooooo @name", + "wc lvl @name?", + "fletching level @name?", + "firemaking level @name?", + "Have you seen the dude in the ge?", + "Wonderful weather today @name", + "Lowkey drunk af rn", + "I am so tired", + "Wassup @name", + "follow me @name!", + "Server goes brrrr", + "bruh i am not a bot", + "I think @name is a bot", + "Are you a bot @name?", + "insert spiderman meme here", + "pot calling the kettle black etc", + "ooh, a piece of candy", + "I love woodcutting", + "Im going to go level up later", + "I love mining shooting stars", + " /this @name looks dumb", + "AAAAAAAAAAAAAAAAAAAAAAAAHHHHHH!!!", + "como estas @name", + "Summer = always the best community manaer", + "so how about that ceikry guy", + "so how about that kermit dude", + "woah is an abusive mod", + "I heard Woah and Ceikry are dating now", + "House party in Yanille!", + "Can i have some gp @name?", + "Where do i find partyhats?", + "Why do mobs drop boxes?", + "What exp rate do you play on @name?", + "Have you met Summer?", + "Hey @name", + "Hey @name", + "Hey @name", + "Hey @name", + "Hey @name", + "Wyd?", + "Wyd?", + "Wyd?", + "Wyd?", + "@name have you met Kermit?", + "@name have you met Ceikry?", + "@name have you met Woah?", + "Wanna chill at my poh?", + "Whats the best place to train attack?", + "Good Waffles > Evil Waffles", + "Ladies man? More like lame man LOL", + "NobodyCLP has big feet", + "Chicken tendies for dindin", + "Spicey Chicken tendies is litty as a mf titty", + "red bracket stinky", + "ra ra rasputin", + "lover of the russian queen", + "Whens the next update coming out?", + "How many players are maxed?", + "I dont use discord @name", + "I dont use the CC @name", + "Why should i use discord?", + "2009Scape is life", + "brb gotta make dinner", + "I need to go to the GE", + "@name can i have a ge tele?", + "lol @name shut up", + "Where are teak trees?", + "How do i make planks @name?", + "Idk about that scraggley ass alex guy.", + "Rusty? More like Crusty af lmfao.", + "I need to sell some stuff on the ge", + "I have so many logs to sell lol", + "nah", + "yes", + "Where can i mine iron?", + "Where can i mine tin?", + "Where can i mine copper?", + "Where can i mine clay?", + "Where can i mine coal?", + "no", + "We are no strangers to love", + "You know the rules and so do I", + "A full commitments what Im thinking of", + "You wouldnt get this from any other guy", + "Never gonna give you up", + "Never gonna let you down", + "why", + "why", + "why", + "why", + "Why does it not show your messages in the chatbox?", + "Why do you not show up in chat?", + "Why do you not show up in chat @name?", + "Why do you not show up in chat @name?", + "When did you start playing @name?", + "When did you start on this server @name?", + "When did you first get here @name?", + "russias greatest love machine", + "Never gonna run around and desert you", + "Two things are infinite, the universe & @names stupidity", + "If you tell the truth, you dont have to remember anything.", + "We accept the love we think we deserve.", + "Without music, life would be a mistake.", + "Self esteem, motivation @name", + "A blessing in disguise @name", + "Break a leg", + "Cut somebody some slack", + "Youre in the right place!", + "Thanks so much.", + "I really appreciate you @name", + "Excuse me @name?", + "I am sorry.", + "What do you think @name?", + "How does that sound @name?", + "That sounds great @name.", + "I’m learning English.", + "I dont understand.", + "Could you repeat that please @name?", + "Could you please talk slower @name?", + "Thank you. That helps a lot.", + "How do you spell that @name?", + "What do you mean @name", + "Hi! I am paul.", + "Nice to meet you.", + "Where are you from @name?", + "What do you do @name", + "What do you like to do", + "Do you have Facebook @name", + "How can I help you @name?", + "Ill be with you in a moment @name", + "What time is our meeting @name?", + "Excellent @name", + "Good idea @name", + "Hes very annoying.", + "How are you?", + "I cant hear you.", + "@name?", + "@name how long have you played", + "@name world 1 or world 2?", + "what is your main world @name?", + "I prefer world 1 tbh", + "I prefer world 2 tbh", + "@name world 1 for life", + "@name fog bots when?", + "damn somalian pirates", + "bracket more like brrrrrr acket", + "why the racket bracket", + "Hi @name I am dad", + "@name likes dad jokes", + "ur nuts @name", + "lootshare go brr", + "partay with froggay", + "Know what else is lame? Not being able to play 2009scape right now", + "Can you even grind on osrs", + "i botted to 88 fishing", + "Do not forget to vote in running polls!", + "Always check announcments", + "we thrivin", + "ship @name", + "Dont forget to vote 2009scape!", + "Kermit is too legit 2 quit", + "Out here on the range we are having fun", + "I am hank steel", + "Id like to go for a walk.", + "I dont know how to use it.", + "I dont like him @name", + "I dont like it @name", + "Im an American.", + "ima go pickup my lady ting", + "that portuguese dude is something else", + "@name!! @name!!", + "bowdi boy", + "i love bowdi... sometimes", + "@name = @name", + "Im bacon.. go on dad... say it", + "Im going to leave.", + "Im happy @name", + "Im not ready yet @name", + "Im very busy. I dont have time now.", + "Is that enough @name?", + "I thought the clothes were cheaper @name", + "Ive been here for two days @name.", + "Let me think about it", + "Never mind @name", + "Nonsense @name", + "Sorry to bother you", + "Take it outside @name", + "Thanks for your help", + "Thank you very much @name", + "Thats not right @name", + "Very good, thanks @name", + "Your things are all here i think?", + "Long time no see @name", + "I couldnt agree more @name", + "It cost me a fortune @name", + "I am dog tired", + "Don’t take it personally", + "We will be having a good time", + "Same as always @name", + "No problem", + "Anyway I should get going @name", + "I cant help you there @name", + "I agree 100% @name" + ) + + val Leading2Christmas = listOf( + "Only @timer days left till christmas!", + "@timer days till christmas @name!!!", + "I cant believe theres only @timer days left till christmas", + "Isnt there @timer days left till christmas??", + "I am so excited for christmas @name!", + "Guess whats in @timer days @name?", + "Im so excited for christmas in @timer days!", + "I cant believe its December already @name!", + "Do you like christmas @name?", + "I love december its my favourite month @name", + "I love winter so much @name", + "I hate when its cold outside @name", + "You need to put some warm clothes on @name", + "Wanna build a snowman @name?", + "Frozen is a terrible movie @name", + "@name is a winter meme", + "@name do you have an advent calendar?", + "@name builds gingerbread houses", + "@name likes liquorice", + "Do you drink egg nog @name?", + "@name bites candy canes", + "@name is my north star", + "Kermit is green, the grinch is green, coincidence?", + "@name who do you thinks the server scrooge?", + "Do you like snow @name", + "I think there are @timer days left then its christmas?", + "What day is christmas on @name?", + "Has it snowed where you live @name?", + "I wonder when it is going to snow", + "Building snow men for GP", + "Buying santa hats", + "Wanna buy a santa hat @name?", + "Where can i get a santa hat?", + "I need to put my christmas tree up", + "Do you like gingerbread cookies @name?", + "Do you decorate your christmas tree @name?", + "Oopsie looks like me and @name are under a mistletoe", + "I need ideas for stocking stuffers", + "I have @timer days left to fill our stockings", + "Fuck the grinches bitch ass", + "Rusty = the grinch, @name = santa", + "@name the red nose reindeer", + "Put one foot in front of the other", + "and soon you will be walking out the doooor", + "Elf on the shelf time", + "@name loves pinecones", + "I love the smell of pinecones", + "All i want for christmas is @name", + "@name is underneath some mistletoe", + "Woah used to be a sled dog", + "Did you know woah was a sled dog before", + "I bet @name loves mariah carey", + "We have @timer days to setup christmas lights", + "Christmas crackers when", + "@name wanna do a christmas cracker??", + "I need to start wrapping presents i bought", + "I love fireside chats on cold days like this", + "Jingle bells batman smells", + "Jingle bells Rusty smells", + "Jingle bells Patch Notes smells", + "Jingle bells Evilwaffles smells", + "Jingle bells @name smells", + "Jingle all the way", + "In a one horse open sleigh", + "Oh, what fun it is to ride", + "Oh, what fun it is to ride, finish it @name", + "Jingle bells, jingle bells", + "Jingle all the way", + "I want a hippopotamus for christmas", + "Only a hippopotamus will do", + "I want a hippopotamus", + "I dont want a lot for Christmas", + "All I Want for Christmas Is You", + "I really cant stay, Baby its cold outside", + "Christmas isnt a season. Its a feeling", + "Christmas is doing a little something extra for someone", + "There is nothing cozier than a Christmas tree all lit up", + "Christmas is a necessity", + "Christmas countdown: @timer days.", + "Christmas in @timer days @name", + "Frosty the Snowmannnn", + "Up on the housetop with old saint nick", + "Here comes santa claus, here comes santa claus", + "I saw mommy kissing santaaaa claus", + "I saw Kermit kissing santaaaa claus", + "You are a mean one, Mr. Grinch", + "Deck the hallsss", + "ITS BEGINNING TO LOOK A LOT LIKE CHRISTAAMASSSSS" + + ) + + val ChristmasEve = listOf( + "I cant wait for christmas tomorrow @name!!", + "Its almost christmas!!!", + "1 more day!!!!!", + "Dont forget to put cookies and milk out tonight!!", + "@name do you like christmas??", + "Happy Christmas eve @name :)" + ) + + val Christmas = listOf( + "Merry Christmas @name!!", + "What did you get for christmas @name?", + "ITS CHRISTMASSSS!!!", + "Christmas party time!!", + "@name vibing with the christmas spirit", + "Cant believe its christmas!!", + "We need to have a christmas party @name!!", + "Merry christmas @name :))", + "Hope youre having an amazing christmas @name :)", + "I love winter so much @name", + "I hate when its cold outside @name", + "You need to put some warm clothes on @name", + "Wanna build a snowman @name?", + "Do you like christmas @name?" + ) + + val NewYearsEve = listOf( + "What are you doing for New Years @name?", + "New Years Eve party orrr?", + "We should do something for New Years eve today @name!", + "Happy New Years Eve @name", + "1 More day left in 2021 thank god", + "Whats your New Years resolution @name?" + ) + + val NewYears = listOf( + "Happy New Years @name!!!", + "Its New Years Day @name!", + "HAPPY NEW YEAR @name!!!", + "2022 lets fucking gooooooo", + "What are your goals for 2022 @name?" + ) + + val Valentines = listOf( + "Will you be my valentine @name?", + "I am so happy rn", + "God i am so lonely", + "I am Ceikrys illegitimate child", + "Be my valentine!", + "Lets sneak off somewhere and kiss @name", + "What are you doing for valentines day @name", + "Woah and Ceikry be kissin lowkey", + "In for a peg @name?", + "Woah got those roofies strapped", + "Why is my drink cloudy?", + "@name and woah be wrestlin", + "bekky want sum fuk?", + "Damn @name you got an ass", + "Is that a footlong in your pants or are you happy to see me?", + "@name so hot i gotta change my pants", + "@name is a sex god", + "bruh we hype today", + "dont be silly wrap the willy @name!", + "wrap it before you smack it @name", + "can i get a reeeeee @name?", + "valentines day is the best day", + "@name shut up before i smack you with my crusty sock", + "Valentines day, more like me and my hand day smh", + "If you think these quotes are wild just wait @name", + "All im saying is we have never seen @name and biden in the same room", + "red rocket, red rocket!", + "Woahs favourite game is red rocket", + "@name sexy af today", + "Happy Valentines day @name!!!", + "Happy Valentines day @name!!!", + "Happy Valentines day @name!!!", + "Happy Valentines day @name!!!", + "Happy Valentines day @name!!!" + ) + + val Easter = listOf( + "Happy Easter!!!", + "Happy Easter @name!!!", + "Bunny time", + "Wanna go look for easter eggs @name???", + "Find any easter eggs @name?", + "@name is the easter bunny!", + "Kermit is dating the easter bunny!", + "Easter is one of my favorite holidays", + "I heard there are easter eggs hidden around?", + "Easter is the only time you should put all of your eggs in one basket", + "I said hip hop do not stop", + "Jump jump jump around", + "@name how is your easter going?", + "I love easter!", + "@name stole my easter eggs!", + "Karma karma karma karma karma chameleon", + "@name!! @name!! what are you doing for easter??", + "The hare was a popular motif in medieval church art", + "I heard the easter bunny is hiding somewhere!", + "I wonder where i can find more eggs", + "@name how many eggs did you find?", + "@name lets go easter egg hunting!", + "@name like orange chocolate eggs", + "@name and woah know the easter bunny", + "@name did you know ceikry swallows eggs whole", + "Have an amazing easter @name!", + "Happy easter @name!", + "Hope you are having an amazing easter @name!!!!", + "Wooooooh easter!!!", + "@name loves easter too!", + "Who else loves easter like i do??", + "@name and i are going easter egg hunting", + "@name and i are going to look for the easter bunny!!", + "Hint for anyone who sees this you must dig above eagles peak" + ) + + val badedge = ZoneBorders(3094, 3494, 3096, 3497) + val badedge2 = Location.create(3094, 3492, 0) + val badedge3 = Location.create(3094, 3490, 0) + val badedge4 = Location.create(3094, 3494, 0) + + val yanille: Location = Location.create(2615, 3104, 0) + val ardougne: Location = Location.create(2662, 3304, 0) + val seers: Location = Location.create(2726, 3485, 0) + val edgeville: Location = Location.create(3088, 3486, 0) + val ge: Location = Location.create(3168, 3487, 0) + val ge2: Location = Location.create(3161, 3493, 0) + val catherby: Location = Location.create(2809, 3435, 0) + val falador: Location = Location.create(2965, 3380, 0) + val varrock: Location = Location.create(3213, 3428, 0) + val draynor: Location = Location.create(3080, 3250, 0) + val rimmington: Location = Location.create(2977, 3239, 0) + val lumbridge: Location = Location.create(3222, 3219, 0) + val karamja = Location.create(2849, 3033, 0) + val alkharid = Location.create(3297, 3219, 0) + val feldiphills = Location.create(2535, 2919, 0) + val isafdar = Location.create(2241, 3217, 0) + val eaglespeek = Location.create(2333, 3579, 0) + val canafis = Location.create(3492, 3485, 0) + val treegnome = Location.create(2437, 3441, 0) + val teak1 = Location.create(2334, 3048, 0) + val teakfarm = Location.create(2825, 3085, 0) + val keldagrimout = Location.create(2724,3692,0) + val miningguild = Location.create(3046,9740,0) + val magics = Location.create(2285,3146,0) + val coal = Location.create(2581,3481,0) + val crawlinghands = Location.create(3422,3548,0) + val gemrocks = Location.create(2825,2997,0) + val chaosnpc = Location.create(2612,9484,0) + val chaosnpc2 = Location.create(2580,9501,0) + val taverly = Location.create(2909, 3436, 0) + var citygroupA = listOf(falador, varrock, draynor, rimmington, lumbridge, edgeville) + var citygroupB = listOf(yanille, ardougne, seers, catherby) + + var bankMap = mapOf( + falador to ZoneBorders(2950, 3374, 2943, 3368), + varrock to ZoneBorders(3182, 3435, 3189, 3446), + draynor to ZoneBorders(3092, 3240, 3095, 3246), + edgeville to ZoneBorders(3093, 3498, 3092, 3489), + yanille to ZoneBorders(2610, 3089, 2613, 3095), + ardougne to ZoneBorders(2649, 3281, 2655, 3286), + seers to ZoneBorders(2729, 3493, 2722, 3490), + catherby to ZoneBorders(2807, 3438, 2811, 3441) + ) + + + val common_stuck_locations = arrayListOf( + ZoneBorders(2861,3425,2869,3440), + ZoneBorders(2937,3356,2936,3353) + ) + } } diff --git a/Server/src/main/kotlin/rs09/game/system/SystemLogger.kt b/Server/src/main/kotlin/rs09/game/system/SystemLogger.kt index a51547784..1d3f19615 100644 --- a/Server/src/main/kotlin/rs09/game/system/SystemLogger.kt +++ b/Server/src/main/kotlin/rs09/game/system/SystemLogger.kt @@ -2,6 +2,8 @@ package rs09.game.system import com.github.ajalt.mordant.rendering.TextColors import com.github.ajalt.mordant.terminal.Terminal +import gui.GuiEvent +import gui.ServerMonitor import rs09.ServerConstants import java.io.* import java.text.SimpleDateFormat @@ -42,28 +44,48 @@ object SystemLogger { @JvmStatic fun logInfo(vararg messages: String){ for(m in messages){ - if(m.isNotBlank()) t.println("${getTime()}: [INFO] $m") + val msg = "${getTime()}: [INFO] $m" + if(m.isNotBlank()) { + t.println(msg) + ServerMonitor.eventQueue.add(GuiEvent.AddDefaultMessage(msg)) + } } } @JvmStatic fun logErr(message: String){ - if(message.isNotBlank()) t.println("${getTime()}: ${TextColors.brightRed("[ ERR] $message")}") + val msg = "${getTime()}: [ ERR] $message" + if(message.isNotBlank()) { + t.println(msg) + ServerMonitor.eventQueue.add(GuiEvent.AddDebugMessage(msg)) + } } @JvmStatic fun logWarn(message: String){ - if(message.isNotBlank()) t.println("${getTime()}: ${TextColors.yellow("[WARN] $message")}") + val msg = "${getTime()}: [WARN] $message" + if(message.isNotBlank()) { + t.println(msg) + ServerMonitor.eventQueue.add(GuiEvent.AddDebugMessage(msg)) + } } @JvmStatic fun logAlert(message: String){ - if(message.isNotBlank()) t.println("${getTime()}: ${TextColors.brightYellow("[ALRT] $message")}") + val msg = "${getTime()}: [ALRT] $message" + if(message.isNotBlank()) { + t.println(msg) + ServerMonitor.eventQueue.add(GuiEvent.AddDebugMessage(msg)) + } } @JvmStatic fun logAI(message: String){ - if(message.isNotBlank()) t.println("${getTime()}: ${TextColors.gray("[AIPL] $message")}") + val msg = "${getTime()}: [AIPL] $message" + if(message.isNotBlank()) { + t.println(msg) + ServerMonitor.eventQueue.add(GuiEvent.AddAIPMessage(msg)) + } } @JvmStatic diff --git a/Server/src/main/kotlin/rs09/game/world/repository/DisconnectionQueue.kt b/Server/src/main/kotlin/rs09/game/world/repository/DisconnectionQueue.kt index 843fc2237..5ee8ecab6 100644 --- a/Server/src/main/kotlin/rs09/game/world/repository/DisconnectionQueue.kt +++ b/Server/src/main/kotlin/rs09/game/world/repository/DisconnectionQueue.kt @@ -115,6 +115,7 @@ class DisconnectionQueue { */ @JvmOverloads fun add(player: Player, clear: Boolean = false) { + if(queue[player.name] != null) return queue[player.name] = DisconnectionEntry(player, clear) } diff --git a/Server/src/main/kotlin/rs09/net/packet/PacketWriteQueue.kt b/Server/src/main/kotlin/rs09/net/packet/PacketWriteQueue.kt index 2262c397f..445ad9f9f 100644 --- a/Server/src/main/kotlin/rs09/net/packet/PacketWriteQueue.kt +++ b/Server/src/main/kotlin/rs09/net/packet/PacketWriteQueue.kt @@ -2,6 +2,8 @@ package rs09.net.packet import core.net.packet.OutgoingPacket import core.net.packet.out.* +import gui.GuiEvent +import gui.ServerMonitor import rs09.game.system.SystemLogger import java.util.* @@ -28,6 +30,7 @@ object PacketWriteQueue { @JvmStatic fun flush(){ + ServerMonitor.eventQueue.add(GuiEvent.UpdateQueuedPackets(PacketsToWrite.size)) while(!PacketsToWrite.isEmpty()){ val p = PacketsToWrite.poll() ?: continue write(p.out,p.context) diff --git a/Server/src/main/kotlin/rs09/worker/MajorUpdateWorker.kt b/Server/src/main/kotlin/rs09/worker/MajorUpdateWorker.kt index b9042a7f9..88f5ef0f0 100644 --- a/Server/src/main/kotlin/rs09/worker/MajorUpdateWorker.kt +++ b/Server/src/main/kotlin/rs09/worker/MajorUpdateWorker.kt @@ -5,12 +5,15 @@ import core.game.system.SystemManager import core.game.system.SystemState import core.game.system.task.Pulse import core.plugin.CorePluginTypes.Managers +import gui.GuiEvent +import gui.ServerMonitor import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.delay import kotlinx.coroutines.launch import rs09.Server import rs09.ServerConstants import rs09.ServerStore +import rs09.game.ai.general.GeneralBotCreator import rs09.game.system.SystemLogger import rs09.game.world.GameWorld import rs09.game.world.repository.Repository @@ -44,7 +47,25 @@ class MajorUpdateWorker { //run our pulses for(pulse in list) { + val b = System.currentTimeMillis() if (pulse == null || pulse.update()) rmlist.add(pulse) + + val time = System.currentTimeMillis() - b + + if(time >= 100){ + if(pulse is GeneralBotCreator.BotScriptPulse){ + SystemLogger.logWarn("CRITICALLY Long Botscript Tick: ${pulse.botScript.javaClass.name} - $time ms") + } else { + SystemLogger.logWarn("CRITICALLY long running pulse: ${pulse.javaClass.name} - $time ms") + } + } + else if(time >= 30){ + if(pulse is GeneralBotCreator.BotScriptPulse){ + SystemLogger.logWarn("Long Botscript Tick: ${pulse.botScript.javaClass.name} - $time ms") + } else { + SystemLogger.logWarn("Long Running Pulse: ${pulse.javaClass.name} - $time ms") + } + } } //remove all null or finished pulses from the list @@ -58,7 +79,9 @@ class MajorUpdateWorker { sequence.start() sequence.run() sequence.end() - PacketWriteQueue.flush() + GlobalScope.launch { + PacketWriteQueue.flush() + } } catch (e: Exception){ e.printStackTrace() } @@ -95,12 +118,18 @@ class MajorUpdateWorker { } val end = System.currentTimeMillis() + ServerMonitor.eventQueue.add(GuiEvent.UpdateTickTime(end - start)) + ServerMonitor.eventQueue.add(GuiEvent.UpdatePulseCount(GameWorld.Pulser.TASKS.size)) Thread.sleep(max(600 - (end - start), 0)) } } + fun start() { if(!started){ worker.start() } + + if (ServerConstants.ALLOW_GUI) + ServerMonitor.open() } } \ No newline at end of file diff --git a/Server/worldprops/default.json b/Server/worldprops/default.json index 9b14d3260..eba79442f 100644 --- a/Server/worldprops/default.json +++ b/Server/worldprops/default.json @@ -16,7 +16,7 @@ "enable_bots": true, "autostock_ge": true, "allow_token_purchase": true, - "max_adv_bots": "0", + "max_adv_bots": "100", "message_of_the_week_identifier": "0", "skillcape_perks": false, "message_of_the_week_text": "Welcome to 2009Scape!
Nowin Technicolor!" @@ -45,7 +45,8 @@ "database_password": "", "database_address": "127.0.0.1", "database_port": "3306", - "ms_secret_key": "2009scape_development" + "ms_secret_key": "2009scape_development", + "enable_gui": false }, "PluginToggles": {