Results 1 to 5 of 5

Thread: Clan hopping script via PM

  1. #1
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    363

    Default Clan hopping script via PM

    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);
    	}
    }

  2. #2
    Senior Member
    Join Date
    Oct 2014
    Posts
    159

    Default

    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.

  3. #3
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    363

    Default

    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.
    Originally Posted by cheesecookie View Post
    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.

  4. #4
    Senior Member
    Join Date
    Oct 2014
    Posts
    159

    Default

    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.
    Originally Posted by Pazleysox View Post
    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.

  5. #5
    Senior Member Pazleysox's Avatar
    Join Date
    Feb 2009
    Posts
    363

    Default

    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.
    Originally Posted by cheesecookie View Post
    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 Code:
    // rest of your script goes here
    string [intmy_list;
    file_to_map"searchplayerbot.txt" my_list);
    playerdata player;
    string temp "";
    foreach 
    i,playername in my_list {
        
    player GetPlayerplayername );
        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 by Pazleysox; 03-30-2018 at 03:05 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •