View Full Version : Rumpus Room (associating text with a link)
Tpj_4000
06-06-2009, 05:06 PM
Doeas anyone know how to tie rumpus room equipment to a position to generate the correct visit_url() ? Obviously Mafia does, but I wanted to generally know how to parse the returned visit_url() string text and be able to associate a matching string with it's link.
I tried digging through ClanRumpusRequest.java and gained limited insight. If anyone can explain this better, I'd appreciate it.
matt.chugg
06-06-2009, 08:32 PM
well if I understand what you are saying, each position can only contain specific items.
for example
spot=1 is A Nail in the Wall and can contain either of the calendars, an infuriating painting or a meat orchard
spot=2 is a bookshelf so can contain books (self help, tomes, or sports)
am I right in assuming you are trying to deteriming if you clan has a specific item? use the retuned string from visit_url and check spot=? and then its coresponding furni= value.
Perhaps if I knew better what you were trying to achieve I might be able to help more!
Tpj_4000
06-07-2009, 12:09 AM
Yeah I guess I wasn't clear enough. You are correct. I would like to do something like:
int i;
string buffer;
buffer=visit_url("clan_rumpus.php");
if(contains_text(buffer, "Mr. Klaw")){
for i from 0 to 2{
[use the claw game]
}
}
Looking at the page, clan_rumpus.php?action=click&spot=3&furni=3 is the link for a claw skill game at position 3. I can make a map of what furniture corresponds to what value, no problem. My question is, how do I parse the buffer to know that it is at position 3?
[realization]
As I just typed this response I realized that the claw skill game can only be at position 3, so there's no problem. [bangs head on desk]
Unless I've missed something, I'll just:
int i;
int[string] furniture;
int[string] position;
buffer=visit_url("clan_rumpus.php");
if(contains_text(buffer, "Mr. Klaw")){
for i from 0 to 2{
visit_url("clan_rumpus.php?action=click&spot=" + position["Mr. Klaw"] + "&furni=" + furniture["Mr. Klaw"]);
}
}
Tpj_4000
06-07-2009, 12:54 AM
I have one follow up question.:
To save on server hits, I was going to create a file that held all the clan furniture owned, so as to not hit the rumpus room a bunch of times. However, what if some point in the future the clan furniture changes and you try to visit_url() the Mr. Klaw game and it doesn't exist anymore? Do you get an error message?
It's a little expensive to test this out :o
Yep, you'd get an error message if the Klaw vanishes. You'd probably be best off hitting the rumpus room once a day (but only once a day) to check what the current furniture is.
Powered by vBulletin® Version 4.1.12 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.