Retrieval of specific game
Moderator: Tech Team
Forum rules
Please read the Community Guidelines before posting.
Please read the Community Guidelines before posting.
- theherkman
- Posts: 677
- Joined: Sun Mar 14, 2010 11:29 am
- Gender: Male
- Location: En urz bazez!!!
Retrieval of specific game
How can I make a request of the CC api to retrieve all games by a specific user? Also, how can I request a specific game? Does the xml output of this request show which turns have been taken in the current freestyle round? If not, how can I extrapolate this information using api requests?
Re: Retrieval of specific game
Wow, 4 questions. http://www.conquerclub.com/api.php gives the basic information (xml, check the source if it doesn't display properly).
1st: set p1un (or p1) to the value you want. So http://www.conquerclub.com/api.php?mode ... theherkman would give you the first 200 of your games, increase page number to get the rest.
2nd: set the game number, http://www.conquerclub.com/api.php?mode=gamelist&gn=1
3: Not entirely possible, the players will have a status. But at first a player might be waiting because he went last.
4. No way through the api afaik.
1st: set p1un (or p1) to the value you want. So http://www.conquerclub.com/api.php?mode ... theherkman would give you the first 200 of your games, increase page number to get the rest.
2nd: set the game number, http://www.conquerclub.com/api.php?mode=gamelist&gn=1
3: Not entirely possible, the players will have a status. But at first a player might be waiting because he went last.
4. No way through the api afaik.
- theherkman
- Posts: 677
- Joined: Sun Mar 14, 2010 11:29 am
- Gender: Male
- Location: En urz bazez!!!
Re: Retrieval of specific game
Shoot... Okay, moving on to my next script... http://www.conquerclub.com/api.php?mode ... theherkman
I am looking to TEST a script I am writing for feudal war esc. These are the settings I will be testing it on. If all goes well I will figure out a way to open this up and add variables for personal customization. Right now I am using AHK, but will probably end up compiling it in something more user friendly. I have programed the page request and source code open. I also have activated the window and sent focus to the source. This all takes less than a second or two. How can I retrieve the contents of the source file for use with AHK so I can add variables and set up arrays and arguments?
I am looking to TEST a script I am writing for feudal war esc. These are the settings I will be testing it on. If all goes well I will figure out a way to open this up and add variables for personal customization. Right now I am using AHK, but will probably end up compiling it in something more user friendly. I have programed the page request and source code open. I also have activated the window and sent focus to the source. This all takes less than a second or two. How can I retrieve the contents of the source file for use with AHK so I can add variables and set up arrays and arguments?
-
Dako
- Posts: 3987
- Joined: Sun Aug 26, 2007 9:07 am
- Gender: Male
- Location: St. Petersburg, Russia
- Contact:
Re: Retrieval of specific game
That is an interesting question. I just didn't understand - what kind of source do you want to extract?

- theherkman
- Posts: 677
- Joined: Sun Mar 14, 2010 11:29 am
- Gender: Male
- Location: En urz bazez!!!
Re: Retrieval of specific game
Dako wrote:That is an interesting question. I just didn't understand - what kind of source do you want to extract?
Well originally I wanted to extract the entire source of the API so I could extrapolate which games need turns to be taken. For instance, in 4 player Feudal ESC, I want all turns to be taken unless there are only 2 players, or another player has entered my castle. I have used the code below to extract that info.
Code: Select all
^!f:: ;Start script with Ctrl+Alt+F
IfWinExist Mozilla Firefox Start Page - Mozilla Firefox
{
WinActivate ;Check for FF Process
}
else ;If none is running
{
Run firefox.exe ;Start FF
WinWait Mozilla Firefox Start Page - Mozilla Firefox ;Wait until FF is launched
WinActivate ;Give FF focus
}
Click 267, 63 ;Give address bar focus
SetKeyDelay, 0 ;No key delay
Send http://tinyurl.com/256o8ga{Enter} ;Input CC API URL
Sleep 1000 ;Allow page load
RightClick 719, 164 ;Open FF context menu
Click 812, 394 ;Select source code page
IfWinExist Source of ;Find source window
{
WinActivate ;Give focus
}
Click 812, 394 ;Click to give focus to text area
send Ctrl+A ;Select source
Sleep 100 ;Sleep for safety
send Ctrl+C ;Copy source
Sleep 100 ;Sleep for safetyThen I will take the information from the clipboard and paste all the game numbers into a temp file that will be deleted at the end of the script. Then the script would load those games individually, checking to see if conditions are met for taking a turn. I plan to use a combination of the Game Log and BOB to ensure a player hasn't entered the castle. Then I will check for trade-ins. If I have less than 5 cards, I will deploy on the castle, bombard the correct territory, and end turn. This last step will require a large amount of programming from myself...
Re: Retrieval of specific game
Basically automating your turns, right.
- theherkman
- Posts: 677
- Joined: Sun Mar 14, 2010 11:29 am
- Gender: Male
- Location: En urz bazez!!!
Re: Retrieval of specific game
Only for 4 player Feudal ESC where there are more than 2 players remaining and no player has invaded your castle.
- theherkman
- Posts: 677
- Joined: Sun Mar 14, 2010 11:29 am
- Gender: Male
- Location: En urz bazez!!!
Re: Retrieval of specific game
This could take me a looooooooong time to finish. I still have to figure out how to feed the map info to the script. Is there an API request for a game that gives map info like who holds what and where that links to?
- theherkman
- Posts: 677
- Joined: Sun Mar 14, 2010 11:29 am
- Gender: Male
- Location: En urz bazez!!!
Re: Retrieval of specific game
Is there an API request for log? How does Bob know that yellow owns a territory right next to you and how is it able to highlight this in a foggy game? Wouldn't it show up as ? in the log?
Re: Retrieval of specific game
Yes there is page you can request for this info (BOB gets it)... but I really wouldn't go down this road, people tend
to notice unusual speed of moves...
to notice unusual speed of moves...
Re: Retrieval of specific game
Dako wrote:The game page has that info. Not the API.
I didn't say API, and the game page does not have this info either (aside from scraping), you need an additional parameter.
Re: Retrieval of specific game
chipv wrote:Dako wrote:The game page has that info. Not the API.
I didn't say API, and the game page does not have this info either (aside from scraping), you need an additional parameter.
Bob only gets the full log if needed, the rest is on the page now (especially the structure of the map and the placing of the armies).
Re: Retrieval of specific game
Are we done now, boys? 
- theherkman
- Posts: 677
- Joined: Sun Mar 14, 2010 11:29 am
- Gender: Male
- Location: En urz bazez!!!
Re: Retrieval of specific game
Okay, thanks for the help. I will gladly plod along until I have more questions with the confusing API...
- theherkman
- Posts: 677
- Joined: Sun Mar 14, 2010 11:29 am
- Gender: Male
- Location: En urz bazez!!!
Re: Retrieval of specific game
Okay, I have a question. How does BOB know when yellow has a territory next to player red in a foggy game? I can't figure it out... It's driving me nuts here...
- theherkman
- Posts: 677
- Joined: Sun Mar 14, 2010 11:29 am
- Gender: Male
- Location: En urz bazez!!!
Re: Retrieval of specific game
Okay, doesn't matter anymore. New line of questioning... How can I bring focus to the in game action pane? I see an ID in the source code, but I only see one... Wouldn't that make the entire action pane one big form but with different variables to fill in?

