rsps-scripts

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

flaxer.sh (1710B)


      1 #!/usr/bin/env bash
      2 
      3 # starting position. next to bank chest with inventory full of flax
      4 
      5 # variables
      6 spinning_wheel=(1694 664)
      7 bank_chest=(302 429)
      8 flax_position=(1019 405)
      9 
     10 # include functions
     11 source "$(dirname "${BASH_SOURCE[0]}")/functions.sh"
     12 
     13 if [ -z "$1" ]; then
     14     echo "Usage: $0 <number>"
     15     echo
     16     echo "Runs the script the specified number of times."
     17     echo
     18     echo "Example:"
     19     echo "  $0 44"
     20     exit 1
     21 fi
     22 
     23 count=$1
     24 
     25 startup
     26 
     27 # Count down
     28 printf " - Starting script in 3 seconds...\n"
     29 sleep 3
     30 		# north orient screen
     31 		move_mouse 1713 14 27 18
     32 		msleep 100 200
     33 		left_click
     34 		# rotate screen
     35 		ydotool key 105:1
     36 		msleep 320
     37 		ydotool key 105:0
     38 		# zoom out screen ..? ydotool key 103:1
     39 
     40 for ((i=count; i>0; i--)); do
     41     printf '\r - Running script %d times' "$i"
     42 		# inventory 1 to wheel
     43 		move_mouse 1750 800 16 10 # inventory slot 1
     44 		msleep 150 250
     45 		left_click
     46 		msleep 150 250
     47 		move_mouse "${spinning_wheel[@]}" # wheel location
     48 		msleep 150 250
     49 		left_click # click on wheel
     50 		msleep 9000 10000 # run to wheel
     51 		move_mouse 257 996
     52 		msleep 150 250
     53 		right_click # right click bow string in pane
     54 		msleep 100 200
     55 		move_mouse 249 1057
     56 		msleep 150 250
     57 		left_click
     58 		msleep 52000 58000 # making bowstrings
     59 		move_mouse "${bank_chest[@]}" # bank chest
     60 		msleep 150 250
     61 		left_click
     62 		msleep 9000 10000 # run to bank
     63 		move_mouse 1072 605 29 28
     64 		msleep 250 350
     65 		left_click # deposit all strings in bank
     66 		msleep 250 350
     67 		move_mouse "${flax_position[@]}"
     68 		msleep 250 350
     69 		right_click
     70 		msleep 250 350
     71 		move_mouse -r 0 81
     72 		msleep 250 350
     73 		left_click # withdraw all flax
     74 		msleep 450 550
     75 		move_mouse 1085 323 16 16
     76 		msleep 150 250
     77 		left_click # close bank
     78 
     79 
     80 done
     81 
     82 complete