changeset 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 8155f9328396
children 82eff1aaf0ec
files usebot.sh warfare.pl
diffstat 1 files changed, 65 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usebot.sh	Thu Oct 30 00:38:41 2008 +0800
@@ -0,0 +1,65 @@
+#!/bin/bash
+#Auther: billy3321
+#Version: 0.1
+#Interface for Eagle-Eye ikariam bot project
+#for more information please visit
+# https://www.assembla.com/wiki/show/eagle-eye
+
+function seteagleeye() {
+read -p "Enter your server ( s1/s2/s3/s4 ): " SER_NAME
+read -p "Enter your account: " ACC_NAME
+read -p "Enter your password: " PW_NAME
+echo -e "package main;\n\n\$::server = \"${SER_NAME}.ikariam.tw\";\n\$::user = \"${ACC_NAME}\";\n\$::pass = \"${PW_NAME}\";\n\n1;" > ${HOME}/.eagleeye.pm
+}
+
+echo "Checking for Database..."
+if test -f ikariam.sqlite;then
+	echo "Find Database, continue..."
+else
+	echo "setting up database...."
+	cat ikariam.sql | sqlite3 ikariam.sqlite
+	echo "Database Setting finished. Continue Program..."
+fi
+
+echo "Checking for account information file..."
+if test -f ${HOME}/.eagleeye.pm ; then
+	echo "Find your account information file. Continue Program..."
+else
+	echo "Can't find your account information file. We will creat one"
+	seteagleeye
+	
+fi
+
+while true
+do
+	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."
+	
+	read -p "What do you want to do now? Please enter the number:" ACT
+	case $ACT in
+	 "1")
+	    seteagleeye
+	    ;;
+	 "2")
+	    rm ikariam.sqlite
+	    cat ikariam.sql | sqlite3 ikariam.sqlite
+	    ;;
+	 "3")
+	    perl scan.pl
+	    ;;
+	 "4")
+	    perl agent.pl
+	    ;;
+	 "5")
+	    perl sheep.pl
+	    ;;
+	 "0")
+	    break
+	    ;;
+	 *)
+	    echo "Please enter a number."
+	    ;;
+	 esac
+done
+
+
+#END