/
2amumu.py
303 lines (234 loc) · 9.83 KB
/
2amumu.py
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
from winstealer import *
from commons.utils import *
from commons.skills import *
from commons.items import *
from commons.targeting import *
import time
from copy import deepcopy
import math
import urllib3, json, urllib, ssl
from commons.targit import *
winstealer_script_info = {
"script": "Amumu",
"author": "SA1",
"description": "Amumu",
"target_champ": "amumu"
}
combo_key = 0
laneclear_key = 47
use_q_in_combo = True
use_e_in_combo = True
use_r_in_combo = True
use_w_in_combo = True
use_Qclear = True
use_Wclear = True
use_Eclear = True
q = {'Range': 1049} #1100, using safe range
w = {'Range': 350}
e = {'Range': 350}
r = {'Range': 550}
MaxRCountForUse = 1
def winstealer_load_cfg(cfg):
global use_q_in_combo, use_e_in_combo, use_r_in_combo, use_w_in_combo
global combo_key, laneclear_key
global use_Qclear, use_Wclear, use_Eclear
global MaxRCountForUse
combo_key = cfg.get_int("combo_key", 57)
laneclear_key = cfg.get_int("harass_key", 47)
use_q_in_combo = cfg.get_bool("use_q_in_combo", True)
use_w_in_combo = cfg.get_bool("use_w_in_combo", True)
use_e_in_combo = cfg.get_bool("use_e_in_combo", True)
use_r_in_combo = cfg.get_bool("use_r_in_combo", True)
use_Qclear = cfg.get_bool("use_Qclear", True)
use_Wclear = cfg.get_bool("use_Wclear", True)
use_Eclear = cfg.get_bool("use_Eclear", True)
MaxRCountForUse = cfg.get_float("MaxRCountForUse", 1)
def winstealer_save_cfg(cfg):
global use_q_in_combo, use_e_in_combo, use_r_in_combo, use_w_in_combo
global combo_key, laneclear_key
global use_Qclear, use_Wclear, use_Eclear
global MaxRCountForUse
cfg.set_int("combo_key", combo_key)
cfg.set_int("laneclear_key", laneclear_key)
cfg.set_bool("use_q_in_combo", use_q_in_combo)
cfg.set_bool("use_w_in_combo", use_w_in_combo)
cfg.set_bool("use_e_in_combo", use_e_in_combo)
cfg.set_bool("use_r_in_combo", use_r_in_combo)
cfg.set_bool("use_Qclear", use_Qclear)
cfg.set_bool("use_Wclear", use_Wclear)
cfg.set_bool("use_Eclear", use_Eclear)
cfg.set_float("MaxRCountForUse", MaxRCountForUse)
def winstealer_draw_settings(game, ui):
global use_q_in_combo, use_e_in_combo, use_r_in_combo, use_w_in_combo
global combo_key, laneclear_key
global use_Qclear, use_Wclear, use_Eclear
global MaxRCountForUse
ui.text("Amumu")
combo_key = ui.keyselect("Combo key", combo_key)
laneclear_key = ui.keyselect("Laneclear key", laneclear_key)
if ui.treenode("Combo Settings"):
use_q_in_combo = ui.checkbox("Use Q in combo", use_q_in_combo)
use_w_in_combo = ui.checkbox("Use W in combo", use_w_in_combo)
use_e_in_combo = ui.checkbox("Use E in combo", use_e_in_combo)
ui.treepop()
if ui.treenode("Farm-clear settings"):
use_Qclear = ui.checkbox("Farm-clear with Q", use_Qclear)
use_Wclear = ui.checkbox("Farm-clear with W", use_Wclear)
use_Eclear = ui.checkbox("Farm-clear with E", use_Eclear)
ui.treepop()
if ui.treenode("[R] Settings"):
use_r_in_combo = ui.checkbox("Use R in combo", use_r_in_combo)
MaxRCountForUse = ui.dragfloat ("Min targets use for R", MaxRCountForUse, 0,1,3)
ui.treepop()
RTargetCount = 0
def getCountR(game, dist):
global RTargetCount, MaxRCountForUse
RTargetCount = 0
for champ in game.champs:
if (
champ
and champ.is_visible
and champ.is_enemy_to(game.player)
and champ.isTargetable
and champ.is_alive
and game.is_point_on_screen(champ.pos)
and game.distance(game.player, champ) < dist
):
RTargetCount = RTargetCount + 1
if int(RTargetCount) >= MaxRCountForUse:
return True
else:
return False
def is_immobile(game, target):
for buff in target.buffs:
if 'snare' in buff.name.lower ():
return True
elif 'stun' in buff.name.lower ():
return True
elif 'suppress' in buff.name.lower ():
return True
elif 'root' in buff.name.lower ():
return True
elif 'taunt' in buff.name.lower ():
return True
elif 'sleep' in buff.name.lower ():
return True
elif 'knockup' in buff.name.lower ():
return True
elif 'binding' in buff.name.lower ():
return True
elif 'morganaq' in buff.name.lower ():
return True
elif 'jhinw' in buff.name.lower ():
return True
return False
class Fake_target ():
def __init__(self, name, pos, gameplay_radius):
self.name = name
self.pos = pos
self.gameplay_radius = gameplay_radius
def predict_pos(target,casttime):
"""Predicts the target's new position after a duration"""
target_direction = target.ai_navEnd.sub(target.ai_navBegin).normalize()
veloc=target.ai_velocity
orientation = veloc.normalize()
if veloc.x ==0.0 and veloc.y == 0.0:
return target.pos
# Target movement speed
target_movement_speed = target.movement_speed
# The distance that the target will have traveled after the given duration
distance_to_travel = target_movement_speed * casttime
# distance_to_travel2=(timetoimpact / 2.2)* 1.5
return target.pos.add(target_direction.scale(distance_to_travel))
def Combo(game):
before_cpos = game.get_cursor ()
q_spell = getSkill(game, "Q")
w_spell = getSkill(game, "W")
e_spell = getSkill(game, "E")
r_spell = getSkill(game, "R")
if use_q_in_combo :
target = TargetSelector (game,q['Range'])
if target :
if game.player.Q.timeCharge >0:
if IsReady(game, q_spell):
q_travel_time = q['Range'] / 2000
predicted_pos = predict_pos (target, q_travel_time)
predicted_target = Fake_target (target.name, predicted_pos, target.gameplay_radius)
if game.player.pos.distance (predicted_target.pos) <= q['Range'] and not IsCollisioned(game, predicted_target):
if game.player.mana>=50:
game.move_cursor (game.world_to_screen (predicted_target.pos))
time.sleep (0.01)
q_spell.trigger (False)
time.sleep (0.01)
game.move_cursor (before_cpos)
if use_w_in_combo and IsReady(game, w_spell):
target = TargetSelector (game, w["Range"])
if target:
if game.player.pos.distance(target.pos) <= w["Range"]:
if not getBuff(game.player, "AuraofDespair") :
if game.player.mana>=8:
w_spell.trigger(False)
if not target:
if getBuff(game.player, "AuraofDespair") :
w_spell.trigger(False)
if use_e_in_combo and IsReady(game, e_spell):
target = TargetSelector(game, e["Range"])
if ValidTarget(target) and IsReady(game, e_spell):
if game.player.mana>=30:
game.move_cursor (game.world_to_screen (target.pos))
time.sleep (0.01)
e_spell.trigger (False)
time.sleep (0.01)
game.move_cursor (before_cpos)
if (
use_r_in_combo
and getCountR(game, r["Range"])
and IsReady(game, r_spell)
):
target = TargetSelector(game, r["Range"])
if target:
if game.player.mana>=100:
game.move_cursor (game.world_to_screen (target.pos))
time.sleep (0.01)
r_spell.trigger (False)
time.sleep (0.01)
game.move_cursor (before_cpos)
def Farmclear(game):
before_cpos = game.get_cursor ()
q_spell = getSkill(game, "Q")
w_spell = getSkill(game, "W")
e_spell = getSkill(game, "E")
if use_Qclear and IsReady(game, q_spell) :
target = GetBestJungleInRange(game, 1100)
if target :
if game.player.Q.timeCharge >0:
if IsReady(game, q_spell) and game.player.mana>=50:
game.move_cursor (game.world_to_screen (target.pos))
time.sleep (0.01)
q_spell.trigger(False)
time.sleep (0.01)
game.move_cursor (before_cpos)
if use_Wclear and IsReady(game, w_spell) and game.player.mana>=8:
target = GetBestJungleInRange (game, w["Range"])
if target:
if game.player.pos.distance(target.pos) <= w["Range"]:
if not getBuff(game.player, "AuraofDespair") :
w_spell.trigger(False)
if not target:
if getBuff(game.player, "AuraofDespair") :
w_spell.trigger(False)
if use_Eclear and IsReady(game, e_spell):
creep = GetBestJungleInRange(game, e["Range"])
if creep:
if game.player.mana>=30:
e_spell.move_and_trigger(game.world_to_screen(creep.pos))
def winstealer_update(game, ui):
global use_q_in_combo, use_e_in_combo, use_r_in_combo, use_w_in_combo
global combo_key, laneclear_key
global use_Qclear, use_Wclear, use_Eclear
global MaxRCountForUse
if game.player.is_alive and game.is_point_on_screen(game.player.pos) :
if game.was_key_pressed(laneclear_key):
Farmclear(game)
if game.was_key_pressed(combo_key):
Combo(game)