@@ -40,24 +40,6 @@ public class CooksAssistant extends QuestActivity {
40
40
);
41
41
private boolean operated = false ;
42
42
private boolean put = false ;
43
- private final MessageListener MILL_MESSAGE_LISTENER = message -> {
44
- if (message .getType () != Message .MessageType .GAME ) {
45
- return ;
46
- }
47
-
48
- String messageStr = message .getMessage ();
49
-
50
- if (messageStr .contains ("There is already grain in the hopper." ) ||
51
- messageStr .contains ("You put the grain in the hopper." )) {
52
- put = true ;
53
- return ;
54
- }
55
-
56
- if (messageStr .contains ("You operate the hopper. The grain slides down the chute." )) {
57
- operated = true ;
58
- return ;
59
- }
60
- };
61
43
62
44
public CooksAssistant () {
63
45
super (Quest .COOKS_ASSISTANT );
@@ -67,12 +49,10 @@ public CooksAssistant() {
67
49
public void onStart () {
68
50
depositAllBanking .exchangeContext (getBot ());
69
51
cookDialogueCompleter .exchangeContext (getBot ());
70
- getBot ().addMessageListener (MILL_MESSAGE_LISTENER );
71
52
}
72
53
73
54
@ Override
74
55
public void onEnd () {
75
- getBot ().removeMessageListener (MILL_MESSAGE_LISTENER );
76
56
}
77
57
78
58
@ Override
@@ -157,7 +137,9 @@ private void fillHopper() {
157
137
}
158
138
159
139
if (hopper .interact ("Use" )) {
160
- Sleep .sleepUntil (() -> put , 15000 );
140
+ Sleep .sleepUntil (() -> myPlayer ().isAnimating (), 5000 );
141
+ Sleep .sleepUntil (() -> !myPlayer ().isAnimating (), 3000 );
142
+ put = true ;
161
143
}
162
144
}
163
145
}
@@ -175,7 +157,9 @@ private void operateHopper() {
175
157
}
176
158
177
159
if (controls .interact ("Operate" )) {
178
- Sleep .sleepUntil (() -> operated , 10000 );
160
+ Sleep .sleepUntil (() -> myPlayer ().isAnimating (), 5000 );
161
+ Sleep .sleepUntil (() -> !myPlayer ().isAnimating (), 3000 );
162
+ operated = true ;
179
163
}
180
164
}
181
165
}
0 commit comments