Clan hopping script via PM

Pazleysox

Member
I don't see a whole lot in the forums about clan hopping. I did find the code below from MrEdge73's script from 2010, and Bale's BaFH script works great for that clan, and I can see how to jump back to my home clan.

I'm looking to be able to hop to a clan that I'm whitelisted to when requested via a PM. Kind of like how faxbot will drop a fax into your machine. I am NOT trying to write a faxbot script, or a faxing of anything type of script. I want my chatbot to be able to help other people with Dreadsylvania. It's already programed to help with banishes, I just want to broaden my horizons.

Code:
{
	int clan_start = index_of( message.to_lower_case() , "join" ) + 5;
	string clan_name = substring( message , clan_start );

	if( join_clan( clan_name ) )
	{
		//chat_reply( "Hooray! I've managed to join " + clan_name + "!" );
		print("Hooray! I've managed to join " + clan_name + "!","blue");
	}
	else
	{
		//chat_reply( "I'm sorry, I was not able to join " + clan_name + ". Am I already in " + clan_name + "?" );
		vprint("I'm sorry, I was not able to join " + clan_name + ". Am I already in " + clan_name + "?","red",-2);
	}
}
 
Change that code to refer to the destination clan?

I'm not exactly sure what you are asking for honestly. cc_ascend has some changeClan functions if you want to use those. I added one that accepts a clan name instead of a clan id just now because that seemed like something I should have done a while ago.
 

Pazleysox

Member
Change that code to refer to the destination clan?

I'm not exactly sure what you are asking for honestly. cc_ascend has some changeClan functions if you want to use those. I added one that accepts a clan name instead of a clan id just now because that seemed like something I should have done a while ago.

I'm looking to do something like what faxbot does. IE:
A) send PM to bot
B) bot switches to users clan
C) bot does what user requests
D) bot switches back to home clan

it's the part B that I can't figure out.
 
I'm looking to do something like what faxbot does. IE:
A) send PM to bot
B) bot switches to users clan
C) bot does what user requests
D) bot switches back to home clan

it's the part B that I can't figure out.

I assumed the scripts you mentioned initiate clan changes. I'm guessing you want to figure out what clan to hop to? I don't know if there is anything built in for that but you could scrape the profile of the player who sent the message.
 

Pazleysox

Member
I assumed the scripts you mentioned initiate clan changes. I'm guessing you want to figure out what clan to hop to? I don't know if there is anything built in for that but you could scrape the profile of the player who sent the message.

Actually, I found some code someone gave me a year ago. It looks like it's going to work...
Ok, I've figured out how to pull the users clan name from their profile page.

The script I have pulls player names from a file.
PHP:
// rest of your script goes here
string [int] my_list;
file_to_map( "searchplayerbot.txt" , my_list);
playerdata player;
string temp = "";
foreach i,playername in my_list {
    player = GetPlayer( playername );
    if( player.name != "" ) {
        if( temp != "" ) temp += ", ";
//        temp += player.name + " the level " + player.level + " " + player.cclass + " " + player.clanname;
	temp += player.clanname;
    } else {
        print( "Error: Player " + playername + " not found in search!", "red" );
    }
}
here's the code I'm using. I'm not sure if there's a way to do this without putting the player name into a file. I also don't understand map_to_file() well enough to pull the player name from a PM and put it into the file "searchplayerbot.txt".

I have another script imported into this one to pull needed info, which is arbitrary for what I'm looking to do right now (I think), so I'm not including it
 
Last edited:
Top