<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Discussions on scripts by Piotr P. Karwasz | Userscripts.org</title>
    <description>Recent posts on all scripts by Piotr P. Karwasz at userscripts.org</description>
    <link>http://userscripts.org/users/49912/scripts</link>
    <language>en-us</language>
    <ttl>60</ttl>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by J. M. Coward</title>
      <description>&lt;p&gt;There used to be a switch/case section that would let the script get the hero stats (money, health, energy, &amp;amp;c.); I commented out most of it and replaced it with the following:
&lt;br /&gt;&lt;pre&gt;
/* Other data */
  /* Cash */
  var cash_span = document.getElementById('app8743457343_cur_cash');
  var re = /\$([0-9]+)/;
  var result = cash_span.innerHTML.replace(&quot;,&quot;,&quot;&quot;,&quot;gi&quot;).match(re);
  this.cash = parseInt(result[1]);
  /* Health */
  var health_span = document.getElementById('app8743457343_cur_health');
  this.health = parseInt(health_span.innerHTML);
  var max_health_str = health_span.parentNode.innerHTML;
  max_health_str = stringCleaner(max_health_str);
  re = /\/([0-9]+)/;
  result = max_health_str.match(re);
  this.max_health = parseInt(result[1]);
  /* Energy */
  var energy_span = document.getElementById('app8743457343_cur_energy');
  this.energy = parseInt(energy_span.innerHTML);
  var max_energy_str = energy_span.parentNode.innerHTML;
  max_energy_str = stringCleaner(max_energy_str);
  result = max_energy_str.match(re);
  this.max_energy = parseInt(result[1]);
  /* Stamina */
  var stamina_span = document.getElementById('app8743457343_cur_recovery');
  this.stamina = parseInt(stamina_span.innerHTML);
  var max_stamina_str = stamina_span.parentNode.innerHTML;
  max_stamina_str = stringCleaner(max_stamina_str);
  result = max_stamina_str.match(re);
  this.max_stamina = parseInt(result[1]);
  /* Experience */
  var exp_div = document.getElementById('app8743457343_cur_experience');
  var exp_str = exp_div.innerHTML;
  exp_str = stringCleaner(exp_str);
  re = /Exp: ([0-9]+)\/?([0-9]+)?/;
  result = exp_str.match(re);
  this.exp = parseInt(result[1]);
  /* Level */
  re = /Level: ([0-9]+)/;
  result = exp_str.match(re);
  if (this.level != parseInt(result[1])) this.new_level = 1;
  this.level = parseInt(result[1]);
&lt;/pre&gt;
&lt;br /&gt;It's not at all optimized; it's a quick hack I threw together to make sure I could still do NYC jobs.
&lt;br /&gt;It references a stringCleaner function that cleans up the HTML for regex parsing:
&lt;br /&gt;&lt;pre&gt;
function stringCleaner(str) {
  str = str.replace(/&amp;lt;[^&gt;]*&gt;/g, '');
  str = str.replace(/[, \t]/g,'');
  str = str.replace(/\r|\n|\r\n/g, '');
  str = str.replace(&quot;&amp;amp;nbsp;&quot;, &quot; &quot;, &quot;gi&quot;);
  return str;
}
&lt;/pre&gt;&lt;/p&gt;</description>
      <pubDate>Sat, 22 Aug 2009 17:14:40 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:161508</guid>
      <author>J. M. Coward</author>
      <link>http://userscripts.org/posts/161508</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by nicegirl99</title>
      <description>&lt;p&gt;Mine does the hitlisting pretty well and only recently stopped doing the autopurchases because it can't see the cash anymore. It doesn't seem to see the energy either so it has stopped doing jobs.&lt;/p&gt;</description>
      <pubDate>Sat, 22 Aug 2009 02:32:16 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:161253</guid>
      <author>nicegirl99</author>
      <link>http://userscripts.org/posts/161253</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by J. M. Coward</title>
      <description>&lt;p&gt;Mine is *barely* working. It can do NYC jobs, and that's about it. I'm hoping to take some time to update to that January greasemonkey release, as Firefox 3.5 is out now, and I'd like to use it.&lt;/p&gt;</description>
      <pubDate>Mon, 17 Aug 2009 13:42:16 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:159332</guid>
      <author>J. M. Coward</author>
      <link>http://userscripts.org/posts/159332</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by thienz</title>
      <description>&lt;p&gt;Does anyone still using this script or made changes so it would work halfway?&lt;/p&gt;</description>
      <pubDate>Sun, 09 Aug 2009 21:16:57 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:156437</guid>
      <author>thienz</author>
      <link>http://userscripts.org/posts/156437</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by Kevinharbin</title>
      <description>&lt;p&gt;[quote]Is anybody having a problem loading the Druid's script after activating the FB username feature?[/quote]&lt;/p&gt;

