Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import string
- import time
- friends = [['friend1', 80],
- ['friend2', 70],
- ['friend3', 50],
- ] # list of friends first is char name 2nd is hp percent
- class ModuleHealFriend:
- def getName(self):
- return "Heal Friend";
- def getVersion(self):
- return "1.0";
- def getFunDef(self,nr):
- if (nr==0): return (0,500,self.fun1); # setup script to run every 1/2 second
- return ();
- def getConfigParam(self,nr):
- return();
- def fun1(self,params):
- selfCh=tareader.readSelfCharacter();
- if (selfCh['mana'] > 70): # check for enough mana
- if tareader.readBattleListMin()-1 > tareader.readBattleListMax()+1:
- minblist = tareaderBattleListMax()+1
- maxblist = tareaderBattleListMin()-1
- else:
- minblist = tareaderBattleListMin()-1
- maxblist = tareaderBattleListMax()+1
- for i in range(minblist,maxblist): # loop through blist
- tempCh = tareader.readVisibleCreature(i);
- if tempCh['visible'] == 1:
- for p in friends:
- # the if statment checks to see if they are there if they
- # are in your range of known chars... if they are less than
- # the given perc and if they are on the same floor as you
- if (tempCh['name'] == p[0] and tempCh['hpPercLeft'] < p[1] and selfCh['z'] == tempCh['z']):
- tasender.say(('exura sio "' + str(p[0])));
- time.sleep(2); # wait for exaust
- tibiaauto.registerPlugin(ModuleHealFriend)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement