def speechHandler(text, sendername, senderid): if senderid != stealth.Self( ) and senderid != 'System' and stealth.GetDistance(senderid) < 4: stealth.AddToSystemJournal('{}: {}'.format(sendername, text)) response = cb1.ask(text) #See header comment for wait algorithm details stealth.Wait(60000 * len(response) / random.randint(300, 350)) stealth.UOSay(response)
def speechHandler(text, sendername, senderid): if senderid != stealth.Self() and sendername not in ['System', '']: stealth.AddToSystemJournal('{}: {}'.format( sendername, re.sub(r'[^\x00-\x7f]', r'?', text))) stealth.Beep()
def Print(stuff): """Prints stuff to stealth system journal, whatever it is.""" stealth.AddToSystemJournal(str(stuff))
pileQuantity = stealth.GetQuantity(pile) # If we can grab the entire thing, if amountGrabbable >= pileQuantity: stealth.MoveItem(pile, pileQuantity, stealth.Backpack(), 0, 0, 0) else: stealth.MoveItem(pile, amountGrabbable, stealth.Backpack(), 0, 0, 0) stealth.Wait(750) stealth.SetFindDistance(findDistance) try: stealth.AddToSystemJournal('Starting AutoMiner Script!') # If you're mounted, unmount if Mounted(): stealth.UseObject(stealth.Self()) stealth.Wait(750) # Main Loop while not stealth.Dead(): #Used for sysjournal output currentbook = 0 #Used for statistics keeping: runtimestamp = time.time()
#If they've accepted the trade and we haven't, if stealth.TradeCheck(0,2) and not stealth.TradeCheck(0,1): stealth.ConfirmTrade(0) stealth.Wait(500) #if it's been longer than 15 seconds, if time.time() - tradeTimestamp > 15: stealth.UseSkill('hiding') stealth.Wait(750) stealth.UOSayColor('Sorry, you took too long to accept the trade!',__msgcolor__) acceptedTrade = False finally: acceptedTrade = False stealth.Wait(500) #We don't want to always respond exact after a minute. Should be some randomness in there. if time.time() - lastafkmessagetimestamp > 60 and random.random() > 0.50: stealth.UOSayColor(random.choice(['[e sigh','[e yawn','[e groan','*Shuffles Cards*', '[e meow','[e howl','Wun plei blackjack?','*Grins', '[e fart','[e giggle']),__msgcolor__) lastafkmessagetimestamp = time.time() except: pass #Saving statistics whether we close cleanly or not! finally: stealth.AddToSystemJournal('Saving Blackjack statistics and earnings') saveStats()
import stealth stealth.AddToSystemJournal('Now Training: Hiding') while stealth.GetSkillValue('Hiding') < 100.0: stealth.UseSkill('Hiding') stealth.Wait(10250) stealth.AddToSystemJournal('Finished Training: Hiding') Disconnect()
def speechHandler(text, sendername, senderid): # TODO: Fix this so that it's able to handle unicode # Before, it couldn't handle spaces and stuff. Not good. if senderid != stealth.Self() and sendername not in ['System', '']: stealth.AddToSystemJournal(u'{}: {}'.format(sendername, text))
# Check blacksmiths for one close enough that you can request a BOD from for vendor in vendors: vendorID = int(vendor, 16) stealth.RequestContextMenu(vendorID) stealth.Wait(1500) menu = stealth.GetContextMenu() try: if 'Bulk Order Info' in menu[1]: stealth.SetContextMenuHook(vendorID, 0x1) break except: stealth.AddToSystemJournal( 'Something screwy happened with context menu') # After requesting a bod, check for BOD gump gotBod = False totalWait = 5000 while not gotBod and totalWait >= 0: if stealth.GetGumpsCount(): for gumpNum in range(stealth.GetGumpsCount()): if stealth.GetGumpID(gumpNum) in [ 2611865322, 3188567326L ]: #BOD Gump ID's (Small and large) gotBod = True currentBod = bod(stealth.GetGumpFullLines(gumpNum)) currentBodStr = '{} received BOD: {} {} {} {}'.format( stealth.CharName(), currentBod.items, currentBod.amount, currentBod.quality,