yrpen

Members
  • Content count

    193
  • Joined

  • Last visited

About yrpen

  • Rank
    Full Member

Profile Information

  • Gender
  1. Where are old lua scripts?
  2. .
  3. 1. In PyOT exist actionId, addEvent? 2. How put creature? (I'm not sure it's corect in my script) 3. I commented part with action id 4. Feel free to correct me 5. Based on OTServ script OPENED_HOLE = {294, 383, 392, 469, 470, 482, 484, 485, 489, 7933, 7938, 8249, 8250, 8251, 8252, 8253, 8254, 8255, 8256, 8323, 8380, 8567, 8585, 8972} CLOSED_HOLE = {468, 481, 483, 7932, 8579} shovels = 2554, 5710 TILE_SAND = 9059 ITEM_SCARAB_COIN = 2159 TUMB_ENTRANCE = 1345 SCARAB_TILE = 101 MUD_HOLE = 489 SCARAB_COIN_TILE = 102 duration = 5*60000 #5 minutes @register("useWith", shovels) def useShovel(creature, position, onThing, onPosition, **k): if onThing.itemId in CLOSED_HOLE: if onThing.itemId == 8579: onThing.transform(8585, onPosition) else: onThing.transform(onThing.itemId +1, onPosition) elif onThing.itemId == TILE_SAND: #there is actionId? pass ''' if onThing.actionId == TUMB_ENTRANCE: if random.randint(1, 5) == 1: onThing.transform(MUD_HOLE, onPosition) #addEvent - > transform back after 5 min if onThing.actionId != 0: #set actionId onThing.actionId = TUMB_ENTRANCE elif onThing.actionId == SCARAB_TILE: if random.randint(1, 20) == 1: #correct? placeCreature(Creature("Scarab", onPosition), onPosition) onThing.actionId = SCARAB_TILE + 2 elif onThing.actionId == SCARAB_COIN_TILE: if random.randint(1, 20) == 1: placeItem(Item(ITEM_SCARAB_COIN, 1), onPosition) onThing.actionId = SCARAB_COIN_TILE + 2 elif onThing.actionId == SCARAB_TILE + 2: if random.randint(1, 40) == 1: onThing.actionId = SCARAB_TILE elif onThing.actionId == SCARAB_COIN_TILE + 2: if random.randint(1, 40) == 1: onThing.actionId = SCARAB_COIN_TILE ''' else: return False onThing.decay(onPosition) return True
  4. rope.py if onThing in ropeSpots: #it should be onThing.itemId ?
  5. It's correct? If no, then I'll be greatfull for suggestions ITEM_PRE_WHEAT = 2739 ITEM_WHEAT = 2737 ITEM_BUNCH_WHEAT = 2694 ITEM_PRE_SUGAR_CANE = 5471 ITEM_SUGAR_CANE = 5463 ITEM_BUNCH_SUGAR_CANE = 5467 def onUse(creature, thing, position, onThing, onPosition, **k): if onPosition == 0xFFFF: creature.notPossible() return if onThing.itemId == ITEM_PRE_WHEAT: onThing.transform(ITEM_WHEAT) placeItem(Item(ITEM_BUNCH_WHEAT, 1), onPosition) elif onThing.itemId == ITEM_PRE_SUGAR_CANE: onThing.transform(ITEM_SUGAR_CANE) placeItem(Item(ITEM_BUNCH_SUGAR_CANE, 1), onPosition) else: return onThing.decay(onPosition) I'm beginner in python PS: File: "fishing.py" don't have line "@register" it's correct?
  6. Thanks a lot. Now I'll try learn meta tables using and editing your class. #EDIT# BTW it should be there: http://otfans.net/forums/349-Useful-Lua-Functions