Advertisement
Guest User

Untitled

a guest
Dec 17th, 2017
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.83 KB | None | 0 0
  1. import sys
  2.  
  3. time = 0
  4. file = open(sys.argv[1], "w")
  5.  
  6. buy_btn = (965,652)
  7. buy_confirm_btn = (787,520)
  8. exit_btn = (152, 32)
  9. inventory_btn = (178, 644)
  10. grind_btn = (839,629)
  11. grind_all_btn = (730,629)
  12. grind_btn_2 = (732,589)
  13. grind_confirm_btn = (738,531)
  14. dismiss_results = (738,531)
  15. enter_forge_btn = (641,525)
  16. use_shop_btn = (636,561)
  17.    
  18. def wait(amount):
  19.     global time
  20.     time = time + amount
  21.  
  22. def click(file, loc, wait_milliseconds):
  23.     global time
  24.     file.write("0ScRiPtSePaRaToR1280|720|MULTI:1:0:{0}:{1}ScRiPtSePaRaToR{2}\n".format(loc[0], loc[1], time))
  25.  
  26.     # This is the delay between pressing the button and releasing the button.  If you set it to be too fast,
  27.     # the device won't register a click properly.  In my experience 100ms is about as fast as you can get
  28.     # to have all clicks properly registered.
  29.     wait(100)
  30.     file.write("0ScRiPtSePaRaToR1280|720|MULTI:0:6ScRiPtSePaRaToR{0}\n".format(time))
  31.     file.write("0ScRiPtSePaRaToR1280|720|MULTI:0:6ScRiPtSePaRaToR{0}\n".format(time))
  32.     file.write("0ScRiPtSePaRaToR1280|720|MULTI:0:1ScRiPtSePaRaToR{0}\n".format(time))
  33.     file.write("0ScRiPtSePaRaToR1280|720|MSBRL:-1158647:599478ScRiPtSePaRaToR{0}\n".format(time))
  34.  
  35.     # This is the delay between finishing one click and beginning the next click.  This needs to account
  36.     # for how fast the game can transition from one screen to the next.  For example, if you're repeatedly
  37.     # clicking a buy button with the game not really doing anything between each click, this can be very
  38.     # low.  On the other hand, if a click causes the game to transition from one screen to another (e.g.
  39.     # using a portal and the game having to load into Orvel and load an entirely new area) then it should
  40.     # be fairly high.
  41.     wait(wait_milliseconds)
  42.    
  43.  
  44. # The generated macro assumes you are on the Buy screen, Tier 3 is already selected, and an item is
  45. # highlighted.
  46. wait(500)
  47.  
  48. # Buy 300 items
  49. for i in range(0, 300):
  50.     click(file, buy_btn, 275)
  51.     click(file, buy_confirm_btn, 275)
  52.  
  53. # Exit twice (to Orvel map)
  54. click(file, exit_btn, 1000)
  55. click(file, exit_btn, 1000)
  56.  
  57. # Open inventory
  58. click(file, inventory_btn, 1000)
  59.  
  60. # Grind
  61. click(file, grind_btn, 1000)
  62.  
  63. # Grind all
  64. click(file, grind_all_btn, 1000)
  65.  
  66. # Click the Grind button on the window that pops up
  67. click(file, grind_btn_2, 1000)
  68.  
  69. # Confirmation
  70. click(file, grind_confirm_btn, 1000)
  71.  
  72. # Click on the screen to get rid of the results
  73. click(file, dismiss_results, 1000)
  74.  
  75. # Exit back to Orvel world map
  76. click(file, exit_btn, 1000)
  77.  
  78. # Re-enter the shop.  Delay set to 2000 here since there's an animated transition
  79. # that takes a little extra time
  80. click(file, enter_forge_btn, 2000)
  81.  
  82. # Click Use Shop button
  83. click(file, use_shop_btn, 1000)
  84.  
  85. # At this point we're back where we started and the macro can loop.
  86.  
  87. file.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement