Register for your free account! | Forgot your password?

Go Back   elitepvpers > Other Online Games > Browsergames
You last visited: Today at 09:57

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Grepolis bot (Now with attack option)

Discussion on Grepolis bot (Now with attack option) within the Browsergames forum part of the Other Online Games category.

Reply
 
Old 02/18/2010, 12:59   #61
 
elite*gold: 0
Join Date: Mar 2009
Posts: 100
Received Thanks: 1
Utharnl will it be difficult to make some NPC attacking options ?
Unghiutza is offline  
Old 02/18/2010, 14:05   #62
 
elite*gold: 0
Join Date: Aug 2009
Posts: 1,656
Received Thanks: 703
Quote:
Originally Posted by sonzomerta View Post
in bot directory find settings.txt

one line of text shows following:
Code:
user;pass;1;en.grepolis.com;en.grepolis.com;en3.grepolis.com;True;debug.txt;settings.txt
It seems the first listing for English (en.grepolis.com) has to be the main login server,
then you add a number for the world you wish to load (gamma = en3, alpha = en1, the testing server is zz1 but not tested this with it).
That's indeed how it works. Not sure if you made a typo but you have to change your settings to:

Code:
user;pass;1;en.grepolis.com;en3.grepolis.com;True;debug.txt;settings.txt
You had included "en.grepolis.com" twice.


@Unghiutza
Not sure if it's difficult but i'm going to look at it next week. Then I will know more.
Utharnl is offline  
Old 02/18/2010, 16:45   #63
 
elite*gold: 0
Join Date: Feb 2010
Posts: 5
Received Thanks: 0
I'm still can't log.

My settings:
Quote:
ThaRealiestJEDI;*******;1;pl.grepolis.com;pl1.grep olis.com;True;debug.txt;settings.txt
It may be wine slow server?

//
Sory, I do mistake in my nick. It's work

btw, can you do small change. Can it minimize to bar where clock is in windows. I don't know how it's called :P
Mumak is offline  
Old 02/18/2010, 18:48   #64
 
elite*gold: 0
Join Date: Aug 2009
Posts: 1,656
Received Thanks: 703
That shouldn't be a problem, will add it next version
Utharnl is offline  
Old 02/20/2010, 08:16   #65
 
elite*gold: 0
Join Date: Jan 2010
Posts: 23
Received Thanks: 1
@Utharnl

Can you change the Time Code from

private int m_TimerLoginDelay = 60000;//ms

to:

private int m_TimerLoginDelay = 720000;//ms

This should allow the users to have a timer up to 5hours instead of 1.

Also,
Can you add this:

/*
* Update resources on gui
*/
Wood.production = #Wood;
Stone.production = #Stone;
Iron.production = #Iron;
private void updateGUIResources()

{
label_WoodNr.Text = m_Towns[m_CurrentTown].Wood"("Wood.production"/h)";
label_StoneNr.Text = m_Towns[m_CurrentTown].Stone"("Stone.production"/h)";
label_IronNr.Text = m_Towns[m_CurrentTown].Iron"("Iron.production"/h)";
label_StorageNr.Text = m_Towns[m_CurrentTown].Storage;
}
******
I think from the source that #Wood/#Stone/#Iron are the variable from the server for production per hour.

This is from page source of Senate:

PopupFactory.addTexts({
wood_production : "<h4>Wood</h4>Production per hour: 190<br />This island yields less wood than the others.",
stone_production : "<h4>Rock</h4>Production per hour: 195",
iron_production : "<h4>Silver coins</h4>Production per hour: 198<br />The mountains on this island have enormous silver deposits, which means that your silver mine can extract more silver.",
favor_production : "<h4>Favor</h4><ul><li>Athena: 116 - Production per hour: 2.6</li></ul>"
});

$("#wood").setPopup("wood_production");
$("#stone").setPopup("stone_production");
$("#iron").setPopup("iron_production");



-Nate
srialmaster is offline  
Old 02/20/2010, 11:13   #66
 
elite*gold: 0
Join Date: Aug 2009
Posts: 1,656
Received Thanks: 703
Quote:
Originally Posted by srialmaster View Post
@Utharnl

Can you change the Time Code from

private int m_TimerLoginDelay = 60000;//ms

to:

private int m_TimerLoginDelay = 720000;//ms

This should allow the users to have a timer up to 5hours instead of 1.
Hey Nate the variable m_TimerLoginDelay is used for something else. It's the timer used to reconnect to the server when you are disconnected. It's still code i'm working on, it doesn't yet always work.

I know what you mean though, I will change it in the next version.
Here's a temporarily solution you can use:

Code:
(settings.cs)
/*
 * Constructor
 */ 
public Settings()
{
  InitializeComponent();
  setLoadedSettings();
  this.numericUpDownTimer.Maximum = 300;//Minutes
}
Will add the production rate also in the next version.

~Uthar
Utharnl is offline  
Old 02/20/2010, 19:09   #67
 
elite*gold: 0
Join Date: Feb 2010
Posts: 1
Received Thanks: 0
Hey. I need help in pt server.
i just cant login..any ideas?
dbtuga is offline  
Old 02/20/2010, 22:48   #68
 
elite*gold: 0
Join Date: Jan 2010
Posts: 23
Received Thanks: 1
Quote:
Originally Posted by Utharnl View Post
Hey Nate the variable m_TimerLoginDelay is used for something else. It's the timer used to reconnect to the server when you are disconnected. It's still code i'm working on, it doesn't yet always work.

I know what you mean though, I will change it in the next version.
Here's a temporarily solution you can use:

Code:
(settings.cs)
/*
 * Constructor
 */ 
public Settings()
{
  InitializeComponent();
  setLoadedSettings();
  this.numericUpDownTimer.Maximum = 300;//Minutes
}
Will add the production rate also in the next version.

~Uthar
Code:
(town.cs)
class Town
    {
        private String m_TownID = "";
        private Queue<String[]> m_BuildingQueue = new Queue<String[]>();
        private List<Building> m_Buildings = new List<Building>();
        private String[] m_IngameBuildingQueue = new String[] { "", "", "", "", "", "", "" };//Not realy dynamic... but it works
        private String m_Wood = "0";
        private String m_Stone = "0";
        private String m_Iron = "0";
        private String m_Storage = "0";
How can I make it here where I can add an If Then statement to load m_QueueFile?

I added these so far:

Code:
(settings.cs)
public partial class Settings : Form
    {
        private String m_UserName = "";
        private String m_Password = "";
        private String m_Timer = "1";
        private String m_MainServer = "";
        private String m_Server = "";
        private String m_DebugFile = "debug.txt";
        private String m_SettingsFile = "settings.txt";
        private String m_TranslationFile = "translation.txt";
        private String m_QueueFile = "queue.txt";

****************************

 public String QueueFile
        {
            get { return m_QueueFile; }
            set { m_QueueFile = value; }
        }

****************************

//Methods
        private void updateSettings()
        {
            m_UserName = textBoxUserName.Text;
            m_Password = textBoxPassword.Text;
            m_Timer = numericUpDownTimer.Value.ToString();
            m_MainServer = textBoxMainServer.Text;
            m_Server = textBoxServer.Text;
            m_DebugOn = checkBoxDebugMode.Checked;
            m_DebugFile = textBoxDebugFile.Text;
            m_SettingsFile = textBoxSettingsFile.Text;
            m_QueueFile = textBoxQueueFile.Text;
        }

        public void setLoadedSettings()
        {
            textBoxUserName.Text = m_UserName;
            textBoxPassword.Text = m_Password;
            numericUpDownTimer.Value = decimal.Parse(m_Timer);
            textBoxMainServer.Text = m_MainServer;
            textBoxServer.Text = m_Server;
            checkBoxDebugMode.Checked = m_DebugOn;
            textBoxDebugFile.Text = m_DebugFile;
            textBoxSettingsFile.Text = m_SettingsFile;
            textBoxQueueFile.Text = m_QueueFile;
        }
I used to program in C++ a long time ago, so I thought trying to help out with this project with you could help me learn C# too. It's been almost 9 years since I worked with C++.

One other thing.... A logout option.....
Code:
/*
         * Log out from the game server
         */
        private void logOut()
        {
            try
            {
                m_State = "logout";
                loadSettingsRequest();

                setStatusBar("Logging Out");

                String l_Url = "http://" + m_Settings.MainServer + "/start?action=logout";
                                
            }
            catch (Exception e)
            {
                debug(e.Message);
            }
        }
Is this possible?

-Nate
srialmaster is offline  
Old 02/21/2010, 00:56   #69
 
elite*gold: 0
Join Date: Aug 2009
Posts: 1,656
Received Thanks: 703
Quote:
Originally Posted by dbtuga View Post
Hey. I need help in pt server.
i just cant login..any ideas?
Could you check your settings.txt?
Your server settings should look like pt.grepolis.com;pt1.grepolis.com
Or maybe there's a small typo in your username or password?

The last time I checked the pt server is just a few days ago. There weren't any problems then with the login.

@srialmaster
Nice to hear that you want to learn some C#

But it's a bit difficult to let someone else add things. If you add something new there's a big chance you have to update some old code as well.

But the logout code is almost correct.
Code:
String l_Url = "http://" + m_Settings.MainServer + "/start?action=logout";
Uri l_Uri = new Uri(l_Url);
m_HtmlHandler.DownloadStringAsync(l_Uri);
We need also a new state for this. m_State = "logout" for example.
You can handle this state in the method: client_DownloadStringCompleted

I'm not really sure yet if we need this function though. Because if you exit the bot and login with your browser the session you had with the bot is gone.

To save the building queue is some more work. The settings you added for queue text file looks correct.
To save/load this text file you need to know the townid and the building names for in the queue (the dev name (first line in translation.txt) not the local).
Form1.cs is the main class and knows every object so you have to create a new method there.
Remember you can only load the queue when you are logged in and townid is known.

There are probably some more things that you need to check but it's already too late to think of them.

I think I will work alone on this bot for the time being. But you can always come with ideas or questions about the code.


~Uthar
Utharnl is offline  
Old 02/21/2010, 05:23   #70
 
elite*gold: 0
Join Date: Jan 2010
Posts: 23
Received Thanks: 1
Quote:
Originally Posted by Utharnl View Post
Could you check your settings.txt?
Your server settings should look like pt.grepolis.com;pt1.grepolis.com
Or maybe there's a small typo in your username or password?

The last time I checked the pt server is just a few days ago. There weren't any problems then with the login.

@srialmaster
Nice to hear that you want to learn some C#

But it's a bit difficult to let someone else add things. If you add something new there's a big chance you have to update some old code as well.

But the logout code is almost correct.
Code:
String l_Url = "http://" + m_Settings.MainServer + "/start?action=logout";
Uri l_Uri = new Uri(l_Url);
m_HtmlHandler.DownloadStringAsync(l_Uri);
We need also a new state for this. m_State = "logout" for example.
You can handle this state in the method: client_DownloadStringCompleted

I'm not really sure yet if we need this function though. Because if you exit the bot and login with your browser the session you had with the bot is gone.

To save the building queue is some more work. The settings you added for queue text file looks correct.
To save/load this text file you need to know the townid and the building names for in the queue (the dev name (first line in translation.txt) not the local).
Form1.cs is the main class and knows every object so you have to create a new method there.
Remember you can only load the queue when you are logged in and townid is known.

There are probably some more things that you need to check but it's already too late to think of them.

I think I will work alone on this bot for the time being. But you can always come with ideas or questions about the code.


~Uthar
The reason for the logout script is to make it where I can login with the browser, make any actions I want to and not have to restart the bot. This is just to make a quick fix for the queue until we can make a queue txt file to save the queue.

Basically:

Login
Build your queue
Start
(maybe add a pause here)
Logout
Do what you want in the browser, then logout on browser
Login
(un-pause the bot) and it keeps going.

Right now I am working 10hours/day and will go to 12hours/day next month for 3 weeks. Then, I will have more time to dig into this. I just thought I could give a hand in adding features with this....modulation. I worked on the Form1.cs earlier, but didn't save it. I know what you mean about adding the m_statement for the txt file. As far as adding the Logout to the menu, I can do that too. I will add the logout feature tonight and try it. Hopefully, I can login, make some queues, logout, attack some towns/farms, login and let the bot run while I sleep and at work the next day.
srialmaster is offline  
Old 02/21/2010, 10:25   #71
 
elite*gold: 0
Join Date: Jan 2010
Posts: 23
Received Thanks: 1
I tried setting up some of the references for the queue.txt file. Also, I tried adding the Logout feature.....but it's not working....

I have attached my current files for the coding.

-Nate
Attached Files
File Type: zip grepolisbot_source_nate_v1.4.zip (809.2 KB, 42 views)
srialmaster is offline  
Thanks
1 User
Old 02/21/2010, 22:56   #72
 
elite*gold: 0
Join Date: Aug 2009
Posts: 1,656
Received Thanks: 703
The login method triggers a sequence of methods.
-Looking for town
-Getting building data
-Creating new Town object with this data

So if you call login again after you logged out it will overwrite all the current town data, also your building queue.

I think we can better skip the logout function and only make a relogin function. (If you login on your browser it will logout the bot). The new relogin function must then only connect to the server and don't update the town info.

At the moment I'm first updating a few things on my Empire Craft bot and after that I'm going to work on this one.

Todo list is getting bigger and bigger for grepolis, have this planned so far:
-Show resource production
-Minimize to tray icon
-Attack farmers
-Reconnect to server
-Bigger timer
Utharnl is offline  
Thanks
2 Users
Old 02/22/2010, 13:11   #73
 
elite*gold: 0
Join Date: Jan 2010
Posts: 23
Received Thanks: 1
Quote:
Originally Posted by Utharnl View Post
The login method triggers a sequence of methods.
-Looking for town
-Getting building data
-Creating new Town object with this data

So if you call login again after you logged out it will overwrite all the current town data, also your building queue.

I think we can better skip the logout function and only make a relogin function. (If you login on your browser it will logout the bot). The new relogin function must then only connect to the server and don't update the town info.

At the moment I'm first updating a few things on my Empire Craft bot and after that I'm going to work on this one.

Todo list is getting bigger and bigger for grepolis, have this planned so far:
-Show resource production
-Minimize to tray icon
-Attack farmers
-Reconnect to server
-Bigger timer
Prioritize:
1.Minimize to tray icon
2.Show resource production
3.Bigger timer
4.Reconnect to server
5.Attack farmers

I think this would be the easiest order.

I wish I was of help more.

Also, on relogin, it needs to update resource and production/hour only. It could just load the queue txt.

-Nate
srialmaster is offline  
Old 02/22/2010, 14:10   #74
 
elite*gold: 0
Join Date: Mar 2009
Posts: 100
Received Thanks: 1
Nooo, the attack farmers should be the 1st, cuz it the hardest, and after you get finished with it it would be like a weight off of your shoulders...

If you make the option to attack farmers could u make one to attack other polis aswell ? ... it would be coordinate based..
Unghiutza is offline  
Old 02/23/2010, 12:10   #75
 
elite*gold: 0
Join Date: Sep 2009
Posts: 1
Received Thanks: 0
Super Vielen Dank.
mumbumbe is offline  
Reply


Similar Threads Similar Threads
Grepolis Bot (GrepolisNet)
09/03/2019 - Browsergames - 172 Replies
http://grepolis.eden-daoc.net/1c.png << Download the GrepolisNET here >> GrepolisNET is a new kind of browser, based on Firefox, designed for your favorite game Grepolis, which includes lots of usefull tools Probably the first bot allowing the user to browse and play while it is running !
Grepolis Bot?
02/20/2011 - Browsergames - 4 Replies
Huhu, wollte mal fragen ob es einen grepolis Bot gibt ? wenn ja vllt könnte einer den link posten dank euch
Grepolis Help
04/05/2010 - Main - 1 Replies
Hey ich will den Bot benützen !!! aber wie geht der eig. der hier >>>http://www.elitepvpers.com/forum/browse rgames/438818-grepolis-bot-now-attack-option.html



All times are GMT +1. The time now is 09:58.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.