| 286 | } |
| 287 | |
| 288 | func (m *ZombieModule) showConfig(user *users.UserRecord, cfg ZombieConfig) { |
| 289 | _, isActive := m.active[user.UserId] |
| 290 | |
| 291 | activeStr := `<ansi fg="red">inactive</ansi>` |
| 292 | if isActive { |
| 293 | activeStr = `<ansi fg="green">ACTIVE</ansi>` |
| 294 | } |
| 295 | |
| 296 | user.SendText(fmt.Sprintf(`<ansi fg="black-bold">.:.</ansi> <ansi fg="magenta">Zombie Mode</ansi> [%s]`, activeStr)) |
| 297 | user.SendText(``) |
| 298 | |
| 299 | combatStr := `<ansi fg="red">none</ansi>` |
| 300 | if len(cfg.CombatTargets) > 0 { |
| 301 | combatStr = `<ansi fg="yellow">` + strings.Join(cfg.CombatTargets, `, `) + `</ansi>` |
| 302 | } |
| 303 | user.SendText(fmt.Sprintf(` <ansi fg="white">Combat targets:</ansi> %s`, combatStr)) |
| 304 | |
| 305 | roamStr := `<ansi fg="red">disabled</ansi>` |
| 306 | if cfg.RoamRadius > 0 { |
| 307 | roamStr = fmt.Sprintf(`<ansi fg="yellow">%d</ansi>`, cfg.RoamRadius) |
| 308 | } |
| 309 | user.SendText(fmt.Sprintf(` <ansi fg="white">Roam radius: </ansi> %s`, roamStr)) |
| 310 | |
| 311 | restStr := `<ansi fg="red">disabled</ansi>` |
| 312 | if cfg.RestThreshold > 0 { |
| 313 | restStr = fmt.Sprintf(`<ansi fg="yellow">%d%%</ansi>`, cfg.RestThreshold) |
| 314 | } |
| 315 | user.SendText(fmt.Sprintf(` <ansi fg="white">Rest threshold:</ansi> %s`, restStr)) |
| 316 | |
| 317 | lootStr := `<ansi fg="red">none</ansi>` |
| 318 | if len(cfg.LootTargets) > 0 { |
| 319 | lootStr = `<ansi fg="yellow">` + strings.Join(cfg.LootTargets, `, `) + `</ansi>` |
| 320 | } |
| 321 | user.SendText(fmt.Sprintf(` <ansi fg="white">Loot targets: </ansi> %s`, lootStr)) |
| 322 | |
| 323 | wpStr := `<ansi fg="red">none</ansi>` |
| 324 | if len(cfg.Waypoints) > 0 { |
| 325 | wpStr = fmt.Sprintf(`<ansi fg="yellow">%d defined</ansi>`, len(cfg.Waypoints)) |
| 326 | } |
| 327 | user.SendText(fmt.Sprintf(` <ansi fg="white">Waypoints: </ansi> %s`, wpStr)) |
| 328 | |
| 329 | user.SendText(``) |
| 330 | user.SendText(`Type <ansi fg="command">help zombie</ansi> for usage.`) |
| 331 | } |
| 332 | |
| 333 | func (m *ZombieModule) handleWaypoints(args []string, user *users.UserRecord, cfg ZombieConfig) (bool, error) { |
| 334 | |