March 2009 Updated:
Facebook changed some forms and modules in its website in March 2009, so I updated my previous code to the new one:
At last I wrote the universal friend adder for the Facebook.com!
So, you can use this code to add your friends from your arbitrary wall such as Mobwars, Mafia Wars, Eleven Blood, Knighthood, and so on.
There are some important notes:
0- You must download and setup the iMacros first from here (http://www.iopus.com/download/).
1- You must bypass the CAPTCHA by adding more than 30 friends (maybe a bit less or more than this) manually.
2- You must find your application ID number by going to your application page and check the URL. There is always something like this:
http://www.facebook.com/apps/application.php?id=XXXXXXXXX
Which “XXXXXXXXX” is the application number which you must set it as “applicationIDNumber” in this code.
3- Please configure your settings in this code before usage if you want to get the best result.
Note: Unfortunately in this fast revision, you must choose a “friend list” name for the new friends which stands before all the friend list names. For ex. this name can be look like: “000000myfriendlist”
You can copy/paste it as Facebook_Wall_Add.js to your iMacros.
/********* FaceBook Automatic Friends Adder from Apllications' Walls (After Passing the CAPTCHA manually)*********/
/********* You can bypass the CAPTCHA by adding more than 30 friends manually at the first *********/
/********* By Soroush Dalili March-2009 Soroush.SecProject.Com *********/
/********* Begin Configuration - You can change these settings *********/
var startPage = 2; // You can change this value to your page number!
var mobInviteMessage = "Please invite me to your Mafia Wars!"; // You can add your message here
var mobFriendList = "000000myfriendlist"; // You can add your special friend list (you must made it before)
var showImages = "1"; // You can change it to "0" (for disabling) and to "1" (for enabling)
// Wall ID Number: Mobwars = 8743457343 / Mafia Wars = 56556324950 / Eleven Blood = 29886835263 / Knighthood = 5541055185
// Just goto your application page which is something like "http://www.facebook.com/apps/application.php?id=XXXXXXXXX". This "XXXXXXXXX" is your application number
var applicationIDNumber = "56556324950"; // Default = MobWars Wall = 8743457343
/********* End Configuration - You can change these settings *********/
/********* Begin Code *********/
// Replace <SP> instead of space character
mobInviteMessage = addImacrosSpace(mobInviteMessage);
mobFriendList = addImacrosSpace(mobFriendList);
var jsNewLine="\n";
/********* Begin Openning Mobwars Wall's Pages *********/
var FaceBook_AddFromWall_Pages_Code;
FaceBook_AddFromWall_Pages_Code = "CODE:";
FaceBook_AddFromWall_Pages_Code = FaceBook_AddFromWall_Pages_Code+"SET !ERRORIGNORE YES" + jsNewLine;
if(showImages == "0"){
// Disable images to have more speed
FaceBook_AddFromWall_Pages_Code = FaceBook_AddFromWall_Pages_Code+"FILTER TYPE=IMAGES STATUS=ON" + jsNewLine;
}
// Open mobwars wall
FaceBook_AddFromWall_Pages_Code = FaceBook_AddFromWall_Pages_Code+"URL GOTO=http://www.facebook.com/wall.php?id=" + applicationIDNumber + "&page={{PageNumber}}" + jsNewLine;
FaceBook_AddFromWall_Pages_Code = FaceBook_AddFromWall_Pages_Code+"FILTER TYPE=IMAGES STATUS=OFF" + jsNewLine;
FaceBook_AddFromWall_Pages_Code = FaceBook_AddFromWall_Pages_Code+"WAIT SECONDS=1";
/********* End Openning Mobwars Wall's Pages *********/
/********* Begin Openning Mobwars Wall's Links *********/
var FaceBook_AddFromWall_Links_Code;
FaceBook_AddFromWall_Links_Code = "CODE:";
FaceBook_AddFromWall_Links_Code = FaceBook_AddFromWall_Links_Code+"SET !ERRORIGNORE NO" + jsNewLine;
FaceBook_AddFromWall_Links_Code = FaceBook_AddFromWall_Links_Code+"SET !TIMEOUT 15" + jsNewLine;
if(showImages == "0"){
// Disable images to have more speed
FaceBook_AddFromWall_Links_Code = FaceBook_AddFromWall_Links_Code+"FILTER TYPE=IMAGES STATUS=ON" + jsNewLine;
}
FaceBook_AddFromWall_Links_Code = FaceBook_AddFromWall_Links_Code+"TAG POS={{LinkNumber}} TYPE=A ATTR=HREF:http://www.facebook.com/s.php?k=100000080*&&CLASS:profile_link" + jsNewLine;
FaceBook_AddFromWall_Links_Code = FaceBook_AddFromWall_Links_Code+"WAIT SECONDS=1";
/********* End Openning Mobwars Wall's Links *********/
/********* Begin Add - Step1: Press "Add As Friend" *********/
var FaceBook_AddFromWall_Add_Step1_Code;
FaceBook_AddFromWall_Add_Step1_Code = "CODE:";
FaceBook_AddFromWall_Add_Step1_Code = FaceBook_AddFromWall_Add_Step1_Code+"SET !ERRORIGNORE NO" + jsNewLine;
FaceBook_AddFromWall_Add_Step1_Code = FaceBook_AddFromWall_Add_Step1_Code+"SET !TIMEOUT 15" + jsNewLine;
FaceBook_AddFromWall_Add_Step1_Code = FaceBook_AddFromWall_Add_Step1_Code+"TAG POS=1 TYPE=A ATTR=TXT:Add<SP>as<SP>Friend" + jsNewLine;
FaceBook_AddFromWall_Add_Step1_Code = FaceBook_AddFromWall_Add_Step1_Code+"FILTER TYPE=IMAGES STATUS=OFF" + jsNewLine;
FaceBook_AddFromWall_Add_Step1_Code = FaceBook_AddFromWall_Add_Step1_Code+"WAIT SECONDS=1";
/********* End Add - Step1: Press "Add As Friend" *********/
/********* Begin Add - Step2: Fill the forms *********/
var FaceBook_AddFromWall_Add_Step2_Code;
FaceBook_AddFromWall_Add_Step2_Code = "CODE:";
FaceBook_AddFromWall_Add_Step2_Code = FaceBook_AddFromWall_Add_Step2_Code+"SET !ERRORIGNORE YES" + jsNewLine;
FaceBook_AddFromWall_Add_Step2_Code = FaceBook_AddFromWall_Add_Step2_Code+"SET !TIMEOUT 15" + jsNewLine;
// Insert Message
if(mobInviteMessage!=""){
FaceBook_AddFromWall_Add_Step2_Code = FaceBook_AddFromWall_Add_Step2_Code+"TAG POS=1 TYPE=A ATTR=TXT:Add<SP>a<SP>personal<SP>message*" + jsNewLine;
//FaceBook_AddFromWall_Add_Step2_Code = FaceBook_AddFromWall_Add_Step2_Code+"WAIT SECONDS=1"+ jsNewLine;
FaceBook_AddFromWall_Add_Step2_Code = FaceBook_AddFromWall_Add_Step2_Code+"TAG POS=1 TYPE=TEXTAREA ATTR=ID:message CONTENT=" + mobInviteMessage + jsNewLine;
}
// Select Friendlist
if(mobFriendList!=""){
//FaceBook_AddFromWall_Add_Step2_Code = FaceBook_AddFromWall_Add_Step2_Code+"TAG POS=1 TYPE=SELECT FORM=NAME:NoFormName ATTR=ID:add_to_friend_list_widget_select_* CONTENT=$" + mobFriendList + jsNewLine;
FaceBook_AddFromWall_Add_Step2_Code = FaceBook_AddFromWall_Add_Step2_Code+"TAG POS=1 TYPE=SPAN ATTR=BINDPOINT:main&&CLASS:UIActionMenu_Main" + jsNewLine;
FaceBook_AddFromWall_Add_Step2_Code = FaceBook_AddFromWall_Add_Step2_Code+"TAG POS=1 TYPE=A ATTR=CLASS:UICheckList_Label CONTENT=" + mobFriendList + jsNewLine;
//FaceBook_AddFromWall_Add_Step2_Code = FaceBook_AddFromWall_Add_Step2_Code+"TAG POS=1 TYPE=INPUT:TEXT ATTR=CLASS:inputtext FriendAddingTool_CreateNewList CONTENT=" + mobFriendList + jsNewLine;
}
// Press Add Button
FaceBook_AddFromWall_Add_Step2_Code = FaceBook_AddFromWall_Add_Step2_Code+"TAG POS=1 TYPE=INPUT:BUTTON ATTR=ID:dialog_button1" + jsNewLine;
FaceBook_AddFromWall_Add_Step2_Code = FaceBook_AddFromWall_Add_Step2_Code+"FILTER TYPE=IMAGES STATUS=OFF" + jsNewLine;
FaceBook_AddFromWall_Add_Step2_Code = FaceBook_AddFromWall_Add_Step2_Code+"WAIT SECONDS=2";
/********* End Add - Step2: Fill the forms *********/
/********* Begin Close Box *********/
var FaceBook_AddFromWall_Close_Code;
FaceBook_AddFromWall_Close_Code = "CODE:";
FaceBook_AddFromWall_Close_Code = FaceBook_AddFromWall_Close_Code+"SET !ERRORIGNORE YES" + jsNewLine;
FaceBook_AddFromWall_Close_Code = FaceBook_AddFromWall_Close_Code+"SET !TIMEOUT 15" + jsNewLine;
FaceBook_AddFromWall_Close_Code = FaceBook_AddFromWall_Close_Code+"TAG POS=1 TYPE=INPUT:BUTTON ATTR=NAME:close&&VALUE:Close" + jsNewLine;
FaceBook_AddFromWall_Close_Code = FaceBook_AddFromWall_Close_Code+"FILTER TYPE=IMAGES STATUS=OFF" + jsNewLine;
FaceBook_AddFromWall_Close_Code = FaceBook_AddFromWall_Close_Code+"WAIT SECONDS=2";
/********* End Close Box *********/
/********* Begin Internal JavaScript Code *********/
var i1=0;
var i2=0;
var i3=0;
var i4=0;
var j=0;
var p=0;
for(p=startPage;p>=0;p--){
iimSet ("-var_PageNumber", p);
i1 = iimPlay(FaceBook_AddFromWall_Pages_Code);
for(j=0;j<20;j++){
iimSet ("-var_LinkNumber", j*2+1);
i2 = iimPlay(FaceBook_AddFromWall_Links_Code);
if (i2 >= 0) {
iimSet ("-var_LinkNumber", j);
i3 = iimPlay(FaceBook_AddFromWall_Add_Step1_Code);
if(i3 >= 0)
i4 = iimPlay(FaceBook_AddFromWall_Add_Step2_Code);
}else{
break;
}
}
}
function addImacrosSpace(str){
str = str.replace(/ /g, "<SP>");
return str;
}
/********* End Internal JavaScript Code *********/
/********* End Code*********/
/********* By Soroush Dalili March-2009 Soroush.SecProject.Com *********/

Twitter
LinkedIn
I’d recommend to anyone using this that they set the repeat for no more then about 20-30 friend-adds at a time. Any more then that and it can trigger spam-protection measures on Facebook itself and lock out your ability to add friends.
This happened to my wife and it was about a week before things returned to normal. This set her back considerably with adding friends.
hi, thanks for your job..
i cant use your nice script i dont know why
i use italian facebook page, can be for this?
i write my mobilenumber on facebok and now dont have the problem of digit CHPA
can you help me please?
i want to add all contacts of this application:
http://www.facebook.com/profile.php?id=1399635330&v=info&viewas=1399635330#/apps/application.php?id=39875386029&ref=s
wait your azware
thank you very much
I cannot solve this problem as my facebook is in English format. But, I know that you must change the captions in my script to your Italian language.
Wherever you see “TXT:” in my script, you must change the text after, to its Italian form. I do not think that you need to do the same for “NAME:” because you must check the html code then.
For example:
“TXT:Addapersonalmessage*”
must be changed to
“TXT:YourItalianMessage*”
do not forget to put instead of all the space characters ;)
I hope it works for you.
By new update:
This code is compatible with the new Facebook (March 2009)
nice code thanks.
i have a question, i’m trying to say “add me” or something on the wall but imacros won’t let me send the text.. here’s what i record modified with a wildcard(*):
TAB T=1
URL GOTO=http://apps.facebook.com/guerra-de-pandillas/discussion.php
TAG POS=1 TYPE=TEXTAREA FORM=ACTION:http://www.facebook.com/wallpost.php ATTR=ID:wall_text_* CONTENT=ADDME
imacros fills the textarea but it won’t press the send button.. what am i doing wrong?
thanks in advance
Thanks for this nice script
Could you make oen for adding friends of friends too or members of a grupe .
woud be too great ;-)
One question woud be what are the FB limits of adding not too much Friends at one time .Get a abused account
Thanks for sharing this