forked from celoko/batclient_triggers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbm.bcs
215 lines (171 loc) · 6.58 KB
/
bm.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
SCRIPT_NAME = "bm";
SCRIPT_DESC = "Triggers for beastmaster";
// Buff tracker shows last time when skill was used.
// Usage: $bm.show
//
// Not tested in a while
//
// Erygon 2014
import java.util.Date;
// Set channel e.g. "@@party say"
String output = "@@party report";
// Mount name for buff reporting
String mountName = "";
String buffName = "";
Long rugTime = 0;
Long rtPainTime = 0;
Long rtFrostTime = 0;
Long rtFlameTime = 0;
Long min = 0;
Long sec = 0;
Long secTemp = 0;
public void dismounted(){
// Inform party
clientGUI.doCommand( output+" Dismounted!" );
// Lead mount, you should use: alias mymount mount_name
clientGUI.doCommand( "lead mymount" );
}
public void rtBuffActive(){
buffName = vars.get(1);
if ( buffName.equals("reluctantly slinks forward") ){
clientGUI.doCommand( output+" Ride underground active." );
rugTime = System.currentTimeMillis();
} else if ( buffName.equals("pain") ){
clientGUI.doCommand( output+" Ride through pain active." );
rtPainTime = System.currentTimeMillis();
} else if ( buffName.equals("cold") ) {
clientGUI.doCommand( output+" Ride through frost active." );
rtFrostTime = System.currentTimeMillis();
} else if ( buffName.equals("fire") ) {
clientGUI.doCommand( output+" Ride through flame active." );
rtFlameTime = System.currentTimeMillis();
}
}
// Inform when buffs drop
public void rtBuffDrop(){
buffName = vars.get(2);
if ( buffName.equals("being underground") ){
clientGUI.doCommand( output+" Ride underground dropping. ("+getTimeDiff(rugTime)+")" );
} else if ( buffName.equals("pain") ){
clientGUI.doCommand( output+" Ride through pain dropping. ("+getTimeDiff(rtPainTime)+")" );
} else if ( buffName.equals("cold") ) {
clientGUI.doCommand( output+" Ride through frost dropping. ("+getTimeDiff(rtFrostTime)+")" );
} else if ( buffName.equals("fire") ) {
clientGUI.doCommand( output+" Ride through flame dropping. ("+getTimeDiff(rtFlameTime)+")" );
}
}
public void mountHungry(){
// Inform rider
clientGUI.printText("general", "Mount is hungry!\n");
}
public void offmount(){
// Inform rider
clientGUI.printText("general", "YOU ARE OFF YOUR MOUNT!\n");
}
public void cannotStoreMount(){
// Inform rider
clientGUI.printText("general", "CANNOT STORE MOUNT! Empty sabblebags.\n");
// Lead mount
clientGUI.doCommand( "lead mount" );
}
public void stableFull(){
// Inform rider
clientGUI.printText("general", "CANNOT STORE MOUNT! Stable full.\n");
// Lead mount
clientGUI.doCommand( "lead mount" );
}
public void scanMount(){
clientGUI.doCommand( "scan mymount" );
}
// Show buff times
public void show(){
// Usage: $bm.show
clientGUI.printText("general", "rug: "+getTimeDiff(rugTime)+" pain: "+getTimeDiff(rtPainTime)+" frost: "+getTimeDiff(rtFrostTime)+" flame: "+getTimeDiff(rtFlameTime)+"\n");
}
// convert milliseconds to minutes and seconds or seconds
// if time is over 50min, show n/a
public getTimeDiff(Long time){
secTemp = (System.currentTimeMillis() - time)/1000;
if ( secTemp > 3000 ) {
return "n/a";
}
if ( secTemp > 60 ) {
min = Math.floor(secTemp/60);
sec = secTemp - min * 60;
return min+"m"+sec+"s";
}
else
{
return secTemp+"s";
}
}
void bootup(){
// Dismount messages
triggerManager.newTrigger("bm_dismount1",
"^You are knocked off your mount!$",
"$"+SCRIPT_NAME+".dismounted", false, false, false,
null, Font.PLAIN);
triggerManager.newTrigger("bm_dismount2",
"^Your annoyed mount throws you!$",
"$"+SCRIPT_NAME+".dismounted", false, false, false,
null, Font.PLAIN);
triggerManager.newTrigger("bm_dismount3",
"^Your mount throws you!$",
"$"+SCRIPT_NAME+".dismounted", false, false, false,
null, Font.PLAIN);
triggerManager.newTrigger("bm_offmountLite",
"^You are now off your mount.$",
"$"+SCRIPT_NAME+".offmount", false,true,false,new Color[]{new Color(255,0,51)}, Font.PLAIN);
// Rug
triggerManager.newTrigger("bm_rug_active",
"^It responds to the motivation and (reluctantly slinks forward).$",
"$"+SCRIPT_NAME+".rtBuffActive", false, false, false,
null, Font.PLAIN);
// Ride through x up
triggerManager.newTrigger("bm_rtbuff_active",
//"^(It|Your mount) responds to the motivation and (reluctantly slinks forward|ignores (pain|cold|fire)).$",
"^Your mount responds to the motivation and ignores (pain|cold|fire).$",
"$"+SCRIPT_NAME+".rtBuffActive", false, false, false,
null, Font.PLAIN);
// Buffs down
triggerManager.newTrigger("bm_rtbuff_drop",
"^You think that ([A-Za-z -]*) should be worried about (being underground|pain|cold|fire) right about now.$",
//"You think that ([A-Za-z -]*) should be worried about (being underground|pain|cold|fire) right about now.",
"$"+SCRIPT_NAME+".rtBuffDrop", false, false, false,
null, Font.PLAIN);
// Other stuff
triggerManager.newTrigger("bm_mount_hungry",
"([A-Za-z -]*) cannot be ridden right now.$",
"$"+SCRIPT_NAME+".mountHungry", false, false, false,
null, Font.PLAIN);
triggerManager.newTrigger("bm_cannot_store",
"^You cannot store a mount with items in its saddlebags.$",
"$"+SCRIPT_NAME+".cannotStoreMount", false, false, false,
null, Font.PLAIN);
triggerManager.newTrigger("bm_stable_full",
"^Sadly there is no room in the stable at this time.$",
"$"+SCRIPT_NAME+".stableFull", false, false, false,
null, Font.PLAIN);
// Some passive offu lites, untested
// Golden griffon
triggerManager.newTrigger( "bm_lite_ggriffon",
"tries to dodge ([A-Za-z -]*) onslaught, but gets magically roasted instead!",
"", false,true,false,new Color[]{new Color(255,0,51)}, Font.PLAIN);
// Hoar frost gryphon
triggerManager.newTrigger( "bm_lite_gryphon",
"tries to avoid Hoar frost gryphons\'s icy attack, but is frozen instead!",
"", false,true,false,new Color[]{new Color(255,0,51)}, Font.PLAIN);
// Giant crab
triggerManager.newTrigger( "bm_lite_crab",
"SNIVELS as the giant crab RENDS it!",
"", false,true,false,new Color[]{new Color(255,0,51)}, Font.PLAIN);
// Ancient drake
triggerManager.newTrigger( "bm_lite_adrake",
"tries to outwit Ancient chaos drake, but fails and gets IMPALED instead!!",
"", false,true,false,new Color[]{new Color(255,0,51)}, Font.PLAIN);
// Scan mount every 10 rounds, just in case..
triggerManager.newTrigger("bm_scan_mount",
"Round [0-9]0",
"$"+SCRIPT_NAME+".scanMount", false, false, false,
null, Font.PLAIN);
}