Page 1 of 1

new item shop bank support

Posted: Fri Mar 15, 2013 4:44 pm
by kenzu38
Hey guyz, need some help with adding support for the new bank slots that can store only item shop items.

So far, I got the bot to recognize the new slots but I still can't get it to transfer item shop items to those new slots. I have edited bank, inventory and item.lua from classes folder.

These are the changes I made:

-- changed all 200 to 300 in bank.lua
-- edited function getInventoryRange in inventory.lua
added these lines:

Code: Select all

	elseif rangeLower == "isbank" then
		return 201, 300, "bank"
	elseif rangeLower == "bank" or rangeLower == "banks" then
		return 1, 300, "bank"
-- added some lines in item.lua

Code: Select all

	-- Check if itemshop item
	if bag == "isbank" and not self.ItemShopItem then
		-- Item is not itemshop item. Cannot be put in itemshop bank
		return
	end
When I try this code...

Code: Select all

i = inventory:findItem("Advanced Armor Driller","itemshop") yrest(1000) if i then i:moveTo("isbank") end
...it doesn't work. But if I change "isbank" to "bank" or "bank1", it transfers the items. So I think I'm still missing something for this to work. Can anyone point out what else I need to do? Thanks.

Re: new item shop bank support

Posted: Fri Mar 15, 2013 11:10 pm
by lisa
IS Bank will need it's own code added for it.

Start address is
0x9F3FA4
and it is every 0x44.

Code: Select all

self.Address = addresses.staticBankbase + 0x3520 + ( (self.BagId - 1) * 68 );
Which is actually only 82 items after the start of the bank class, which is kind of weird.

Rock would know more about how he did the bank class.

NVM the rentbankbase is a different static address.

So yeah the current code won't work, it would need to be updated.

Re: new item shop bank support

Posted: Sat Mar 16, 2013 12:28 am
by rock5
Ah, a new feature. I'll look into it.

Re: new item shop bank support

Posted: Sat Mar 16, 2013 1:42 am
by rock5
Ok, this is how I'll make it work.
  • - findItem searches to slot 300.

    - Moving to "bank" defaults to the regular slots 1-200. To move to the isbank you have to specify "isbank" specifically.

    - Like the inventory bags, itemTotalCount will default to slots 1-300 for items and 1-200 when counting empties.
How does that sound?

Re: new item shop bank support

Posted: Sat Mar 16, 2013 2:19 am
by kenzu38
Yep, sounds good. That's what I was trying to do, except for counting the empties which I didn't account for.
lisa wrote:IS Bank will need it's own code added for it.

Start address is
0x9F3FA4
and it is every 0x44.

Code: Select all

self.Address = addresses.staticBankbase + 0x3520 + ( (self.BagId - 1) * 68 );
So yeah the current code won't work, it would need to be updated.
I guess I really need to sit down and watch all those tutorial videos you made about reading memory so I can customize more things. :D

Re: new item shop bank support

Posted: Sat Mar 16, 2013 3:04 am
by rock5
Actually the extra 100 slots are just an extension of the current slots. No extra memory code needed. I actually already did the code but was just allowing a chance for comments. I'll commit it now.

Edit: Committed to 755.

Re: new item shop bank support

Posted: Sat Mar 16, 2013 3:43 am
by kenzu38
Ok, thanks. :)

Although, can you list here the files you changed? I just need the names of the files you changed. So bank, inventory, and item.lua are a given. What else did you change?

Re: new item shop bank support

Posted: Sat Mar 16, 2013 3:51 am
by rock5
A good way to see the changes I made is to right click the "rom" and select "TortoiseSVN/Show log". Select a revision in the top panel then you can double click the files in the bottom panel to see the differences between that file and the previous version.

There are 8 changed files but only 4 are in relation to this issue, bank.lua, bankitem.lua, inventory.lua and item.lua.

Re: new item shop bank support

Posted: Sat Mar 16, 2013 4:08 am
by kenzu38
Ok, thanks for the tip. :)

Will test this as soon as I update my files.

EDIT: Just tested it, it works! Thanks!