What's new

- Skrypt Skrypt na skorkowanie i otwieranie dzwi itp

Status
Not open for further replies.

Dziobek19

Senior User
Joined
Apr 12, 2008
Messages
588
Reaction score
32
witam mam dla Was skrypt na skurkowanie otwieranie dzwi itp itd xD:)
nie trzeba sciagac ;] daje wam po prostu tresc skrypta ;]
jak kto nie wie jak to zrobic zeby hulalo pisac pomoge ;]
Code:
import time;
class ModuleItemBreecher:
    WAYS = 7;
    BREAK = 0;#Pots, Coal Basins, Plants
    UNLOCK = 1;#Doors
    CHOP = 2;#Tall Grass, Wild Growth
    OPEN = 3;#Doors and Well
    ADITO = 4;#Fields
    SKIN = 5;#Minotaurs, dargons, lizards
    STAKE = 6;#Demnons and vampires

    OBJECT = 0;
    WITH = 1;

    UNCOVER = dict.fromkeys([435,593,608,606,0xfab,0xfb9,0xfdd,4321,4324,4327,4047,4052,4057,3696]); #sewer, closed sand hole, closed grass hole, closed ice hole, skinnable monsters

    ITEMS=dict.fromkeys(range(WAYS));

    for x in ITEMS.keys():
        ITEMS[x] = dict.fromkeys([0,1]);
       
    #Pot,Trough - Coal Basins, Plants, Webs,Bamboo Walls
    ITEMS[BREAK][OBJECT] = dict.fromkeys([3465,2358,2359,2360,2361,2319,182,183,2295,2296,2025,2029,2030,2043,2044,2045,2046,2047,2048,2059,2060,
          2061,2445,2446,2447,2448,2449,2450,2451,2452,2453,2454,
          2465,2466,2467,2468,2524,2904,2959,2960,2961,2962,2963,
          2964,2975,2976,2979,2982,2986,2997,2998,2999,3000,3484,
          3485,3486,3487,3510,3511,3512,3513,5046,5055,5056,6109,
          6110,6111,6112,6367,6368,6369,6370,2473,2315]);
    #Knife, Dagger, Scythe, Disintegrate - weapons
    ITEMS[BREAK][WITH] = dict.fromkeys([0xcdb,0xcc3,0xd7d,0xc7d,3286]);
       
    #Locked Doors
    ITEMS[UNLOCK][OBJECT] = dict.fromkeys([1638,1640,1656,1658,1685,1694,5082,5084,5100,5109,5118,
          5127,5283,5285,5514,5516,6197,6199,6254,6256,6894,6903,
          7036,7045,7054,7056,7717,7719,8255,8257,8357,8359]);
    #Keys
    ITEMS[UNLOCK][WITH] = dict.fromkeys([0xb97,0xb98,0xb99,0xb9a,0xb9b,0xb9c,0xb9d]);
       
    #Tall Grass, Wild Growth
    ITEMS[CHOP][OBJECT] = dict.fromkeys([3696,2130]);
    #Machete,heavy machete
    ITEMS[CHOP][WITH] = dict.fromkeys([0xcec,0xd02]);
       
    #Closed Doors and Well
    ITEMS[OPEN][OBJECT] = dict.fromkeys([1628,1629,1631,1632,1650,1651,1653,1654,1668,1669,1671,
          1672,1682,1683,1691,1692,4912,4913,5006,5007,5097,5098,
          5106,5107,5115,5116,5124,5125,5133,5134,5136,5137,5139,
          5140,5142,5143,5277,5278,5280,5281,5732,5733,5735,5736,
          6191,6192,6194,6195,6248,6249,6251,6252,6891,6892,6900,
          6901,7033,7034,7042,7043,7711,7712,7714,7715,8249,8250,
          8252,8253,8351,8352,8354,8355,1931]);
    #Nothing
    ITEMS[OPEN][WITH] = dict.fromkeys([]);
       
    #All Harmful Fields
    ITEMS[ADITO][OBJECT] = dict.fromkeys([2118,2119,2121,2122,2123,2124,2126,2127]);
    #Adito Grav Rune
    ITEMS[ADITO][WITH] = dict.fromkeys([0xc4c]);
       
    #Dead skinable monsters
    ITEMS[SKIN][OBJECT] = dict.fromkeys([4011,4047,4052,4057,4062,4272,4286,4321,4324,4327,8106,4112,4212]);
    #Obsidian Knife
    ITEMS[SKIN][WITH] = dict.fromkeys([5908]);

    #Dead stakable monsters
    ITEMS[STAKE][OBJECT] = dict.fromkeys([4097,4138]);
    #Blessed Wooden Stake
    ITEMS[STAKE][WITH] = dict.fromkeys([0x1736]);

    #Special: Contains pairs of items.  For using only one unique item on one unique object
    for x in [(0xd80,355),(3653,3453),(1944,3605)]:#(pick,mud),(Wheat,Scythe),(wheat,mill)
        ITEMS[WAYS]=dict.fromkeys([0,1]);
        ITEMS[WAYS][OBJECT]=dict.fromkeys([x[0]]);
        ITEMS[WAYS][WITH]=dict.fromkeys([x[1]]);
        WAYS+=1;

   
    def getName(self):
        return "Item Breecher";

    def getVersion(self):
        return "1.0";

    def getFunDef(self,nr):
        if (nr==0): return (0,1000,self.unbreech);
        if (nr==1): return (0,3000,self.uncover);
        return();

    def getConfigParam(self,nr):
        if (nr==0): return ('destroyFields','0-Def,1-On');
        if (nr==1): return ('uncoverItemPiles','1-Def,0-Off This uncovers tiles with more than 8 items on them');
        if (nr==2): return ('shovePlayers','0-Def,1-On This will push people away from you and out of your way.');
        return();

    def destroy(self,itemType,itemID,x,y,i):
        me=tareader.readSelfCharacter();
        for contNr in range(taitem.getValueForConst('maxContainers')):
            cont=tareader.readContainer(contNr);
            if cont['flagOnOff'] :
                for itemNr in range(cont['itemsInside']):
                    item=tareader.readContainerItem(contNr,itemNr);
                    if self.ITEMS[itemType][self.WITH].get(item['objectId'],0)!=0:
                        tasender.useWithObjectFromContainerOnFloor(item['objectId'], 0x40+contNr, itemNr, itemID,x,y,me['z'], 2);
                        return;
        return;
   
    def unbreech(self,params):
        me=tareader.readSelfCharacter();
        for y in range(-1,2):
            for x in range(-1,2):
                topPos=tareader.mapGetPointTopPos(x,y,0);
                itemID = tareader.mapGetPointItemId(x,y,0,topPos);
                for means in range(self.WAYS):
                    if self.ITEMS[means][self.OBJECT].get(itemID,0) != 0:
                        if means != self.OPEN and (means != self.ADITO or params['destroyFields'] == '1'):
                            self.destroy(means,itemID,me['x']+x,me['y']+y,topPos);
                        elif means == self.OPEN:
                            face = [-abs(me['lookDirection']%4-1)+1,-abs(me['lookDirection']%4-2)+1];
                            if (face[0]*x + face[1]*y)>=0:
                                tasender.useItemOnFloor (itemID,me['x']+x,me['y']+y,me['z']);
        return;

    def findSpaces(self,rad,playerBlock=0):
        me=tareader.readSelfCharacter();
        ans=[];
        for x in range(-rad,rad+1):
            for y in range(-rad,rad+1):
                if tamap.isPointAvailableNoProh(me['x']+x,me['y']+y,me['z']) and ((not playerBlock) or tareader.mapGetPointSeenOnTopPos(x,y,0)==tareader.mapGetPointTopPos(x,y,0)):#player not on top.
                    ans+=[(x,y)];
        return ans;

    def uncover(self,params):
        me=tareader.readSelfCharacter();
        for y in range(-1,2):
            for x in range(-1,2):
                stack = tareader.mapGetPointItemsCount(x,y,0);
                topPos = tareader.mapGetPointTopPos(x,y,0);
                items=[];
                for i in range(topPos,stack):
                    items+=[(i,(tareader.mapGetPointItemId(x,y,0,i)))];
                for i in range(topPos-1,-1,-1):
                    items+=[(i,tareader.mapGetPointItemId(x,y,0,i))];
                for i in range(len(items)):
                    itemID = items[i][1];
                    if self.UNCOVER.get(itemID,0) != 0 or (itemID==99 and params['shovePlayers'] == '1' and not x==y==0) or (i==9 and params['uncoverItemPiles'] != '0') or (items[i-1][1]==99 and not(x==0 and y==0) and params['shovePlayers'] == '1' and 100<tareader.mapGetPointItemExtraInfo(x,y,0,items[i-1][0],1)<0x40000000):
                        for j in range(0,min(len(items)-topPos,i)):
                            itemID = items[j][1];
                            quant = tareader.mapGetPointItemExtraInfo(x,y,0,items[j][0],1);
                            if quant ==0 or quant > 100: quant = 1;
                            a1=a2=k=0;
                            spaces=self.findSpaces(2,itemID==99);
                            spaceFound=0;
                            for k in range(len(spaces)):
                                r=random.randint(0,len(spaces)-1);
                                a1=spaces[r][0];
                                a2=spaces[r][1];
                                spaces=spaces[:r]+spaces[r+1:];
                                if tamap.isPointAvailableNoProh(me['x']+a1,me['y']+a2,me['z']) and not(a1==x and a2==y):
                                    if itemID!=99 or (abs(x-a1)<=1 and abs(y-a2)<=1) and (a1!=0 or a2!=0):
                                        if params['shovePlayers']=='0' or abs(a1)>=2 or abs(a2)>=2:
                                            spaceFound=1;
                                            break;
                            if spaceFound:
                                tasender.moveObjectFromFloorToFloor(itemID,me['x']+x,me['y']+y,me['z'],me['x']+a1,me['y']+a2,me['z'],quant);
                                time.sleep(.4);
                            else:
                                print "failed to find a space to move item to",spaces;
                               
        return;

tibiaauto.registerPlugin(ModuleItemBreecher);
 

DanJ93

ElfBot Helper
Joined
Jan 18, 2009
Messages
2,631
Reaction score
198
Odp: Skrypt na skorkowanie i otwieranie dzwi itp

Nie znam si? na TA,
dlatego mam par? pyta?, co z tym zrobi?? Gdzie to wgra??
Jak sprawdzi? ID dead?w potwor?w i jak je potem doda? do tego skrypta?
 

clarios

New User
Joined
Jan 18, 2012
Messages
6
Reaction score
0
Odp: Skrypt na skorkowanie i otwieranie dzwi itp

Witam ! Tak jak pan up chcialbym sie dowiedziec jak i co z tym zrobic zeby dzialalo ? ;)
 
Status
Not open for further replies.
Top