w9s66v09c8x5o1fl3p0

Rifbot Slime Training

Jan 11th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.36 KB | None | 0 0
  1. --[[
  2.     Script Name:        Slime Training
  3.     Description:        Fist recognize mother attack it and run script. Rifbot mark mother and will avoid it.
  4.     Author:             Ascer - example
  5. ]]
  6.  
  7. local MAIN_DELAY = {500, 1800}      -- set your delay
  8. local MONSTER = "Slime"             -- monster name
  9. local RANGE = 1                     -- attack when moster distance from self = 1, set more if u're paladin
  10.  
  11. -- DONT'T EDIT BELOW THIS LINE
  12.  
  13. local mother = 0
  14.  
  15. Module.New("Slime Training", function (mod)
  16.  
  17.     -- find and mark mother
  18.     if mother <= 0 then
  19.         local target = Self.TargetID()
  20.         for i, mob in pairs(Creature.iMonsters(7)) do
  21.             if mob.name == MONSTER then
  22.                 if target == mob.id then
  23.                     mother = mob.id
  24.                     Rifbot.MemoryWrite(mob.addr + 68 , 35, "dword") -- change mother slime to Demon XD working until you change floor or logout
  25.                     Self.Stop() -- stop attack mother.
  26.                     break
  27.                 end
  28.             end
  29.         end
  30.     else
  31.         -- control monsters.
  32.         local target = Self.TargetID()
  33.         if target == mother then
  34.             Self.Stop() -- stop attack if mother is target.
  35.         end
  36.        
  37.         if target == 0 then -- do actions only if target.id = 0
  38.             for i, mob in pairs(Creature.iMonsters(RANGE)) do
  39.                 if mob.name == MONSTER and mob.id ~= mother then
  40.                     Creature.Attack(mob.id) -- attack slime summon
  41.                     break
  42.                 end
  43.             end
  44.         end
  45.     end            
  46.  
  47.     mod:Delay(MAIN_DELAY[1], MAIN_DELAY[2]) -- set random delay
  48. end)
Add Comment
Please, Sign In to add comment