<?xml version="1.0" encoding="UTF-8"?>
<post>
  <body>@@ -3,29 +3,35 @@
 // @namespace      Mobwars friends.
 // @description    Creates a link on the fight page that pops up a window for each member in the fight page to add them to your friends.
 // @include        http://apps.facebook.com/mobwars/fight/
+// @include http://apps.new.facebook.com/mobwars/fight/
 // @include        http://www.facebook.com/addfriend.php?id=*
 // ==/UserScript==
 
-function openInvites (ele) {
- document.getElementById('invites').innerHTML = document.getElementById('invites').innerHTML +
- ele.replace(/mobwars\/profile\/\?user_id=/,'http://www.facebook.com/addfriend.php?id=') + &quot;\n&quot;;
-}
+function openInvites (ele) { GM_openInTab(ele.replace(/mobwars\/profile\/\?user_id=/,'http://www.facebook.com/addfriend.php?id=')); }
 
 if (document.getElementsByTagName('title')[0].innerHTML == &quot;Facebook | Mob Wars&quot;) {
- var addLink = document.getElementsByTagName('h1')[0];
- addLink.innerHTML = addLink.innerHTML + '&lt;span style=&quot;display:none;&quot; id=&quot;invites&quot;&gt;&lt;/div&gt;';
-
- var MyID = document.getElementById('navigator').getElementsByTagName('a')[0].href.match(/id=([0-9]+)/)[1];
 	var MobsTable = document.getElementsByTagName('table')[1].innerHTML;
-
 	var MobsArray = MobsTable.match(/mobwars\/profile\/\?user_id=\d+/g);
- MobsArray.forEach(openInvites);
 	
- alert(document.getElementById('invites').innerHTML);
+ if (confirm('Do you want to open invite windows?'))
+ MobsArray.forEach(openInvites);
 }
 if (document.getElementsByTagName('title')[0].innerHTML == &quot;Facebook | Add Friend&quot;) {
 	document.getElementById('addMsgBox').style.display = 'block';
 	document.getElementById('addMsg').style.display = 'none';
 	document.getElementById('message').innerHTML = 'mobwars, I have no invites left, invite me for the cash :)';
 	document.getElementsByTagName('select')[0].options[1].selected = true;
+
+ document.getElementsByTagName('form')[1].submit();
 }
