Wiw3K

Sikuli script

Aug 14th, 2012
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 5.17 KB | None | 0 0
  1. #Miner written by Wiw3K
  2. #Miner napisany przez Wiw3K
  3.  
  4. #import
  5. from guide import *
  6.  
  7. #Obrazki zmiany mapy
  8. mapup = exists(Pattern("1344919776609.png").similar(0.91).targetOffset(80,5))
  9. mapdown = exists(Pattern("1344919851078.png").similar(0.91).targetOffset(0,-35))
  10. mapleft = exists(Pattern("1344920092171.png").similar(0.94).targetOffset(-24,-70))
  11. mapright = exists(Pattern("1344920124703.png").similar(0.84).targetOffset(27,80))
  12.  
  13. #Obrazki kopalni
  14. mineentrance = exists(Pattern("L.png").similar(0.84).targetOffset(-11,-2))
  15. mineexit = exists(Pattern("1344920782953.png").similar(0.86).targetOffset(0,-2))
  16. map0to1 = exists(Pattern("1344921279015.png").similar(0.88))
  17. map1to0 = exists(Pattern("flLv.png").similar(0.88).targetOffset(2,0))
  18. map0to2 = exists(Pattern("S3.png").similar(0.87).targetOffset(2,1))
  19. map2to0 = exists(Pattern("QSli.png").similar(0.88))
  20. map2to3 = exists(Pattern("935Fri.png").similar(0.94))
  21. map3to2 = exists(Pattern("I.png").similar(0.90).targetOffset(-2,-1))
  22. map2to4 = exists(Pattern("7.png").similar(0.89))
  23. map4to2 = exists(Pattern("kv.png").similar(0.90))
  24. map2to5 = exists(Pattern("fl.png").similar(0.87).targetOffset(-9,1))
  25. map5to2 = exists(Pattern("EiBii.png").similar(0.86).targetOffset(-2,-2))
  26.  
  27. #Ore
  28. iron1 = exists(Pattern("1344920814078.png").similar(0.85))
  29. iron2 = exists(Pattern("1344920836578.png").similar(0.88))
  30. bronze1 = exists(Pattern("1344921572093.png").similar(0.91))
  31. bronze2 = exists(Pattern("1344921501625.png").similar(0.92))
  32. copper1 = exists(Pattern("1344921493468.png").similar(0.91))
  33. copper2 = exists(Pattern("1344921601437.png").similar(0.83))
  34. cobalt1 = exists(Pattern("1344921743937.png").similar(0.92))
  35. cobalt2 = exists(Pattern("1344921801281.png").similar(0.91))
  36.  
  37. #Ustawienia
  38. hTime = 11
  39. mTime = 6
  40. mapdelay = 14
  41. inbank = False
  42.  
  43. #Zaczynac w kopalni
  44. hMap = 0
  45. hFound = True
  46. hOnline = exists("Ff.png")
  47.  
  48. #liczniki
  49. IrCount = 0
  50. Brcount = 0
  51. CoCount = 0
  52. CobCount = 0
  53.  
  54. def GoToBank():
  55.     inbank = True
  56.    
  57.     for i in range(20):
  58.         if mapup:
  59.             click(mapup)
  60.             wait(mapdelay)
  61.     for j in range(4):
  62.         if mapleft:
  63.             click(mapleft)
  64.             wait(mapdelay)
  65.     for k in range(3):
  66.         if mapup:
  67.             click(mapup)
  68.             wait(mapdelay)
  69.    
  70.  
  71. def GoToMine():
  72.     inbank = False
  73.    
  74.     for n in range(3):
  75.         if mapdown:
  76.             click(mapdown)
  77.             wait(mapdelay)
  78.     for n in range(4):
  79.         if mapright:
  80.             click(mapright)
  81.             wait(mapdelay)
  82.     for n in range(20):
  83.         if mapdown:
  84.             click(mapdown)
  85.             wait(mapdelay)
  86.  
  87. def nextMap():
  88.     if hMap == 0:
  89.         hMap = 1
  90.         click(map0to1)
  91.         wait(mTime)
  92.     elif hMap == 1:
  93.         hMap = 2
  94.         click(map1to0)
  95.         wait(mTime)
  96.     elif hMap == 2:
  97.         hMap = 3
  98.         click(map1to2)
  99.         wait(mTime)
  100.     elif hMap == 3:
  101.         hMap = 4
  102.         click(map2to3)
  103.         wait(mTime)
  104.     elif hMap == 4:
  105.         hMap = 5
  106.         click(map3to2)
  107.         wait(mTime)
  108.     elif hMap == 5:
  109.         hMap = 6
  110.         click(map2to4)
  111.         wait(mTime)
  112.     elif hMap == 6:
  113.         hMap = 7
  114.         click(map4to2)
  115.         wait(mTime)
  116.     elif hMap == 7:
  117.         hMap = 8
  118.         click(map2to5)
  119.         wait(mTime)
  120.     elif map == 8:
  121.         map = 9
  122.         click(map5to2)
  123.         wait(mTime)
  124.     elif hMap == 9:
  125.         hMap = 0
  126.         click(map2to0)
  127.         wait(mTime)
  128.     hFound = True
  129.  
  130. def Harvest():
  131.     if iron1:
  132.         hFound = True
  133.         click(iron1)
  134.         IrCount = IrCount + 1
  135.         paste(iron1, 'Wydobywam ' + str(IrCount) + ' Iron')
  136.         show(2)
  137.         wait(hTime)
  138.     elif iron2:
  139.         hFound = True
  140.         click(iron2)
  141.         IrCount = IrCount + 1
  142.         paste(iron2, 'Wydobywam ' + str(IrCount) + ' Iron')
  143.         show(2)
  144.         wait(hTime)
  145.     elif bronze1:
  146.         hFound = True
  147.         click(bronze1)
  148.         BrCount = BrCount + 1
  149.         paste(bronze1, 'Wydobywam ' + str(BrCount) + ' Bronze')
  150.         show(2)
  151.         wait(hTime)
  152.     elif bronze2:
  153.         hFound = True
  154.         click(bronze2)
  155.         BrCount = BrCount + 1
  156.         paste(bronze2, 'Wydobywam ' + str(BrCount) + ' Bronze')
  157.         show(2)
  158.         wait(hTime)
  159.     elif copper1:
  160.         hFound = True
  161.         click(copper1)
  162.         CoCount = CoCount + 1
  163.         paste(copper1, 'Wydobywam ' + str(CoCount) + ' Copper')
  164.         show(2)
  165.         (hTime)
  166.     elif copper2:
  167.         hFound = True
  168.         click(copper2)
  169.         CoCount = CoCount + 1
  170.         paste(copper2, 'Wydobywam ' + str(CoCount) + ' Copper')
  171.         show(2)
  172.         wait(hTime)
  173.     elif cobalt1:
  174.         hFound = True
  175.         click(cobalt1)
  176.         CobCount = CobCount + 1
  177.         paste(copper2, 'Wydobywam ' + str(CobCount) + ' Cobalt')
  178.         show(2)
  179.         wait(hTime)
  180.     elif cobalt2:
  181.         hFound = True
  182.         click(cobalt2)
  183.         CobCount = CobCount + 1
  184.         paste(copper2, 'Wydobywam ' + str(CobCount) + ' Cobalt')
  185.         show(2)
  186.         wait(hTime)
  187.     else:
  188.         hFound = False
  189.         paste('Nie moge znalezc ore, zmieniam mape!')
  190.  
  191. while hOnline:
  192.     if hFound:
  193.         Harvest()
  194.     else:
  195.         nextMap()
Advertisement
Add Comment
Please, Sign In to add comment