Request: Auto-Accept Clan Apps

The Botter

New member
Could someone make a script that could accept all call members that apply to your clan and be able to have the script every ## of minutes to see if there are new applications then accept them automatically. I made an attempt and failed. If you do make it, I'll reward you with something
 
Last edited:

Bale

Minion
If you made an attempt and failed, then please post your attempt. You'll get a lot more eager help if we can see what you did.
 

The Botter

New member
Yeah but, my attempt sucks because I haven't done this in forever. There is no way this is correct. It has been forever since I've done anything other than HTML. It's not even worth anyone's time. I tried copying part of the check for clan apps script and tried to modify it. The only part of the code that looks a little bit right would be,
Code:
string app = visit_url("clan_office.php");
if (index_of(app, "There are ") > 0 
then {visit_url("clan_applications.php") and select(1)
I then drew a blank and realized that none of this looks right, and have no clue what do from here.
 

Bale

Minion
I see you started off by modifying Zarqon's script here. After that though you lost your way.

I don't think that select() is even a command, is it? You need to use visit_url() to accept the application. To find out the command that accepts an application you should use the relay browser (that little browser-lite window that kolmafia can produce). It has an address bar that will tell useful information for visit_url(). If you accept someone's application, then it will show you the command that was used. By modifying that for different user ids you can accept that player into your clan.

And you'll need to use string functions to parse the correct user ID out of the application to your clan.

I think that method would work. I'll leave the rest as an exercise for the student.
 
Last edited:

The Botter

New member
Looks like I can't accept clan applicants through that. I know I am using the right thing because I am getting the function for things that I do. I'll see if I can go onto the normal kol and piece it together like that by viewing the source code.

[Edit] I found out why at least, it doesn't support javascript so I am going to assume that's what's causing issues.
[Edit Again] Alright so I have a few more questions
1. How would I make it so that it would automatically accept whoever's player I.D.
2. After doing this manually I came up with something like this and I trying to set up. This is as far as I have gotten. I need to "describe" the variable action somehow.

Code:
visit_url("clan_applications.php");
action=1=request=(Player I.D. is here)&process=process&pwd

The value for accept is 1 in game. The form name is process. Player I.D. # is the same as the request # for value 1. The parts of this code are done manually and not through the mini-browser.
 
Last edited:

Bale

Minion
Code:
visit_url("clan_applications.php");
action=1=request=(Player I.D. is here)&process=process&pwd

The value for accept is 1 in game. The form name is process. Player I.D. # is the same as the request # for value 1. The parts of this code are done manually and not through the mini-browser.

Just visit_url the url that you'd visit when you click the button...
Code:
int pID;    // This integer is the Player ID.
visit_url("clan_applications.php?action=1=request="+ to_string(pID)+ "&process=process&pwd");

You can just add strings like that to concatenate them into one big string.
 
Last edited:

dj_d

Member
BTW Botter - you may not be aware, but requests for scripting help are usually met with profound and rapid assistance. Requests for scripts to be written in toto (not "help", but "please do this") are supposed to be accompanied by a reward, minimum value of 1 Mr. A (per forum rules). So if you'd like to kick back and have the script written for you, by all means make an offer. Otherwise, it looks like Bale's delivering the kind of customer service kolmafia.us is known for. :)

I mention this not as a criticism, but as an explanation in case you're wondering why your query was redirected from "please do it for me" to "please help me do it for myself".
 

mredge73

Member
Done!
You're Welcome.

Use:
AcceptApplications(true);
Or Better:
print_html(AcceptApplications(true));


Code:
//Accept Applications
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
string AcceptApplications(boolean AcceptAll)
{
	string outstring="";
	matcher APPCHECK=create_matcher("y <b>(\\d+)</b> p", visit_url("clan_office.php"));	
	if(APPCHECK.find())
	{
		outstring="There are "+APPCHECK.group( 1 )+" new member applications:) <br />";
		if (AcceptAll==true)
		{
			int dudes=0;
			matcher Applicants = create_matcher("who=(\\d+)\">(.+?)<", visit_url("clan_applications.php"));

			while (Applicants.find())
			{
				visit_url("clan_applications.php?request"+Applicants.group( 1 )+"=1&action=process");
				outstring=outstring+"Accepted "+Applicants.group( 2 )+" into the clan! <br />";
				dudes=dudes+1;
			}
			outstring=outstring+"Bot Welcomed "+to_string(dudes)+" new members! <br />";
		}
	}
	else
		outstring="There are no new member applications:( <br />";
	
	
	outstring="<B><FONT color=#365f91>"+outstring+"</B></FONT><br />";
	return outstring;
}
 

z53

New member
Very nice script; thanks :) This is definitely something that should be included in vanilla KoL however.
 
Top