\ No newline at end of file
+
+
+var version_timestamp = 1217619766628;
+/***
+ * Function: Script Update Checker
+ *
+ * Description:
+ * Script Update Checker (http://userscripts.org/scripts/show/20145)
+ * written by Jarett (http://userscripts.org/users/38602).
+ */
+function updateCheck(forced){if((forced)||(parseInt(GM_getValue(&quot;lastUpdate&quot;,&quot;0&quot;))+86400000&lt;=(new Date().getTime()))){try{GM_xmlhttpRequest({method:&quot;GET&quot;,url:&quot;http://userscripts.org/scripts/review/30725?&quot;+new Date().getTime(),headers:{'Cache-Control':'no-cache'},onload:function(xhrResponse){GM_setValue(&quot;lastUpdate&quot;,new Date().getTime()+&quot;&quot;);var rt=xhrResponse.responseText.replace(/&amp;nbsp;?/gm,&quot; &quot;).replace(/&lt;li&gt;/gm,&quot;\n&quot;).replace(/&lt;[^&gt;]*&gt;/gm,&quot;&quot;);var scriptName=(/@name\s*(.*?)\s*$/m.exec(rt))[1];GM_setValue(&quot;targetScriptName&quot;,scriptName);if(parseInt(/version_timestamp\s*=\s*([0-9]+)/.exec(rt)[1])&gt;version_timestamp){if(confirm(&quot;There is an update available for the Greasemonkey script \&quot;&quot;+scriptName+&quot;.\&quot;\nWould you like to go to the install page now?&quot;)){GM_openInTab(&quot;http://userscripts.org/scripts/show/30725&quot;);}}else if(forced){alert(&quot;No update is available for \&quot;&quot;+scriptName+&quot;.\&quot;&quot;);}}});}catch(err){if(forced){alert(&quot;An error occurred while checking for updates:\n&quot;+err);}}}}GM_registerMenuCommand(GM_getValue(&quot;targetScriptName&quot;,&quot;???&quot;)+&quot; - Manual Update Check&quot;,function(){updateCheck(true);});updateCheck(false);
\ No newline at end of file</body>
  <body-html>&lt;p&gt;@@ -3,29 +3,35 @@
&lt;br /&gt; // @namespace      Mobwars friends.
&lt;br /&gt; // @description    Creates a link on the fight page that pops up a window for each member in the fight page to add them to your friends.
&lt;br /&gt; // @include        &lt;a href=&quot;http://apps.facebook.com/mobwars/fight/&quot;&gt;http://apps.facebook.com/mobwars/fight/&lt;/a&gt;
&lt;br /&gt;+// @include &lt;a href=&quot;http://apps.new.facebook.com/mobwars/fight/&quot;&gt;http://apps.new.facebook.com/mobwars/fight/&lt;/a&gt;
&lt;br /&gt; // @include        &lt;a href=&quot;http://www.facebook.com/addfriend.php?id&quot;&gt;http://www.facebook.com/addfriend.php?id&lt;/a&gt;=*
&lt;br /&gt; // ==/UserScript==
&lt;br /&gt; 
&lt;br /&gt;-function openInvites (ele) {
&lt;br /&gt;- document.getElementById('invites').innerHTML = document.getElementById('invites').innerHTML +
&lt;br /&gt;- ele.replace(/mobwars\/profile\/\?user_id=/,'http://www.facebook.com/addfriend.php?id=') + &quot;\n&quot;;
&lt;br /&gt;-}
&lt;br /&gt;+function openInvites (ele) { GM_openInTab(ele.replace(/mobwars\/profile\/\?user_id=/,'http://www.facebook.com/addfriend.php?id=')); }
&lt;br /&gt; 
&lt;br /&gt; if (document.getElementsByTagName('title')[0].innerHTML == &quot;Facebook | Mob Wars&quot;) {
&lt;br /&gt;- var addLink = document.getElementsByTagName('h1')[0];
&lt;br /&gt;- addLink.innerHTML = addLink.innerHTML + '&lt;span&gt;';
&lt;br /&gt;-
&lt;br /&gt;- var MyID = document.getElementById('navigator').getElementsByTagName('a')[0].href.match(/id=([0-9]+)/)[1];
&lt;br /&gt; 	var MobsTable = document.getElementsByTagName('table')[1].innerHTML;
&lt;br /&gt;-
&lt;br /&gt; 	var MobsArray = MobsTable.match(/mobwars\/profile\/\?user_id=\d+/g);
&lt;br /&gt;- MobsArray.forEach(openInvites);
&lt;br /&gt; 	
&lt;br /&gt;- alert(document.getElementById('invites').innerHTML);
&lt;br /&gt;+ if (confirm('Do you want to open invite windows?'))
&lt;br /&gt;+ MobsArray.forEach(openInvites);
&lt;br /&gt; }
&lt;br /&gt; if (document.getElementsByTagName('title')[0].innerHTML == &quot;Facebook | Add Friend&quot;) {
&lt;br /&gt; 	document.getElementById('addMsgBox').style.display = 'block';
&lt;br /&gt; 	document.getElementById('addMsg').style.display = 'none';
&lt;br /&gt; 	document.getElementById('message').innerHTML = 'mobwars, I have no invites left, invite me for the cash :)';
&lt;br /&gt; 	document.getElementsByTagName('select')[0].options[1].selected = true;
&lt;br /&gt;+
&lt;br /&gt;+ document.getElementsByTagName('form')[1].submit();
&lt;br /&gt; }
&lt;br /&gt;\ No newline at end of file
&lt;br /&gt;+
&lt;br /&gt;+
&lt;br /&gt;+var version_timestamp = 1217619766628;
&lt;br /&gt;+/***
&lt;br /&gt;+ * Function: Script Update Checker
&lt;br /&gt;+ *
&lt;br /&gt;+ * Description:
&lt;br /&gt;+ * Script Update Checker (&lt;a href=&quot;http://userscripts.org/scripts/show/20145&quot;&gt;http://userscripts.org/scripts/show/20145&lt;/a&gt;)
&lt;br /&gt;+ * written by Jarett (&lt;a href=&quot;http://userscripts.org/users/38602&quot;&gt;http://userscripts.org/users/38602&lt;/a&gt;).
&lt;br /&gt;+ */
&lt;br /&gt;+function updateCheck(forced){if((forced)||(parseInt(GM_getValue(&quot;lastUpdate&quot;,&quot;0&quot;))+86400000&amp;lt;=(new Date().getTime()))){try{GM_xmlhttpRequest({method:&quot;GET&quot;,url:&quot;http://userscripts.org/scripts/review/30725?&quot;+new Date().getTime(),headers:{'Cache-Control':'no-cache'},onload:function(xhrResponse){GM_setValue(&quot;lastUpdate&quot;,new Date().getTime()+&quot;&quot;);var rt=xhrResponse.responseText.replace(/&amp;nbsp;?/gm,&quot; &quot;).replace(/&lt;li&gt;/gm,&quot;\n&quot;).replace(/&amp;lt;[^&gt;]*&gt;/gm,&quot;&quot;);var scriptName=(/@name\s*(.*?)\s*$/m.exec(rt))[1];GM_setValue(&quot;targetScriptName&quot;,scriptName);if(parseInt(/version_timestamp\s*=\s*([0-9]+)/.exec(rt)[1])&gt;version_timestamp){if(confirm(&quot;There is an update available for the Greasemonkey script \&quot;&quot;+scriptName+&quot;.\&quot;\nWould you like to go to the install page now?&quot;)){GM_openInTab(&quot;http://userscripts.org/scripts/show/30725&quot;);}}else if(forced){alert(&quot;No update is available for \&quot;&quot;+scriptName+&quot;.\&quot;&quot;);}}});}catch(err){if(forced){alert(&quot;An error occurred while checking for updates:\n&quot;+err);}}}}GM_registerMenuCommand(GM_getValue(&quot;targetScriptName&quot;,&quot;???&quot;)+&quot; - Manual Update Check&quot;,function(){updateCheck(true);});updateCheck(false);
&lt;br /&gt;\ No newline at end of file&lt;/li&gt;&lt;/span&gt;&lt;/p&gt;</body-html>
  <created-at type="datetime">2008-12-15T18:46:42Z</created-at>
  <forumable-id type="integer">30725</forumable-id>
  <forumable-type>Script</forumable-type>
  <id type="integer">83738</id>
  <topic-id type="integer">17891</topic-id>
  <updated-at type="datetime">2008-12-15T18:46:42Z</updated-at>
  <user-agent nil="true"></user-agent>
  <user-id type="integer">42117</user-id>
</post>
