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.

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.

Install Ruby:
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:
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:
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 ( The error message when the network is off does not show any link on the iPhone.

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.