Monday, July 12, 2010

Scripting iMobster


Hi, there..
I've been running this little script on my PC for a while now and decided to make it public.. let's see if storm8 doesn't get too upset.

What does it do?

Well, currently I have functions that allow you to:
IMob.deposit(amount): Deposits a specific amount of money
IMob.depositall(): Deposit all your money (nice to have running as a crontab task over the night, making sure you never loose any cash)
IMob.buyBestDeal(): Why use real estate calculators? This function will automatically do the math and buy in the best deal (as long as your wallet [i.e. not including the bank] money is enough to do so)
IMob.withdraw(amount): Takes money from the bank to the wallet.
IMob.inviteMob(mobcode): Invites a person to your mob.. nice to have.. if you can process the HTML from any of the IMobsters listings on the internet, then it's possible to simply invite a list of thousands of players to join your mob.
spendAllMoneyOnRealEstate(IMob): With this little tool you can spend all your money in a smart way, it will keep buying the best deals in real estate until you cannot buy any more the best deal.

Others:
getNextNetIncome(): Time in seconds until you get your next income.
getWalletMoney(): Money in the wallet..
getNetIncome(): Returns your net income (after deducting the upkeep)
getBankMoney(): Returns the money in your bank..


And finally:
processPage(url,content=nil): This litle function is the core of the script and allows you to parse any page, submit any request or both.


Installation
Install Ruby: http://www.ruby-lang.org
Edit the file and update your UDID.
Run the script via Ruby: ruby imob_v001.rb


How to find my UDID?
On Android: Turn of your network, start IMobsters. An error message will appear with a link, something like: http://im.storm8.com/apoints.php?fpts=12&version=a.1.34&udid=223acbbcb1234c3ba1c&pf=acb1cbc33bac4bcb23122b687
Only the text in italic-bold of the link about is of interest. Take it and replace it on the line at the top of the script saying:
PAGE="/apoints.php?fpts=12&version=a.1.54&udid=200145745b874941&pf=7761ad4efac1dc9e6b87a016d4e1d0dc"
That's it! Now you can use the script. :)

On iPhone: No idea.. probably you'll have to sniff the network for a like the above (http://im.storm8.com/apoints.php?....). The error message when the network is off does not show any link on the iPhone.

Testing:
You can run the script as it comes, it will simply printout some of your player's specific info.

Download: click here

Have fun, and be kind to share any upgrades you may add to this script.