annotate 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
rev   line source
112
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
1 #!/bin/bash
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
2 #Auther: billy3321
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
3 #Version: 0.1
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
4 #Interface for Eagle-Eye ikariam bot project
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
5 #for more information please visit
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
6 # https://www.assembla.com/wiki/show/eagle-eye
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
7
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
8 function seteagleeye() {
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
9 read -p "Enter your server ( s1/s2/s3/s4 ): " SER_NAME
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
10 read -p "Enter your account: " ACC_NAME
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
11 read -p "Enter your password: " PW_NAME
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
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
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
13 }
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
14
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
15 echo "Checking for Database..."
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
16 if test -f ikariam.sqlite;then
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
17 echo "Find Database, continue..."
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
18 else
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
19 echo "setting up database...."
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
20 cat ikariam.sql | sqlite3 ikariam.sqlite
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
21 echo "Database Setting finished. Continue Program..."
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
22 fi
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
23
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
24 echo "Checking for account information file..."
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
25 if test -f ${HOME}/.eagleeye.pm ; then
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
26 echo "Find your account information file. Continue Program..."
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
27 else
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
28 echo "Can't find your account information file. We will creat one"
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
29 seteagleeye
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
30
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
31 fi
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
32
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
33 while true
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
34 do
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
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."
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
36
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
37 read -p "What do you want to do now? Please enter the number:" ACT
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
38 case $ACT in
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
39 "1")
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
40 seteagleeye
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
41 ;;
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
42 "2")
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
43 rm ikariam.sqlite
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
44 cat ikariam.sql | sqlite3 ikariam.sqlite
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
45 ;;
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
46 "3")
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
47 perl scan.pl
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
48 ;;
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
49 "4")
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
50 perl agent.pl
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
51 ;;
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
52 "5")
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
53 perl sheep.pl
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
54 ;;
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
55 "0")
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
56 break
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
57 ;;
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
58 *)
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
59 echo "Please enter a number."
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
60 ;;
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
61 esac
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
62 done
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
63
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
64
ef5461db3951 Added usebot.sh,an interface for bot
macbook@59-116-8-229.dynamic.hinet.net
parents:
diff changeset
65 #END