Advertisement
Tkap1

Untitled

Jun 23rd, 2019
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. global quad_topleft := [24, 125]
  2. global slot_size := 14.6
  3. global slots := 24
  4. global sleep1 := 17
  5. global sleep2 := 34
  6. global last_x_index := 0
  7. global last_y_index := 0
  8. global inv_free_slots := 12 * 5 - 1
  9.  
  10. ^+a::
  11. take_quad()
  12. return
  13.  
  14. take_quad()
  15. {
  16.     sleep 500
  17.     done := false
  18.     x_index := last_x_index
  19.     y_index := last_y_index
  20.    
  21.     while (true)
  22.     {
  23.         temp_y := quad_topleft[2] + (slot_size * y_index)
  24.         while (true)
  25.         {
  26.             temp_x := quad_topleft[1] + (slot_size * x_index)
  27.             move_mouse(randomize_coords([temp_x, temp_y]))
  28.             random_sleep(1,2,1)
  29.             ; random_sleep(sleep1, sleep2, 2)
  30.             ; control_click()
  31.             ; random_sleep(sleep1, sleep2, 2)
  32.             clicks += 1
  33.             x_index += 1
  34.            
  35.             if (x_index == slots)
  36.             {
  37.                 break
  38.             }
  39.            
  40.             if (clicks > inv_free_slots)
  41.             {
  42.                 done = true
  43.                 last_x_index := x_index
  44.                 break
  45.             }
  46.         }
  47.        
  48.         x_index := 0
  49.        
  50.         if (!done)
  51.         {
  52.             y_index += 1
  53.         }
  54.        
  55.         if (y_index == slots)
  56.         {
  57.             last_x_index := 0
  58.             last_y_index := 0
  59.             break
  60.         }
  61.        
  62.         if (done)
  63.         {
  64.             last_y_index := y_index
  65.             break
  66.         }
  67.     }
  68. }
  69.  
  70.  
  71. randomize_coords(coords)
  72. {
  73.     Random, x_rand, -1, 1
  74.     Random, y_rand, -1, 1
  75.     return [coords[1] + x_rand, coords[2] + y_rand]
  76. }
  77.  
  78. move_mouse(coords)
  79. {
  80.     MouseMove, coords[1], coords[2]
  81. }
  82.  
  83. random_sleep(min_val, max_val, multiplier)
  84. {
  85.     Random, out, min_val, max_val
  86.     s := out * multiplier
  87.     sleep %s%
  88. }
  89.  
  90. control_click()
  91. {
  92.     Send {LControl down}
  93.     random_sleep(sleep1, sleep2, 1)
  94.     Click
  95.     random_sleep(sleep1, sleep2, 1)
  96.     Send {LControl up}
  97. }
  98.  
  99. f10::
  100. Reload
  101. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement