1
Stealth scripts / Re: [py] PVE Bot with Zone Restrictions (Fan Dancer example)
« on: December 22, 2020, 10:02:15 AM »
Tested! Work!
Big Thanks
Big Thanks

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
22:41:25:992 []: Traceback (most recent call last):
22:41:25:994 []: File "C:\Users\pc\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
22:41:25:994 []: return _run_code(code, main_globals, None,
22:41:25:995 []: File "C:\Users\pc\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
22:41:25:995 []: exec(code, run_globals)
22:41:25:996 []: File "C:\Users\pc\Desktop\stelth\py_stealth\__main__.py", line 80, in <module>
22:41:25:998 []: main()
22:41:25:998 []: File "C:\Users\pc\Desktop\stelth\py_stealth\__main__.py", line 59, in main
22:41:25:999 []: module = __import__(os.path.splitext(filename)[0])
22:41:25:999 []: File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
22:41:26:000 []: File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
22:41:26:001 []: File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
22:41:26:002 []: File "C:\Users\pc\Desktop\stelth\py_stealth\py34.py", line 33, in exec_module
22:41:26:003 []: exec(code, module.__dict__)
22:41:26:004 []: File "C:\Users\pc\Desktop\DancerDojo.py", line 167, in <module>
22:41:26:004 []: LootCorpse(_corpse)
22:41:26:005 []: File "C:\Users\pc\Desktop\DancerDojo.py", line 55, in LootCorpse
22:41:26:005 []: _count = Count(_loot)
22:41:26:007 []: File "C:\Users\pc\Desktop\stelth\py_stealth\methods.py", line 3022, in Count
22:41:26:008 []: FindType(ObjType, Backpack())
22:41:26:008 []: File "C:\Users\pc\Desktop\stelth\py_stealth\methods.py", line 1480, in FindType
22:41:26:010 []: return _find_graphic(ObjType, 0xFFFF, Container, False)
22:41:26:011 []: File "C:\Users\pc\Desktop\stelth\py_stealth\_protocol.py", line 171, in __call__
22:41:26:011 []: data += cls(val).serialize()
22:41:26:012 []: File "C:\Users\pc\Desktop\stelth\py_stealth\_datatypes.py", line 32, in serialize
22:41:26:014 []: return struct.pack(self.fmt, self)
22:41:26:015 []: struct.error: ushort format requires 0 <= number <= 0xffff
from py_stealth import *
from helpers import *
from datetime import datetime
Confidence = False
FanDancer = 0x0F7
Corpse = 0x2006
LootBag = 0
SendingBag = 0
PlayerTypes = [183, 184, 185, 186, 400, 401, 402, 403, 605, 606, 607, 608, 666,
667, 694, 695, 750, 751, 970]
# entrance 79, 97, 326, 344 - bloodyroom 104, 115, 640, 660
def OnDrawObject(_objID):
if _objID != Self():
if GetType(_objID) in PlayerTypes:
_tooltipRec = GetTooltipRec(_objID)
if len(_tooltipRec) > 0:
if _tooltipRec[0]['Cliloc_ID'] == 1050045:
_name = _tooltipRec[0]['Params'][1]
_now = datetime.now()
_now = _now.strftime("%m/%d/%Y %H:%M:%S")
AddToSystemJournal(f'Player Found: {_name} at {_now}')
return
def OnClilocSpeech(_param1, _param2, _param3, _message):
global Confidence
if 'exude' in _message:
Confidence = True
elif 'wanes' in _message:
Confidence = False
return
def CheckWeight():
if (Weight() >= MaxWeight()) and (SendingBag != 0):
if FindTypeEx(0x0EED, 0xFFFF, Backpack(), True):
_gold = GetFoundList()
UseObject(SendingBag)
Wait(1500)
WaitTargetObject(_gold[0])
else:
AddToSystemJournal("I'm overweight and I can't find gold to send..")
def LootCorpse(_corpse):
UseObject(_corpse)
Wait(1500)
_lootList = NewFind([0xFFFF], [0xFFFF], [_corpse], True)
for _loot in _lootList:
if (GetType(_loot) == 0x0EED) and (SendingBag != 0):
_count = Count(_loot)
MoveItem(_loot, _count, LootBag, 0, 0, 0)
else:
_tooltipRec = GetTooltipRec(_loot)
if GetParam(_tooltipRec, 1112857) >= 20 and not\
ClilocIDExists(_tooltipRec, 1152714) and not\
ClilocIDExists(_tooltipRec, 1049643):
AddToSystemJournal(f'Looting Item: {_loot}')
MoveItem(_loot, 1, LootBag, 0, 0, 0)
InsureItem(_loot)
_lootList1 = NewFind([0x108A, 0x1F09, 0x4212, 0x1086, 0x1F06, 0x4211], [0xFFFF], [_corpse], True)
for _loot1 in _lootList1:
_tooltipRec = GetTooltipRec(_loot1)
if GetParam(_tooltipRec, 1060411) >= 20 and not\
ClilocIDExists(_tooltipRec, 1049643):
AddToSystemJournal(f'Looting Item: {_loot1}')
MoveItem(_loot1, 1, LootBag, 0, 0, 0)
InsureItem(_loot1)
return
def InsureItem(_item):
Wait(250)
RequestContextMenu(Self())
_i = 0
for _menuItem in GetContextMenu().splitlines():
if "Toggle Item Insurance" in _menuItem:
SetContextMenuHook(Self(), _i)
Wait(250)
WaitTargetObject(_item)
Wait(250)
CancelMenu()
else:
_i += 1
AddToSystemJournal("Couldn't find insure menu item.")
CancelAllMenuHooks()
CancelTarget()
return
if __name__ == '__main__':
SetEventProc('evclilocspeech', OnClilocSpeech)
SetEventProc('evdrawobject', OnDrawObject)
SetFindDistance(20)
SetFindVertical(20)
SetDropDelay(850)
UseObject(Backpack())
Wait(850)
if FindTypesArrayEx([0x0E76], [0xFFFF], [Backpack()], True):
_bags = GetFindedList()
for _bag in _bags:
# make sure they are bags of sending
if 'sending' in GetTooltip(_bag).split('|')[0]:
AddToSystemJournal("Found bag of sending...")
SendingBag = _bag
Wait(850)
_ignoreList = NewFind([0xFFFF], [0xFFFF], [Backpack()], True)
for _ignoreItem in _ignoreList:
Ignore(_ignoreItem)
AddToSystemJournal('Target your loot bag...')
LootBag = RequestTarget()
UseObject(LootBag)
_monsters = []
_corpses = []
_currentTarget = 0
while True:
ClearBadLocationList()
while not Connected():
Connect()
Wait(10000)
CheckWeight()
_monsters = NewFind([FanDancer], [0xFFFF], [0x0], False)
# entrance 79, 97, 326, 344 - bloodyroom 104, 115, 640, 660
if (_currentTarget == 0 and len(_monsters) > 0) or\
(len(_monsters) > 0 and _currentTarget != 0 and
not IsObjectExists(_currentTarget)):
if 79 <= GetX(_monsters[0]) <= 97 and\
326 <= GetY(_monsters[0]) <= 344:
_currentTarget = _monsters[0]
AddToSystemJournal(f'Current Target: {_currentTarget}')
ReqVirtuesGump()
UseVirtue('honor')
WaitTargetObject(_currentTarget)
Attack(_currentTarget)
if _currentTarget != 0 and IsObjectExists(_currentTarget):
NewMoveXY(GetX(_currentTarget), GetY(_currentTarget), False, 1,
True)
Attack(_currentTarget)
if GetHP(Self()) <= 90 and not Confidence:
Cast('Confidence')
if GetMana(Self()) >= 40:
UsePrimaryAbility()
_corpses = NewFind([Corpse], [0xFFFF], [0x0], False)
if len(_corpses) > 0:
for _corpse in _corpses:
if GetDistance(_corpse) < 3:
LootCorpse(_corpse)
Ignore(_corpse)
else:
if 79 <= GetX(_corpse) <= 97 and\
326 <= GetY(_corpse) <= 344:
NewMoveXY(GetX(_corpse), GetY(_corpse), True, 0, True)
LootCorpse(_corpse)
Ignore(_corpse)
Wait(1000)
if __name__ == '__main__':
global BagofSendingBag
Code: [Select]_lootList1 = NewFind([0x108A, 0x1F09, 0x4212, 0x1086, 0x1F06, 0x4211], [0xFFFF], [_corpse], True)
Merry Christmas
NewFind(Array of types, Array of colors, Array of containers, Search Subcontainers?)
0xFFFF specifies anything/everything.
def LootCorpse(_corpse):
UseObject(_corpse)
Wait(1500)
_lootList = NewFind([0xFFFF], [0xFFFF], [_corpse], True)
for _loot in _lootList:
_tooltipRec = GetTooltipRec(_loot)
if GetParam(_tooltipRec, 1112857) >= 20 and not\
ClilocIDExists(_tooltipRec, 1152714) and not\
ClilocIDExists(_tooltipRec, 1049643):
AddToSystemJournal(f'Looting Item: {_loot}')
MoveItem(_loot, 1, LootBag, 0, 0, 0)
InsureItem(_loot)
_lootList1 = NewFind([0x108A, 0x1F09, 0x4212, 0x1086, 0x1F06, 0x4211], [0x108A, 0x1F09, 0x4212, 0x1086, 0x1F06, 0x4211], [_corpse], True)
for _loot1 in _lootList1:
_tooltipRec = GetTooltipRec(_loot1)
if GetParam(_tooltipRec, 1060411) >= 20 and not\
ClilocIDExists(_tooltipRec, 1049643):
AddToSystemJournal(f'Looting Item: {_loot}')
MoveItem(_loot1, 1, LootBag, 0, 0, 0)
InsureItem(_loot1)
return
_lootList = NewFind([0xFFFF], [0xFFFF], [_corpse], True)
([0xFFFF]