Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import java.awt.Robot as JRobot
- import java.awt.Color as Color
- from guide import *
- myRobot = JRobot()
- picmonstersinmap = [Pattern("1339837131433.png").similar(0.52)]
- random.seed(10)
- RunTime = 0.06 * (100 - 10) + 2 #10 is runspeed
- def terminate():
- print "USER TERMINATED"
- popup("YalmBot has stopped!")
- exit()
- def checkMonsters(monsters, reg):
- if not reg: reg = SCREEN # if no reg given, we look on the whole screen
- for p in monsters:
- if reg.exists(p, 0):
- return getLastMatch()
- return None
- def LeaveGame():
- type("t")
- wait(7)
- type(Key.ESC)
- wait(0.4)
- click(Location(playground.x + 397, playground.y + 337))
- def Pause():
- paused = not paused
- def Click(x, y):
- x = playground.x + x
- y = playground.y + y
- click(Location(x-3+Math.random()*6,y-3+Math.random()*6))
- sleep(1+Math.random()*0.5)
- def Move(x, y):
- #print "nummer" + x
- x = playground.x + x
- y = playground.y + y
- #click(Location(x-3+random.random()*6,y-3+random.random()*6))
- hover(Location(x-3+random.random()*6,y-3+random.random()*6))
- mouseDown(Button.MIDDLE)
- mouseUp(Button.MIDDLE)
- wait(1.2+random.random()*0.5)
- def Point(x, y):
- #print "nummer" + x
- x = playground.x + x
- y = playground.y + y
- hover(Location(x-3+random.random()*6,y-3+random.random()*6))
- def Attack(x, y):
- x = playground.x + x
- y = playground.y + y
- rightClick(Location(x-3+random.random()*6,y-3+random.random()*6))
- def AttackNearbyMonster():
- monster = checkMonsters(picmonstersinmap, playground)
- if monster: # we found none in the moment
- print "Found monster! Attack! :)"
- rightClick(monster)
- wait(0.3)
- AttackNearbyMonster()
- def Rest(z):
- sleep(math.random()*z)
- def findItemsOfColor():
- area = Region(playground.x + 75,playground.y + 90,600,400)
- area.highlight(1)
- wait(1)
- # x = area.x
- # y = area.y
- # i=0
- #while i==0:
- #x = x+1
- #p = Location(x,y)
- # aColor = Color(0x6969FF)
- # if myRobot.getPixelColor(p.x, p.y) == aColor:
- # print "FOUND ITEM!!!"
- # click(x+4,y+4)
- # wait(1)
- # if x > area.x + area.w:
- # x = area.x
- # y = y + 1
- # if y > area.y + area.h:
- # i = 1
- # break
- Env.addHotkey(Key.ENTER, KeyModifier.CTRL, terminate)
- myApp = App("Diablo III")
- myApp.focus()
- playground = App.focusedWindow()
- text(playground, "Running YalmBot 0.1")
- show(1)
- exists("RESUITIEGAIT.png",1)
- click("RESUITIEGAIT-1.png")
- wait(2)
- loc1 = 10
- loc12 = 115
- loc2 = 10
- loc22 = 215
- loc3 = 10
- loc32 = 195
- while True:
- if playground.exists(Pattern("wHX.png").similar(0.50)):
- break
- wait(1)
- #starting game
- type("1")
- hover(Location(playground.x + 11,playground.y + 235))
- wait(0.4)
- type("2")
- mouseDown(Button.MIDDLE)
- wait(RunTime)
- mouseUp(Button.MIDDLE)
- type("3")
- wait(0.4)
- type("3")
- foundCellar = playground.exists(Pattern("K.png").similar(0.60).targetOffset(7,12))
- if foundCellar:
- type("2")
- hover(foundCellar)
- wait(0.2)
- click(foundCellar)
- wait(3)
- Move(3,519)
- Move(255,215)
- AttackX = 165
- AttackY = 152
- Point(AttackX,AttackY)
- type("2")
- wait(0.1)
- type("4")
- Attack(AttackX,AttackY)
- wait(0.4)
- Attack(AttackX,AttackY)
- wait(0.4)
- Attack(AttackX,AttackY)
- wait(0.4)
- Attack(AttackX,AttackY)
- wait(0.4)
- Attack(AttackX,AttackY)
- wait(0.4)
- type("4")
- wait(0.4)
- Attack(15,196)
- wait(0.4)
- Attack(15,196)
- #Check for remaining monsters here!
- Move(15,196)
- realCenter = playground.getCenter()
- playgroundCenter = Location(realCenter.x-playground.x,realCenter.y-playground.y)
- Move(playgroundCenter.x-30,playgroundCenter.y+30)
- AttackNearbyMonster()
- Move(playgroundCenter.x+175,playgroundCenter.y-10)
- AttackNearbyMonster()
- Move(playgroundCenter.x+75,playgroundCenter.y-75)
- AttackNearbyMonster()
- Move(playgroundCenter.x-20,playgroundCenter.y-100)
- AttackNearbyMonster()
- Move(playgroundCenter.x-50,playgroundCenter.y+100)
- #Move(300,433)
- #Find blues
- findItemsOfColor()
- text(playground, "Done! Leaving game!")
- show(2)
- LeaveGame()
- else:
- text(playground, "No cellar here! Leaving game...")
- show(2)
- type("3")
- wait(0.2)
- type("2")
- LeaveGame()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement