Guest User

Untitled

a guest
Jan 23rd, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. init start
  2. local r = 30 -- Range.
  3. local safelist = {'Mathawk', 'Smion'} -- The bot WILL KS this players. Add more to this if you want.
  4. table.insert(safelist, $name) -- Do not edit it.
  5. init end
  6.  
  7. auto(100)
  8. local ppos = {}
  9. foreach creature p 'pf' do
  10. if not table.find(safelist, p.name) then
  11. table.insert(ppos, {x = p.posx, y = p.posy})
  12. end
  13. end
  14. foreach creature c 'mf' do
  15. local ignore = false
  16. if c.id ~= $mattacker.id then
  17. for i = 1, #ppos do
  18. local difx, dify = ppos[i].x - c.posx, ppos[i].y - c.posy
  19. if math.abs(difx) <= r and math.abs(dify) <= r then
  20. ignore = true
  21. if c.ignored == false then
  22. ignorecreature(c.id)
  23. end
  24. break
  25. end
  26. end
  27. end
  28. if ignore == false and c.ignored == true then
  29. ignorecreature(c.id, true)
  30. end
  31. end
  32. if $attacked.id ~= 0 then
  33. if $attacked.ignored then
  34. stopattack()
  35. end
  36. end
Add Comment
Please, Sign In to add comment