Added config parameter for the offerer of adventure bot GE announcements

This commit is contained in:
Regenleif 2022-03-25 09:07:43 +00:00 committed by Ryan
parent ba2fb55bd1
commit 3c839937eb
3 changed files with 9 additions and 3 deletions

View file

@ -185,6 +185,10 @@ class ServerConstants {
@JvmField @JvmField
var SERVER_NAME: String = "" var SERVER_NAME: String = ""
//the server's grand exchange name
@JvmField
var SERVER_GE_NAME: String = ""
//The RSA_KEY for the server. //The RSA_KEY for the server.
@JvmField @JvmField
var EXPONENT = BigInteger("52317200263721308660411803146360972546561037484450290559823448967617618536819222494429186211525706853703641369936136465589036631055945454547936148730495933263344792588795811788941129493188907621550836988152620502378278134421731002382361670176785306598134280732756356458964850508114958769985438054979422820241") var EXPONENT = BigInteger("52317200263721308660411803146360972546561037484450290559823448967617618536819222494429186211525706853703641369936136465589036631055945454547936148730495933263344792588795811788941129493188907621550836988152620502378278134421731002382361670176785306598134280732756356458964850508114958769985438054979422820241")

View file

@ -29,6 +29,7 @@ import core.tools.RandomFunction
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import org.rs09.consts.Items import org.rs09.consts.Items
import rs09.ServerConstants.Companion.SERVER_GE_NAME
import rs09.game.ai.AIRepository import rs09.game.ai.AIRepository
import rs09.game.ge.GrandExchange import rs09.game.ge.GrandExchange
import rs09.game.ge.GrandExchangeOffer import rs09.game.ge.GrandExchangeOffer
@ -453,7 +454,7 @@ class ScriptAPI(private val bot: Player) {
val canSell = GrandExchange.addBotOffer(actualId, itemAmt) val canSell = GrandExchange.addBotOffer(actualId, itemAmt)
if (canSell && saleIsBigNews(actualId, itemAmt)) { if (canSell && saleIsBigNews(actualId, itemAmt)) {
SystemLogger.logAI("Offered $itemAmt of $actualId on the GE.") SystemLogger.logAI("Offered $itemAmt of $actualId on the GE.")
Repository.sendNews("Fellerscape just offered " + itemAmt + " " + ItemDefinition.forId(actualId).name.toLowerCase() + " on the GE.") Repository.sendNews(SERVER_GE_NAME + " just offered " + itemAmt + " " + ItemDefinition.forId(actualId).name.toLowerCase() + " on the GE.")
} }
bot.bank.remove(Item(id, itemAmt)) bot.bank.remove(Item(id, itemAmt))
bot.bank.refresh() bot.bank.refresh()
@ -483,7 +484,7 @@ class ScriptAPI(private val bot: Player) {
} }
val canSell = GrandExchange.addBotOffer(actualId, itemAmt) val canSell = GrandExchange.addBotOffer(actualId, itemAmt)
if (canSell && saleIsBigNews(actualId, itemAmt)) { if (canSell && saleIsBigNews(actualId, itemAmt)) {
Repository.sendNews("FellerScape just offered " + itemAmt + " " + ItemDefinition.forId(actualId).name.toLowerCase() + " on the GE.") Repository.sendNews(SERVER_GE_NAME + " just offered " + itemAmt + " " + ItemDefinition.forId(actualId).name.toLowerCase() + " on the GE.")
} }
bot.bank.remove(item) bot.bank.remove(item)
bot.bank.refresh() bot.bank.refresh()
@ -519,7 +520,7 @@ class ScriptAPI(private val bot: Player) {
1517 -> continue 1517 -> continue
1519 -> continue 1519 -> continue
1521 -> continue 1521 -> continue
else -> Repository.sendNews("Fellerscape just offered " + itemAmt + " " + ItemDefinition.forId(actualId).name.toLowerCase() + " on the GE.") else -> Repository.sendNews(SERVER_GE_NAME + " just offered " + itemAmt + " " + ItemDefinition.forId(actualId).name.toLowerCase() + " on the GE.")
} }
} }
bot.bank.remove(item).also { SystemLogger.logAI("$item has been listed on the GE.") } bot.bank.remove(item).also { SystemLogger.logAI("$item has been listed on the GE.") }

View file

@ -100,6 +100,7 @@ object ServerConfigParser {
ServerConstants.DAILY_RESTART = data.getBoolean("world.daily_restart") ServerConstants.DAILY_RESTART = data.getBoolean("world.daily_restart")
ServerConstants.GRAND_EXCHANGE_DATA_PATH = data.getPath("paths.eco_data") ServerConstants.GRAND_EXCHANGE_DATA_PATH = data.getPath("paths.eco_data")
ServerConstants.CELEDT_DATA_PATH = data.getPath("paths.cele_drop_table_path") ServerConstants.CELEDT_DATA_PATH = data.getPath("paths.cele_drop_table_path")
ServerConstants.SERVER_GE_NAME = data.getString("world.name_ge") ?: ServerConstants.SERVER_NAME
} }