comparison usebot.sh @ 112:ef5461db3951

Added usebot.sh,an interface for bot
author macbook@59-116-8-229.dynamic.hinet.net
date Thu, 30 Oct 2008 00:38:41 +0800
parents
children 82eff1aaf0ec
comparison
equal deleted inserted replaced
111:8155f9328396 112:ef5461db3951
1 #!/bin/bash
2 #Auther: billy3321
3 #Version: 0.1
4 #Interface for Eagle-Eye ikariam bot project
5 #for more information please visit
6 # https://www.assembla.com/wiki/show/eagle-eye
7
8 function seteagleeye() {
9 read -p "Enter your server ( s1/s2/s3/s4 ): " SER_NAME
10 read -p "Enter your account: " ACC_NAME
11 read -p "Enter your password: " PW_NAME
12 echo -e "package main;\n\n\$::server = \"${SER_NAME}.ikariam.tw\";\n\$::user = \"${ACC_NAME}\";\n\$::pass = \"${PW_NAME}\";\n\n1;" > ${HOME}/.eagleeye.pm
13 }
14
15 echo "Checking for Database..."
16 if test -f ikariam.sqlite;then
17 echo "Find Database, continue..."
18 else
19 echo "setting up database...."
20 cat ikariam.sql | sqlite3 ikariam.sqlite
21 echo "Database Setting finished. Continue Program..."
22 fi
23
24 echo "Checking for account information file..."
25 if test -f ${HOME}/.eagleeye.pm ; then
26 echo "Find your account information file. Continue Program..."
27 else
28 echo "Can't find your account information file. We will creat one"
29 seteagleeye
30
31 fi
32
33 while true
34 do
35 echo -e "Welcome to use eagle-eye ikariam bot. Please select the action you want to do.\n 1. Reset the account information file.\n 2. Reset the databse.\n 3. Scan around your island.\n 4. Run the bot.\n 5. List the sheeps(Please scan first).\n 0. Exit Program."
36
37 read -p "What do you want to do now? Please enter the number:" ACT
38 case $ACT in
39 "1")
40 seteagleeye
41 ;;
42 "2")
43 rm ikariam.sqlite
44 cat ikariam.sql | sqlite3 ikariam.sqlite
45 ;;
46 "3")
47 perl scan.pl
48 ;;
49 "4")
50 perl agent.pl
51 ;;
52 "5")
53 perl sheep.pl
54 ;;
55 "0")
56 break
57 ;;
58 *)
59 echo "Please enter a number."
60 ;;
61 esac
62 done
63
64
65 #END