671, added a function for bank usage

For changelogs and discussion related to a specific revision.
Post Reply
Message
Author
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

671, added a function for bank usage

#1 Post by lisa » Tue Nov 08, 2011 3:49 am

revision 671.
Nothing huge, just added in a function for bank usage.


Usage is as follows.

Code: Select all

local name, id, count, slot = bankItemBySlot(slotnumber)
If you know the slot you want to check then do
for slot 1

Code: Select all

local name, id, count, slot = bankItemBySlot(1)
If you want to look through bank to find something then

Code: Select all

tokencount = 0
for slotnumber = 1,40 do
local name, id, count, slot = bankItemBySlot(slotnumber)
if id == 204874 then -- phirius tokens
tokencount = tokencount + count
end
end
print("Total tokens in bank "..tokencount.."\n")
That will print to MM window exactly how many phirius tokens you have in your bank, regardless of where you are in the world.
With this info you could do a check and if enough to buy a purified fusion stone then you can go to the bank and remove all the tokens to your bag and then buy a puri.

Anyway that is just 1 example

--=== Note ===--
I only did slots 1-40, if you own more then 1 tab then we might need to look at it differently, not sure if using slot 41 would work.
It is limited to 40 slots (1 tab) at this stage.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: 671, added a function for bank usage

#2 Post by rock5 » Wed Nov 09, 2011 6:13 am

As I checked for updates because I'm about to make a commit, I noticed that Administrator recently did a commit. She seems to have deleted your new function. She does that occationally. :D So recommit it, or if you like I can commit it again for you when I do my commit. Let me know if you want me to do it.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: 671, added a function for bank usage

#3 Post by lisa » Wed Nov 09, 2011 6:54 am

Maybe she didn't like my function lol
Yeah if you can add it back it that would be good thanks
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: 671, added a function for bank usage

#4 Post by rock5 » Wed Nov 09, 2011 9:27 am

np.

I'm just doing a couple of small changes. Something I've wanted to do for awhile is have pawn update check for id change and set to 0 if changed. Id numbers chould never change. That way we don't have to check the id range or other checks we do to see if a pawn is still valid. We can just do a pawn:update() and check if id is 0. Also the way it is now it's possible the pawn isn't valid anymore but the id number changes to a valid value so it thinks it's still valid. This should fix that.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: 671, added a function for bank usage

#5 Post by Administrator » Wed Nov 09, 2011 12:14 pm

Sorry about that. I'm not sure how I managed to delete that function when I had reverted and updated everything just prior to having messed with that.

Have you at least noticed whether or not the code I have added is working or not? I've only been able to test it by manually inducing a crash, but that might given different results than a naturally occurring one.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest