Continuing my journey to make an awesome clanbot, I'm now working on booting clannies that were added to our looter rank. Here's what I came up with (this uses MrEdge's clan admin functions, so I won't put the whole thing here):
I got it working all right with a previous version that didn't use a map (and had problems when ISput was equal to 25 to 31), but I ran out of looters to test this version on. So what I want to know is if using "ISputMod[ISput]" like that will work.
Also, there's still a problem with months that have only 30 days (24 to 30 would need different values on those), as well as the month of February, so is there something that can be done with those cases?
Also also, is there an alternative to using a map that makes the whole thing more compact?
PHP:
string clanniepage = visit_url("showplayer.php?who="+CurrentRoster[Clannie].ID);
matcher ISdate = create_matcher("<br>Title: <b>(.*?)\\.(.*?)\\.(.*?) at (.*?):(.*?):(.*?) (.*?)</b>", clanniepage);
matcher DateNow = create_matcher("(.*?)\\.(.*?)\\.(.*?)", now_to_string("yyyy.MM.dd"));
find(ISdate);
find(DateNow);
int[int]ISputMod;
ISputMod[1] = 8
ISputMod[2] = 9
ISputMod[3] = 10
ISputMod[4] = 11
ISputMod[5] = 12
ISputMod[6] = 13
ISputMod[7] = 14
ISputMod[8] = 15
ISputMod[9] = 16
ISputMod[10] = 17
ISputMod[11] = 18
ISputMod[12] = 19
ISputMod[13] = 20
ISputMod[14] = 21
ISputMod[15] = 22
ISputMod[16] = 23
ISputMod[17] = 24
ISputMod[18] = 25
ISputMod[19] = 26
ISputMod[20] = 27
ISputMod[21] = 28
ISputMod[22] = 29
ISputMod[23] = 30
ISputMod[24] = 31
ISputMod[25] = 1
ISputMod[26] = 2
ISputMod[27] = 3
ISputMod[28] = 4
ISputMod[29] = 5
ISputMod[30] = 6
ISputMod[31] = 7
int ISput = to_int(group(ISdate, 3));
if (ISputMod contains ISput)
{
int BANdate = (ISputMod[ISput]);
}
if(BANdate == to_int(group(DateNow, 3)))
{
print(Clannie+ " is being booted due to not raising his karma after 1 week.", "red");
visit_url("clan_members.php?&action=modify&pids[]=" +CurrentRoster[Clannie].ID+ "&level" +CurrentRoster[Clannie].ID+ "=" +GetRankID(IS, MemberPage)+ "&title" +CurrentRoster[Clannie].ID+ "=" +IS+ "&boot" +CurrentRoster[Clannie].ID+ "&modify=Modify Members");
kmail(to_string(CurrentRoster[Clannie].ID), ISban, 0);
chat_private("HastyBuffer", "BlackList Add " +Clannie+ "");
print(Clannie+ " was successfully booted and added to the Black List.", "purple");
kmail("HasteBro", to_string(Clannie)+" was booted due to being IS and not raising his karma. Timestamp: "+ now_to_string("yyyy.MM.dd 'at' HH:mm:ss z") +"", 0);
}
I got it working all right with a previous version that didn't use a map (and had problems when ISput was equal to 25 to 31), but I ran out of looters to test this version on. So what I want to know is if using "ISputMod[ISput]" like that will work.
Also, there's still a problem with months that have only 30 days (24 to 30 would need different values on those), as well as the month of February, so is there something that can be done with those cases?
Also also, is there an alternative to using a map that makes the whole thing more compact?