Using the Bank with apps

1 view
Skip to first unread message

Elliot Conte

unread,
Aug 1, 2011, 4:01:18 PM8/1/11
to emerso...@googlegroups.com
Ok.  Here are updated versions of bankserver and state which should better handle asynchronous trades and entities without simulators.  

Then I included another file, bankConnect.em.  I wrote this up to make interacting with the bank super easy.

Here are the steps:
1.  On the entity you want to connect click on the bank and press enter.  
2.  system.require('std/bankConnect.em'); or wherever you have the file.  

Take note of a couple areas of the bankConnect file.  
BANKNAME and BANKPWORD are defined at the beginning and should be set to whatever you want your bank account name to appear as when trading with users/logging in.

At the bottom of the file is a place marked "DO STUFF".  Right here is where the code gets if the client has indeed paid the 10 neo shekels for your service (or however much it charges).  Here is where you would probably want to call whatever function sends over code/apps to the client or starts the service.  It means you have successfully been paid.  

Things I will work on adding:

- Automatic detection of the bank to eliminate step 1.  
-Instead of the "DO STUFF' marked area I should just have an easily definable callback function this whole thing takes instead.  But both are pretty minor changes and all the core functionality is there right now if you want to work on integrating something.
bankConnect.em
bankserver.em
state.em

Elliot Conte

unread,
Aug 1, 2011, 5:07:44 PM8/1/11
to emerso...@googlegroups.com
Updated:

bankConnect now automatically searches for the bank and should find it and set everything up so you don't even have to click and press enter.  Now the step is just system.require('std'bankConnect.em'); change the default username and default password and then put in your callback function when the trade you want is completely.  It's not going to get any simpler than this.  

The new version of bankserver just works with this new bankConnect and responds identifying itself so you can now locate it programmatically.  

I also included my version of scriptable for those curious.  I just find it useful but it isn't really related to the rest of this.
bankConnect.em
bankserver.em
scriptable.em
Reply all
Reply to author
Forward
0 new messages