Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. import string
  2. import time
  3.  
  4. friends = [['friend1', 80],
  5. ['friend2', 70],
  6. ['friend3', 50],
  7. ] # list of friends first is char name 2nd is hp percent
  8.  
  9. class ModuleHealFriend:
  10.  
  11.  
  12. def getName(self):
  13. return "Heal Friend";
  14.  
  15. def getVersion(self):
  16. return "1.0";
  17.  
  18. def getFunDef(self,nr):
  19. if (nr==0): return (0,500,self.fun1); # setup script to run every 1/2 second
  20. return ();
  21.  
  22. def getConfigParam(self,nr):
  23. return();
  24.  
  25.  
  26. def fun1(self,params):
  27. selfCh=tareader.readSelfCharacter();
  28. if (selfCh['mana'] > 70): # check for enough mana
  29. if tareader.readBattleListMin()-1 > tareader.readBattleListMax()+1:
  30. minblist = tareaderBattleListMax()+1
  31. maxblist = tareaderBattleListMin()-1
  32. else:
  33. minblist = tareaderBattleListMin()-1
  34. maxblist = tareaderBattleListMax()+1
  35. for i in range(minblist,maxblist): # loop through blist
  36. tempCh = tareader.readVisibleCreature(i);
  37. if tempCh['visible'] == 1:
  38. for p in friends:
  39. # the if statment checks to see if they are there if they
  40. # are in your range of known chars... if they are less than
  41. # the given perc and if they are on the same floor as you
  42. if (tempCh['name'] == p[0] and tempCh['hpPercLeft'] < p[1] and selfCh['z'] == tempCh['z']):
  43. tasender.say(('exura sio "' + str(p[0])));
  44. time.sleep(2); # wait for exaust
  45.  
  46.  
  47. tibiaauto.registerPlugin(ModuleHealFriend)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement