Page 1 of 1

Trade window contents.

Posted: Sun Oct 17, 2004 2:38 pm
by MrOuija_AK
I'm trying to add some functionality to my TL bot so that he will accept food, water and portal frag trades. But refuse any other junk sent his way.

I've been messing around and figured out $(Window[Tradewnd].Child[TRDW_TradeSlot#]} but now I can't get any information about the item in the tradeslot. I was hoping I'd be able to use "type" to see if it's food or water. All I seem to be able to get is information like "yes this is TRDW_TradeSlot0" but I can't figure out how to point to the item.

Posted: Sun Oct 17, 2004 4:47 pm
by peach
i think all you can do with that is once you accept trade, destroy or keep the item

could be wrong tho

Posted: Sun Oct 17, 2004 5:03 pm
by blueninja
I believe what you're looking for is ${InvSlot[trade1].Item} ...

Posted: Sun Oct 17, 2004 5:20 pm
by MrOuija_AK
Item isn't a member of InvSlot. I tried that already =)

Posted: Sun Oct 17, 2004 5:52 pm
by Night Hawk
.Name ?

Posted: Sun Oct 17, 2004 6:13 pm
by blueninja
invslot



Members



int ID
Number of this item slot (usable directly by /itemnotify)

item Item
Item contained by this item slot

string Name
For inventory slots not inside packs, the slot name

invslot Pack
Container that must be opened to access the slot with /itemnotify

int Slot
Slot number inside the pack which holds the item

To String
Same as ID



Posted: Sun Oct 17, 2004 7:18 pm
by Rusty~
yeah, you would probably wanna use something like:

Code: Select all

/if ( ${Window[TradeWnd].Open} ) {
   /delay 2s
   /if ( ${InvSlot[trade1].Item.Type.Equal[food]} || ${InvSlot[trade1].Item.Type.Equal[drink]} || ${InvSlot[trade1].Item.Name.Equal[Small Portal Fragments]} ) {
      /notify TradeWnd TRDW_Trade_Button leftmouseup
   } else {
      /notify TradeWnd TRDW_Cancel_Button leftmouseup
   }
}
this is just basic example... you could do a loop checking every slot too if you wanted.