Change Clan Member Ranks

mredge73

Member
I am building a clan bot script to automatically change karma based ranks.

I am having a little trouble on the visit_url to change clan member ranks :confused:
I have already built a good parcer to get all of the information that I need to change the ranks now I need the actual visit_url to do so. I must admit that I am not very good at reading through the html source code. This is what I came up with for one of my inactive members, but it does not work:

clan_members.php?action=modify&begin=1&pid[]=1589190&level1589190=4&title1589190=""&modify=Modify Members&pwd

also tried these (and many more) with and without pwd:

clan_members.php?action=modify&pid[]=1589190&level1589190=4&title1589190=""&modify=Modify Members&pwd

clan_members.php?action=modify&level1589190=4&title1589190=""&modify=Modify Members&pwd

clan_members.php?action=modify&title1589190=""&modify=Modify Members&pwd

On previous examples I have noticed that you need to fill every input.
begin=1 -> an input that I thought should be included
pid[]=1589190 -> is the member ID to be modified
level1589190=4 -> is what rank I want to change, this is a select?
title1589190="" -> is what title I want to change, this is a text
modify=Modify Members -> is the submit button
pwd -> not sure what this is, sometimes needs to be included

I don't quite understand the select command but I am asumed it worked the same using &name=value
 

jasonharper

Developer
Your first attempt looks closest to being correct, but there shouldn't be quotes in the title field - that's not a valid character in a URL. Unfortunately, I don't have sufficient privileges in my clan to test the proper URL.
 

lostcalpolydude

Developer
Staff member
I tried using the mini browser to get the right URL, but I can't change member ranks with it, either from the Membership Roster page or the Clan Whitelist page. This account is the clan leader (a shell account for a side clan), so no permission issues, the button to submit the form just seems to do nothing.
 

mredge73

Member
I am still working on this:
The best I can do so far is change the pages by using the begin value:
clan_members.php?begin=1

If I can discover the url to click the submit button without making any changes that would help greatly.
currently tried:
clan_members.php?action=modify
clan_members.php?begin=1&action=modify
clan_members.php?pwd&action=modify
clan_members.php?action=modify&pwd

all returned blank pages.

I tried this tool but it did not help:
http://www.urlhelper.com/
 
While it does not actually click the submit button:

clan_members.php?action='modify'

this does not return a blank page. I don't know if that helps you in the least, but I'll keep tying.
 

mredge73

Member
Major weirdness here
I finally found the url.
The problem here is that this url if put into the relay browser or mini-browser you will get a blank page but it will work through ash. This makes it very difficult in trying to discover this kind of URL and I don't know what is causing it.

Thanks for everyone's help, attached my test code so you can use the url if you like.

Code:
string [int] memberpage;
memberpage[1]=visit_url("clan_members.php?num_per_page=100&begin=1&action=modify&pids[]=1937445&level1937445=0&title1937445=dude&modify=Modify Members");
if (contains_text(memberpage[1], "Modified level for HAHAHAHAHA no"))
print ("1 worked");

memberpage[2]=visit_url("clan_members.php?num_per_page=100&begin=1&action=modify&pids[]=1937445&level1937445=24&title1937445=experiment&modify=Modify Members");
if (contains_text(memberpage[2], "Modified title for HAHAHAHAHA no"))
print ("2 worked");

map_to_file(memberpage, "test1.txt");
print("done");
 

zarqon

Well-known member
Edge -- thanks for the debugging help! I was putting something together to whitelist/boot inactive members and was having trouble getting them to boot correctly.
 

mredge73

Member
the url can also be shortened, it does not need the page number to work.

clan_members.php?action=modify&pids[]=1937445&title1937445=experiment&modify=Modify Members
This will change titles only

clan_members.php?action=modify&pids[]=1937445&level1937445=0&modify=Modify Members
This will change the rank

Now all you have to do is parse the level id and the user Id, I am sure we could work out a trade if you don't want to put in the work to do this yourself...
 

zarqon

Well-known member
I mean... thanks, due to the clues in your post I was able to get it working! I was missing the "pids[]" variable. It also works for me without the "modify=Modify Members".
 

Grotfang

Developer
Little bit of a necro here, but for anyone who has any use for it, this script will parse the clan page of any clan and pop their player id's in order of appearance into a map called player_id.

Oh, also also, it may get confused if anyone has "nounder" in their name or clan title. I figured it was unlikely... but thought I'd mention it.

Code:
int clan_id = 780;

string excise( string source , string start , string end )
{

	if( !source.contains_text( start ) ) return "";

	string result = substring( source , index_of( source , start ) + length( start ) );

	if( !result.contains_text( end ) ) return "";

	return substring( result , 0 , index_of( result , end ) );

}

string [int] parse_ids()
{
	string [int] parsed_id;
	string call_clan_page = visit_url( "showclan.php?whichclan=" + clan_id );
	call_clan_page = substring( call_clan_page , index_of( call_clan_page , "nounder" )  );
	string [int] km = split_string( call_clan_page , "nounder");
	int p = 0;
	for i from 0 upto count( km ) - 1
	{
		if( contains_text( km[i] , "" ) ) 
		{
			parsed_id [p] = excise( km[i] , "href=\"showplayer.php?who=" , "\">" );
			p = p + 1;
		}
	}
	return parsed_id;
}

void main()
{
	string [int] player_id = parse_ids();
	print( "Collected ids" , "green" );
	foreach x in player_id
	{
		print( player_id [x] );
	}
}

int clan_id is the number your clan is assigned. Change it accordingly as it is currently set to my own clan. Also, it currently only prints the ids. However, obviously, you don't need to do this and the map can be used however you like.

Cheers,

Grot
 
Last edited:
Top