void stash_info(buffer ClanLog) { string the_date; string the_time; string player_name; string player_id; string action; string amount; string item_handled; int start_of_stash_activity = index_of(ClanLog, "Stash Activity") + 55; int end_of_stash_activity = index_of(ClanLog, "Miscellaneous:", start_of_stash_activity); string stash_activity = substring(ClanLog, start_of_stash_activity, end_of_stash_activity); string pattern = ">(\\d{2}/\\d{2}/\\d{2}), (\\d{2}:\\d{2}[AaPp][Mm]): ([a-zA-Z0-9\\-\\_\\ ]+) \\(#(\\d+)\\)<\\/a> (added|took|contributed) (\\d+) (.+?)\\.Build matcher"); int i = 0; while(i < 5)//test only 5 iterations { print_html("Find"); if (m_stash_put.find()) { i=i+1; the_date = m_stash_put.group(1); the_time = m_stash_put.group(2); player_name = m_stash_put.group(3); player_id = m_stash_put.group(4); action = m_stash_put.group(5); amount = m_stash_put.group(6); item_handled = m_stash_put.group(7); print_html("" + player_name + " (#" + player_id + ") " + action + " " + amount + " " + item_handled + " on " + the_date + " at " + the_time + "."); print_html("" + m_stash_put.group(0) + ""); } } } void whitelist_info(buffer ClanLog) { string the_date; string the_time; string player_name; string player_id; string action; int start_of_comings_and_goings = index_of(ClanLog, "Comings and Goings") + 60; int end_of_comings_and_goings = index_of(ClanLog, "Stash Activity", start_of_comings_and_goings); string comings_and_goings = substring(ClanLog, start_of_comings_and_goings, end_of_comings_and_goings); string pattern = ">(\\d{2}/\\d{2}/\\d{2}), (\\d{2}:\\d{2}[AaPp][Mm]): ([a-zA-Z0-9\\-\\_\\ ]+) \\(#(\\d+)\\) (joined another clan|was accepted into the clan)"; matcher m_stash_put = create_matcher(pattern, comings_and_goings); print_html("Build matcher"); int i = 0; while(i < 5)//test only 5 iterations { print_html("Find"); if (m_stash_put.find()) { player_name = m_stash_put.group(3); if (player_name != "Easyfax" && player_name != "CheeseFax") { i=i+1; the_date = m_stash_put.group(1); the_time = m_stash_put.group(2); player_id = m_stash_put.group(4); action = m_stash_put.group(5); if (action.contains_text("accepted")) { print_html("" + player_name + " (#" + player_id + ") joined the clan."); } else if (action.contains_text("joined")) { print_html("" + player_name + " (#" + player_id + ") left the clan."); } else { print_html("" + action + ""); } print_html("" + m_stash_put.group(0) + ""); } } } } void main() { buffer ClanLog = visit_url("clan_log.php"); whitelist_info(ClanLog); #stash_info(ClanLog); }