minor problem ...
Code:> clanhop The Hogs of Destiny Attempting hop to clan: The Hogs of Destiny Attempting hop to clan: The Hogs of Destiny Spade Association Multiple matches found! Can't hop to a clan unless you can be more precise. done
Well, for some odd reason I decided to fix it for you. The script will now automatically match to the shorter string which, at least in this case, will be correct.Code:> clanhop The Hogs of Destiny Attempting hop to clan: The Hogs of Destiny Attempting hop to clan: The Hogs of Destiny Spade Association Multiple matches found! Can't hop to a clan unless you can be more precise. done
It hits the recruiter page every time you call it, I believe. If it was integrated into mafia, it should probably just load that page when you log on, and maybe have an option to reload the list of possible clans.
[COLOR="Olive"]> clanhop farewell[/COLOR]
[COLOR="#002080"]You are currently whitelisted by 11 clans[/COLOR]
Matching clan found: Farewell Transmission
[COLOR="#008000"]Welcome to your new clan, Farewell Transmission![/COLOR]
[COLOR="#808000"]> clanhop hcn[/COLOR]
[COLOR="#002080"]You are currently whitelisted by 11 clans[/COLOR]
Matching clan found: Hardcore Nation
[COLOR="#008000"]Welcome to your new clan, Hardcore Nation![/COLOR]
[COLOR="#808000"]> clanhop hardcore[/COLOR]
[COLOR="#002080"]You are currently whitelisted by 11 clans[/COLOR]
Matching clan found: Hardcore Nation
Matching clan found: Hardcore State
[COLOR="Red"]Multiple matches found! Making a guess as to the most precise match.[/COLOR]
[COLOR="#002080"]Attempting hop to clan: Hardcore State[/COLOR]
[COLOR="Green"]Welcome to your new clan, Hardcore State.[/COLOR]
[COLOR="Olive"]> clanhop ft[/COLOR]
[COLOR="#002080"]You are currently whitelisted by 11 clans[/COLOR]
Matching clan found: Farewell Transmission
[COLOR="Green"]Welcome to your new clan, Farewell Transmission![/COLOR]
[COLOR=olive]> ash import <clanhop.ash>;clanhop("'); drop table clans;--")[/COLOR]
[COLOR=#002080]You are currently whitelisted by 22 clans[/COLOR]
[COLOR=red]Invalid pattern syntax (clanhop.ash, line 72)[/COLOR]
Returned: void
Let me know if you want a whitelist to the clan to help with debugging.
Yeah, I know about the chat command being executable from the cli, but I was a bit concerned about there being a small time-delay between entering a chat command and the command taking effect in KoL? I'm not sure if this actually is an issue, though, but since I am planning on doing a bit of stashing after the clanhopping I wanted to make absolutely sure I was in the correct clan when the next command was executed.This script is no longer needed. You can just use cli_execute( "/whitelist drop table clans" ) and let mafia send the chat command unmodified since KoL added that.
Little Bobby Tables indeed. It looks like Jick sanitizes his database inputs :-D Anyway, you've been given a whitelistLoL! Your clan was named after Bobby Tables? Yeah, please give me a whitelist so I can try it out.![]()
string findClanname() {
string htmlFromClan;
string pattern;
boolean[item] itemsToReturn;
matcher currentClan;
htmlFromClan = visit_url("town_clan.php");
pattern = "(?<=<center><b>)[\\w\\s\\p{P}]+(?=<\\/b>)";
currentClan = create_matcher(pattern, htmlFromClan);
if (currentClan.find()) {
return currentClan.group(0);
} else {
exit;
}
}
return group_string(clans_raw, "option value=([0-9]+)>(.+?)<");