mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-18 23:46:28 +01:00
Merge branch 'fix/wired-bot-talk' into 'dev'
Bot variables can now be used in wireds See merge request morningstar/Arcturus-Community!356
This commit is contained in:
commit
3efbaadad6
6
sqlupdates/3_0_BETA_1 to 3_0_0-RC-1.sql
Normal file
6
sqlupdates/3_0_BETA_1 to 3_0_0-RC-1.sql
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
-- Wired variables for bots
|
||||||
|
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('wired.variable.name', '%name%');
|
||||||
|
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('wired.variable.roomname', '%roomname%');
|
||||||
|
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('wired.variable.user_count', '%user_count%');
|
||||||
|
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('wired.variable.owner', '%owner%');
|
||||||
|
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('wired.variable.item_count', '%item_count%');
|
@ -194,11 +194,11 @@ public class Bot implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String message = this.chatLines.get(this.lastChatIndex)
|
String message = this.chatLines.get(this.lastChatIndex)
|
||||||
.replace("%owner%", this.room.getOwnerName())
|
.replace(Emulator.getTexts().getValue("wired.variable.owner", "%owner%"), this.room.getOwnerName())
|
||||||
.replace("%item_count%", this.room.itemCount() + "")
|
.replace(Emulator.getTexts().getValue("wired.variable.item_count", "%item_count%"), this.room.itemCount() + "")
|
||||||
.replace("%name%", this.name)
|
.replace(Emulator.getTexts().getValue("wired.variable.name", "%name%"), this.name)
|
||||||
.replace("%roomname%", this.room.getName())
|
.replace(Emulator.getTexts().getValue("wired.variable.roomname", "%roomname%"), this.room.getName())
|
||||||
.replace("%user_count%", this.room.getUserCount() + "");
|
.replace(Emulator.getTexts().getValue("wired.variable.user_count", "%user_count%"), this.room.getUserCount() + "");
|
||||||
|
|
||||||
if(!WiredHandler.handle(WiredTriggerType.SAY_SOMETHING, this.getRoomUnit(), room, new Object[]{ message })) {
|
if(!WiredHandler.handle(WiredTriggerType.SAY_SOMETHING, this.getRoomUnit(), room, new Object[]{ message })) {
|
||||||
this.talk(message);
|
this.talk(message);
|
||||||
|
@ -97,10 +97,15 @@ public class WiredEffectBotTalk extends InteractionWiredEffect {
|
|||||||
Habbo habbo = room.getHabbo(roomUnit);
|
Habbo habbo = room.getHabbo(roomUnit);
|
||||||
|
|
||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
message = message.replace(Emulator.getTexts().getValue("wired.variable.username"), habbo.getHabboInfo().getUsername())
|
message = message.replace(Emulator.getTexts().getValue("wired.variable.username", "%username%"), habbo.getHabboInfo().getUsername())
|
||||||
.replace(Emulator.getTexts().getValue("wired.variable.credits"), habbo.getHabboInfo().getCredits() + "")
|
.replace(Emulator.getTexts().getValue("wired.variable.credits", "%credits%"), habbo.getHabboInfo().getCredits() + "")
|
||||||
.replace(Emulator.getTexts().getValue("wired.variable.pixels"), habbo.getHabboInfo().getPixels() + "")
|
.replace(Emulator.getTexts().getValue("wired.variable.pixels", "%pixels%"), habbo.getHabboInfo().getPixels() + "")
|
||||||
.replace(Emulator.getTexts().getValue("wired.variable.points"), habbo.getHabboInfo().getCurrencyAmount(Emulator.getConfig().getInt("seasonal.primary.type")) + "");
|
.replace(Emulator.getTexts().getValue("wired.variable.points", "%points%"), habbo.getHabboInfo().getCurrencyAmount(Emulator.getConfig().getInt("seasonal.primary.type")) + "")
|
||||||
|
.replace(Emulator.getTexts().getValue("wired.variable.owner", "%owner%"), room.getOwnerName())
|
||||||
|
.replace(Emulator.getTexts().getValue("wired.variable.item_count", "%item_count%"), room.itemCount() + "")
|
||||||
|
.replace(Emulator.getTexts().getValue("wired.variable.name", "%name%"), this.botName)
|
||||||
|
.replace(Emulator.getTexts().getValue("wired.variable.roomname", "%roomname%"), room.getName())
|
||||||
|
.replace(Emulator.getTexts().getValue("wired.variable.user_count", "%user_count%"), room.getUserCount() + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Bot> bots = room.getBots(this.botName);
|
List<Bot> bots = room.getBots(this.botName);
|
||||||
|
@ -116,10 +116,15 @@ public class WiredEffectBotTalkToHabbo extends InteractionWiredEffect {
|
|||||||
|
|
||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
String m = this.message;
|
String m = this.message;
|
||||||
m = m.replace(Emulator.getTexts().getValue("wired.variable.username"), habbo.getHabboInfo().getUsername())
|
m = m.replace(Emulator.getTexts().getValue("wired.variable.username", "%username%"), habbo.getHabboInfo().getUsername())
|
||||||
.replace(Emulator.getTexts().getValue("wired.variable.credits"), habbo.getHabboInfo().getCredits() + "")
|
.replace(Emulator.getTexts().getValue("wired.variable.credits", "%credits%"), habbo.getHabboInfo().getCredits() + "")
|
||||||
.replace(Emulator.getTexts().getValue("wired.variable.pixels"), habbo.getHabboInfo().getPixels() + "")
|
.replace(Emulator.getTexts().getValue("wired.variable.pixels", "%pixels%"), habbo.getHabboInfo().getPixels() + "")
|
||||||
.replace(Emulator.getTexts().getValue("wired.variable.points"), habbo.getHabboInfo().getCurrencyAmount(Emulator.getConfig().getInt("seasonal.primary.type")) + "");
|
.replace(Emulator.getTexts().getValue("wired.variable.points", "%points%"), habbo.getHabboInfo().getCurrencyAmount(Emulator.getConfig().getInt("seasonal.primary.type")) + "")
|
||||||
|
.replace(Emulator.getTexts().getValue("wired.variable.owner", "%owner%"), room.getOwnerName())
|
||||||
|
.replace(Emulator.getTexts().getValue("wired.variable.item_count", "%item_count%"), room.itemCount() + "")
|
||||||
|
.replace(Emulator.getTexts().getValue("wired.variable.name", "%name%"), this.botName)
|
||||||
|
.replace(Emulator.getTexts().getValue("wired.variable.roomname", "%roomname%"), room.getName())
|
||||||
|
.replace(Emulator.getTexts().getValue("wired.variable.user_count", "%user_count%"), room.getUserCount() + "");
|
||||||
|
|
||||||
List<Bot> bots = room.getBots(this.botName);
|
List<Bot> bots = room.getBots(this.botName);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user