rsps-scripts

Automation scripts for private servers
Log | Files | Refs

empty-first-14.sh (1172B)


      1 #!/usr/bin/env bash
      2 
      3 # include functions
      4 source "$(dirname "${BASH_SOURCE[0]}")/functions.sh"
      5 
      6 function empty_potion() {
      7 	msleep 100 200
      8 	right_click
      9 	msleep 200 250
     10 	move_mouse -r 0 48
     11 	msleep 100 200
     12 	left_click
     13 }
     14 
     15 function run_action() {
     16 	printf ' - Emptying 14 potions...\n'
     17 	move_mouse 1749 795 16 16 # 1
     18 	empty_potion
     19 	move_mouse 1790 794 16 16 # 2
     20 	empty_potion
     21 	move_mouse 1833 795 16 16 # 3
     22 	empty_potion
     23 	move_mouse 1874 796 16 16 # 4
     24 	empty_potion
     25 	move_mouse 1746 832 16 16 # 5
     26 	empty_potion
     27 	move_mouse 1789 832 16 16 # 6
     28 	empty_potion
     29 	move_mouse 1832 830 16 16 # 7
     30 	empty_potion
     31 	move_mouse 1876 830 16 16 # 8
     32 	empty_potion
     33 	move_mouse 1747 868 16 16 # 9
     34 	empty_potion
     35 	move_mouse 1792 867 16 16 # 10
     36 	empty_potion
     37 	move_mouse 1832 867 16 16 # 11
     38 	empty_potion
     39 	move_mouse 1875 870 16 16 # 12
     40 	empty_potion
     41 	move_mouse 1748 903 16 16 # 13
     42 	empty_potion
     43 	move_mouse 1789 904 16 16 # 14
     44 	empty_potion
     45 }
     46 
     47 CLEANUP_DONE=0
     48 function on_exit() {
     49 	if [[ "$CLEANUP_DONE" -eq 1 ]]; then
     50 		return
     51 	fi
     52 	CLEANUP_DONE=1
     53 
     54 	cleanup
     55 	exit 0
     56 }
     57 
     58 startup
     59 
     60 printf ' - Press F11 to empty first 14 potions\n'
     61 
     62 while true; do
     63 	if read -r _line < "$pipe"; then
     64 		run_action
     65 	fi
     66 done