&lt;p&gt;YES! That's exactly when it stopped loading. I haven't found a solution to it either.&lt;/p&gt;</description>
      <pubDate>Fri, 26 Jun 2009 15:25:41 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:138789</guid>
      <author>Kevinharbin</author>
      <link>http://userscripts.org/posts/138789</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by Piotr P. Karwasz</title>
      <description>&lt;p&gt;&amp;lt;quote&gt;As another note of good news, the original author of the script has sent me message as a request for me to simply send him the updates to the script and he will update the core. So I will start doing that once I stop being lazy and get around to fixing the city auto buy and the quick heal.&amp;lt;/quote&gt;&lt;/p&gt;

&lt;p&gt;Haven't received anything from TheDruidsKeeper yet, but maybe I can find some time to update the script.&lt;/p&gt;</description>
      <pubDate>Tue, 23 Jun 2009 19:31:46 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:137289</guid>
      <author>Piotr P. Karwasz</author>
      <link>http://userscripts.org/posts/137289</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by program3rror</title>
      <description>&lt;p&gt;Is anybody having a problem loading the Druid's script after activating the FB username feature?&lt;/p&gt;

&lt;p&gt;While I'm here, wicked script, thanks for all the hard work Druid....&lt;/p&gt;</description>
      <pubDate>Wed, 17 Jun 2009 20:17:00 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:134648</guid>
      <author>program3rror</author>
      <link>http://userscripts.org/posts/134648</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by TheDruidsKeeper</title>
      <description>&lt;p&gt;@J.M.
&lt;br /&gt;To get the timer to work I basically cheated: in the timer function that the entire script uses (look for &lt;code&gt;Timer.start = function...&lt;/code&gt; when the timer is up it checks if the action is an object, if so it 'clicks' it: &lt;code&gt;next_page.click();&lt;/code&gt;. That is where the problem was occurring with the Ajax implementations (since the page would no longer refresh), so I added this line: &lt;code&gt;setTimeout(Timer.start, 5000, window.location.href, message, timer);&lt;/code&gt; to manually refresh the page after 5 seconds in case it hasn't already happened.&lt;/p&gt;

&lt;p&gt;@SoulKeeper
&lt;br /&gt;The search script I wrote on page 3 (&lt;a href=&quot;http://userscripts.org/topics/18417?page=3#posts-95759&quot;&gt;http://userscripts.org/topics/18417?page=3#post...&lt;/a&gt;) looks like it still works just fine for me, but just in case I will increase the time between searches from 0 - 60 seconds to 30 - 90 seconds to see if that has better success. Let me know if this works or if a bigger range is needed.&lt;/p&gt;

&lt;p&gt;I haven't gotten around to fixing the quick heal yet, but you're right it is broken. I'm sure it is just some xpaths that are messed up from the changes, it's just a difficult mod to fix since it is all done via ajax.&lt;/p&gt;

&lt;p&gt;As another note of good news, the original author of the script has sent me message as a request for me to simply send him the updates to the script and he will update the core. So I will start doing that once I stop being lazy and get around to fixing the city auto buy and the quick heal.&lt;/p&gt;</description>
      <pubDate>Sat, 30 May 2009 18:18:30 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:127367</guid>
      <author>TheDruidsKeeper</author>
      <link>http://userscripts.org/posts/127367</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by SoulKeeper</title>
      <description>&lt;p&gt;Just a heads up to those who use the search script!!!&lt;/p&gt;

&lt;p&gt;Is not working anymore, they know when you do it. You will loose any searches left for the rest of the day.&lt;/p&gt;</description>
      <pubDate>Thu, 28 May 2009 01:30:50 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:126521</guid>
      <author>SoulKeeper</author>
      <link>http://userscripts.org/posts/126521</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by J. M. Coward</title>
      <description>&lt;p&gt;@TheDruidsKeeper, what did you change to get the timer to work?&lt;/p&gt;</description>
      <pubDate>Tue, 26 May 2009 21:01:44 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:126080</guid>
      <author>J. M. Coward</author>
      <link>http://userscripts.org/posts/126080</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by SoulKeeper</title>
      <description>&lt;p&gt;Is it just me or the Quickheal is not working anymore?&lt;/p&gt;</description>
      <pubDate>Sun, 17 May 2009 03:33:14 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:122450</guid>
      <author>SoulKeeper</author>
      <link>http://userscripts.org/posts/122450</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by TheDruidsKeeper</title>
      <description>&lt;p&gt;I disabled the extra row of links since I realized that the original links are back to normal.&lt;/p&gt;</description>
      <pubDate>Fri, 08 May 2009 12:45:01 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:119139</guid>
      <author>TheDruidsKeeper</author>
      <link>http://userscripts.org/posts/119139</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by Twangy</title>
      <description>&lt;p&gt;Cheers Druid, you`re a star! I`ll play around with the settings on the auto buy, it is probably just something I`m doing wrong!&lt;/p&gt;</description>
      <pubDate>Thu, 07 May 2009 08:09:03 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:118678</guid>
      <author>Twangy</author>
      <link>http://userscripts.org/posts/118678</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by TheDruidsKeeper</title>
      <description>&lt;p&gt;OK, i modified the timer on the script so that it will refresh the page and keep going after property purchases / job actions.&lt;/p&gt;

&lt;p&gt;@Twangy I'm not sure what is causing the &quot;Hokey Cokey&quot;, but I would recommend either turning of auto deposit, or turn off &quot;using money from bank&quot;.&lt;/p&gt;

&lt;p&gt;Also, since I've been experiencing a huge lack of time, I haven't had the chance to update the auto city buy mod yet for the new property categories. Anyone can feel free to get it working with them and post the changes so I can put them into the script though. :)&lt;/p&gt;</description>
      <pubDate>Thu, 07 May 2009 07:20:52 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:118662</guid>
      <author>TheDruidsKeeper</author>
      <link>http://userscripts.org/posts/118662</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by Twangy</title>
      <description>&lt;p&gt;I`m really struggling since the latest changes to Mob Wars. The script only seems to work with a bit of prompting (changing pages) and the property buyer has been switched off as it keeps withdrawing money from the bank then putting it back in, then out, then in, its like the Mob Wars Hokey Cokey!&lt;/p&gt;

&lt;p&gt;Is anyone else experiencing the same problems? Another one is that Mean bank Loss, Upkeep and Total are all red and minus!&lt;/p&gt;

&lt;p&gt;I did try reinstalling the older Firefox but thats not cured anything!&lt;/p&gt;

&lt;p&gt;HELP !!!!!!!!&lt;/p&gt;</description>
      <pubDate>Wed, 06 May 2009 11:32:26 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:118351</guid>
      <author>Twangy</author>
      <link>http://userscripts.org/posts/118351</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by thienz</title>
      <description>&lt;p&gt;How about to refresh the page after doing a job? In the actual site layout, after doing job the page stays with the result and the Script Status stays at &quot;Doing &amp;lt;job&gt;... in 0s&quot;&amp;lt;/job&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 06 May 2009 05:55:35 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:118320</guid>
      <author>thienz</author>
      <link>http://userscripts.org/posts/118320</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by TheDruidsKeeper</title>
      <description>&lt;p&gt;Oh the duplicate menu is a &quot;feature&quot; I add added into the script to help with backwards compatibility. By using the bottom menu to go to the different pages it allows the script to update the different quantities. Plus it helps with other scripts like an auto fighter, my mobster invite script, or my no longer working hitlist bot :-/&lt;/p&gt;</description>
      <pubDate>Tue, 05 May 2009 18:10:24 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:118120</guid>
      <author>TheDruidsKeeper</author>
      <link>http://userscripts.org/posts/118120</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by SoulKeeper</title>
      <description>&lt;p&gt;That Did it! Thanks Druids!!&lt;/p&gt;

&lt;p&gt;I still have the duplicated menu, but I can live with that&lt;/p&gt;</description>
      <pubDate>Tue, 05 May 2009 04:09:05 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:117920</guid>
      <author>SoulKeeper</author>
      <link>http://userscripts.org/posts/117920</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by TheDruidsKeeper</title>
      <description>&lt;p&gt;install an older version of greasemonkey. The newer version does not work. I think the latest working version with this script is 0.8.20080609.0&lt;/p&gt;</description>
      <pubDate>Tue, 05 May 2009 00:36:38 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:117901</guid>
      <author>TheDruidsKeeper</author>
      <link>http://userscripts.org/posts/117901</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by SoulKeeper</title>
      <description>&lt;p&gt;Maybe it's my installation of FireFox (I updated it) but the script is not working anymore. I already tried uninstsalling firefox + greasemonkey + the script but the script is showing this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;-Script status-
&lt;br /&gt;Cash	$24,089,992,172
&lt;br /&gt;Bank account	$0
&lt;br /&gt;City value	$0
&lt;br /&gt;Stock value	$0
&lt;br /&gt;Total	$24,089,992,172
&lt;br /&gt; 
&lt;br /&gt;City income	$0
&lt;br /&gt;Mean job payout	$0
&lt;br /&gt;Mean bank loss	$0
&lt;br /&gt;Upkeep	$0
&lt;br /&gt;Total	$0
&lt;br /&gt; 
&lt;br /&gt;Attack Strength	NaN
&lt;br /&gt;Defense Strength	NaN&lt;/p&gt;

&lt;p&gt;Status:
&lt;br /&gt;Resting...
&lt;br /&gt;Enable Quickheal&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;when I hit the &quot;Script Preferences&quot; Button All I get is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Script Preferences
&lt;br /&gt;Update preferences&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and my mob wars menu is duplicated:&lt;/p&gt;

&lt;p&gt;Home Jobs City Stockpile Fight Hitlist Godfather (64)  	My Mob (1091)
&lt;br /&gt;Home jobs  city stockpile fight hitlist godfather	   mob&lt;/p&gt;</description>
      <pubDate>Mon, 04 May 2009 18:48:35 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:117780</guid>
      <author>SoulKeeper</author>
      <link>http://userscripts.org/posts/117780</link>
    </item>
    <item>
      <title>Mobwars Page Layout Changed, replied by newb5000</title>
      <description>&lt;p&gt;New jobs weren't showing up for me in the preferences screen (I just unlocked a new job by reaching a new level).&lt;/p&gt;

&lt;p&gt;I had to replace the following:
&lt;br /&gt;&lt;pre&gt;
      /* Drops */
      tmp = div.innerHTML.match(/(\d+\%)/);
&lt;/pre&gt;
&lt;br /&gt;with this:
&lt;br /&gt;&lt;pre&gt;
      /* Drops */
      tmp = div.innerHTML.match(/(\(\d+\%\))/);
&lt;/pre&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 03 May 2009 22:18:12 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:21972:117511</guid>
      <author>newb5000</author>
      <link>http://userscripts.org/posts/117511</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by TheDruidsKeeper</title>
      <description>&lt;p&gt;The urls for the item images changed, so the regex had to change too:
&lt;br /&gt;&lt;pre&gt;
tmp.match(/(jobs|stockpile|city)[\/\?a-z_=&amp;amp;0-9]+#(item_\d+)/);
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;Script has been fixed once again.&lt;/p&gt;

&lt;p&gt;I have also taken the liberty to add alternate links that can be used to navigate to the different pages just as before, since their changes to the links have caused failure with other scripts.&lt;/p&gt;</description>
      <pubDate>Sat, 25 Apr 2009 17:16:43 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:114700</guid>
      <author>TheDruidsKeeper</author>
      <link>http://userscripts.org/posts/114700</link>
    </item>
    <item>
      <title>Script mods from TheDruidsKeeper, replied by thienz</title>
      <description>&lt;p&gt;layout changes again this morning.. please update the script again! :)&lt;/p&gt;

&lt;p&gt;thx in advance! :)&lt;/p&gt;</description>
      <pubDate>Sat, 25 Apr 2009 13:33:43 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:18417:114656</guid>
      <author>thienz</author>
      <link>http://userscripts.org/posts/114656</link>
    </item>
    <item>
      <title>Mobwars Page Layout Changed, replied by J. M. Coward</title>
      <description>&lt;p&gt;japes, you're not going to like the answer to that. I've been clinging to the original script, old schooler that I am. I've glanced at the new stuff in both those scripts, but since I prefer to handle fighting myself, and I agreed with Piotr's original insistence in not having an auto-hitlister, I've been updating his script since October. I've added some tweaks of my own (I occasionally sell undeveloped land, so I want the max number of properties I can sell in the sell box to be 10 instead of 1, &amp;amp;c.).&lt;/p&gt;

&lt;p&gt;Thus, I'm unfamiliar with specifics of how those scripts work. I *am* considering a switch to take advantage of the up-to-date Greasemonkey features. I ported my modified version of Piotr's script to a largely incompatible FB app, so I'll have to make sure that I can port either the ++ or the * script before making the switch final.&lt;/p&gt;</description>
      <pubDate>Wed, 22 Apr 2009 19:17:55 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:21972:113773</guid>
      <author>J. M. Coward</author>
      <link>http://userscripts.org/posts/113773</link>
    </item>
    <item>
      <title>Mobwars Page Layout Changed, replied by fart man</title>
      <description>&lt;p&gt;J.M. COWARD i undertsnad your directions, im applying the fix now. ill let ya know how it works for me. is this fix for fbmw* or fbmw++?&lt;/p&gt;</description>
      <pubDate>Mon, 20 Apr 2009 02:40:18 +0000</pubDate>
      <guid isPermaLink="false">userscripts.org:21972:112694</guid>
      <author>fart man</author>
      <link>http://userscripts.org/posts/112694</link>
    </item>
  </channel>
</rss>
