Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # install mouse if not exists
- function mkmouse () {
- echo no mouse install found
- sleep 1
- echo compiling mouse in 5 seconds, CTRL-C to stop...
- sleep 5
- gcc mouse.c -lm -w -o3 -o mouse && strip ./mouse
- }
- function runmouse () {
- if [[ -f $1 ]]; then
- cp $1 mouse.007
- else
- echo $1 > mouse.007
- fi
- RET=$(`which mouse` guessbot.m02 | head -n1)
- exit $RET
- }
- if [[ $# != 1 ]]; then
- echo -e "\n\tUsage: $0 <board>"
- echo -e "\twhere <board> is a file to open OR a string representing a board\n"
- exit 1
- fi
- if [[ -f ./mouse ]] || [[ -f /usr/bin/mouse ]]; then
- runmouse $1
- else
- mkmouse && runmouse
- fi
Advertisement
Add Comment
Please, Sign In to add comment