forked from celoko/batclient_triggers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentity_rep_counter.bcs
142 lines (116 loc) · 5.06 KB
/
entity_rep_counter.bcs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
SCRIPT_NAME = "entity_rep_counter";
SCRIPT_DESC = "Shows entity rep in numbers";
SCRIPT_OFF = false;
// Ver 1.1
// Modified from Hair's barbarian rep counter
// Not tested with magic entity
// probably broken if you have >10000 rep
// Removed next level info stuff
// Added line that shows entity size/adjective in numbers
//
// Erygon 2015
// Entity names, change to match your own entities
String fire_name = "Aodh";
String air_name = "";
String water_name = "";
String earth_name = "";
String magic_name = "";
String entity_type = "";
String entity_humour = "";
// Ansi color codes, "\033[0m" clears all color
String colB = ""; // Color before
String colA = "\033[0m"; // Color after
// Level names
String[] entity_levels = { "tiny", "titchy", "miniscule", "small", "medium", "large", "huge", "enormous", "humoungous", "garantuan" };
void bootup() {
triggerManager.newTrigger("entity_rep_grabber",
"^\\| (Fire|Aodh|Air|Water|Earth) ([ ]*) \\| ([o]*)([!]*)([:]*)([,]*)([.]*) \\| (Pleased|Narked ) \\|$",
"$"+SCRIPT_NAME+".entity_rep_grabber",true,false,false,null,Font.PLAIN);
triggerManager.newTrigger("entity_level_grabber",
"^\\| ([A-Za-z ]+, a|A|An) (tiny|titchy|miniscule|small|medium|large|huge|enormous|humongous) (fire|air|water|earth|magic) entity (glowing|shimmering|gleaming|sizzling|sparkling|glittering|radiating|throbbing|pulsating|blazing)",
"$"+SCRIPT_NAME+".entity_level_grabber",false,false,false,null,Font.PLAIN);
// Gag title line and print another
triggerManager.newTrigger("entity_rep_title_grabber",
"^\\| Entity \\| Power \\| Humour \\|$",
"$"+SCRIPT_NAME+".printTitle",true,false,false,null,Font.PLAIN);
// Inform when establish entity control is off
triggerManager.newTrigger("entity_eec_down",
"^Your entity has trouble understanding you.$",
"$"+SCRIPT_NAME+".eec_down", false, false, false,
null, Font.PLAIN);
// Inform when entity dies.
triggerManager.newTrigger("entity_dead",
"^Your soul cries out in anguish as your faithful companion is slain!$",
"$"+SCRIPT_NAME+".entity_dead", false, false, false,
null, Font.PLAIN);
}
// INFOS
public void eec_down(){ clientGUI.printText("general", "--- EEC DOWN! ---\n"); }
public void entity_dead(){ clientGUI.printText("general", "--- ENTITY IS DEAD! ---\n"); }
// Your entity has trouble understanding you.
// Returns entity color code
static get_color(String type) {
// Type or name
if ( type.equals("Fire") || type.equals( fire_name ) ) {
return "\033[1m\033[31m";
}
else if ( type.equals("Air") || type.equals( air_name ) ) {
return "\033[1m\033[36m";
}
else if ( type.equals("Water") || type.equals( water_name ) ) {
return "\033[1m\033[34m";
}
else if ( type.equals("Earth") || type.equals( earth_name ) ) {
return "\033[1m\033[33m";
}
else if ( type.equals("Magic") || type.equals( magic_name ) ) {
return "\033[1m\033[35m";
}
{ return 0; }
}
void printTitle() {
clientGUI.printText("general", "| Entity \t | Power \t | \t\t\t\t | Humour |\n");
}
// Turns entity type and adjective into numbers
// and prints them
void entity_level_grabber() {
String size = vars.get(2);
String adj = vars.get(4);
size_num = 0;
adj_num = 0;
if (size.equals("tiny")) { size_num = 0;}
if (size.equals("titchy")) { size_num = 1;}
if (size.equals("miniscule")) { size_num = 2;}
if (size.equals("small")) { size_num = 3;}
if (size.equals("medium")) { size_num = 4;}
if (size.equals("large")) { size_num = 5;}
if (size.equals("huge")) { size_num = 6;}
if (size.equals("enormous")) { size_num = 7;}
if (size.equals("humongous")) { size_num = 8;}
// Garantuan is different
if (adj.equals("glowing")) { adj_num = 0;}
if (adj.equals("shimmering")) { adj_num = 1;}
if (adj.equals("gleaming")) { adj_num = 2;}
if (adj.equals("sizzling")) { adj_num = 3;}
if (adj.equals("sparkling")) { adj_num = 4;}
if (adj.equals("glittering")) { adj_num = 5;}
if (adj.equals("radiating")) { adj_num = 6;}
if (adj.equals("throbbing")) { adj_num = 7;}
if (adj.equals("pulsating")) { adj_num = 8;}
if (adj.equals("blazing")) { adj_num = 9;}
clientGUI.printText("general", "| " + size + "(" +size_num + ")\t " + adj + "(" + adj_num +") |\n");
clientGUI.printText("general", "|--------------------------------------------------------------------------|\n");
}
void entity_rep_grabber() {
int totalRep =0;
int repNeeded=0;
entity_type = vars.get(1);
entity_humour = vars.get(8);
// Turn symbols into numbers
totalRep = (vars.get(3).length() * 1000) + (vars.get(4).length() * 100);
totalRep = totalRep + (vars.get(5).length() * 10) + vars.get(6).length();
// Get correct entity color
colB = get_color(entity_type);
// Print the results
clientGUI.printText("general", "| " + colB + entity_type + colA + "\t | " + totalRep + " \t | \t\t\t\t | " +entity_humour+ " |\n");
}