Currently Opened Vending

My.First.MMO

Active Member
With the latest update, how do you get the currently opened/viewing vending container?

* The "Vending" Member of the 'character' datatype will now change your current vending container based upon the one you are using via the member.
For example, if you're currently viewing the first container, and you do something like "echo ${Me.Vending[2].Consignment[1]}" ISXEQ2 will change
your vending container to make this items available to you.
Previously, the current opened container was the only one that was used. I want to check an item on whichever container I have currently opened in the broker window is it possible without hard coding the Vending into the script?

Code:
echo ${Me.Vending[i].Consignment[1].Name}
Maybe there's a better way. If I just want to run through a single container (like the one I have currently have opened) to check for the best prices. Is it possible without actually coding that specific container in the code? Perhaps a loop for ${Me.Vending.IsOpened}? Something simple like:

Code:
MyCurrentContainer:Set[${Me.Vending.CurrentlyOpenedContainer}]
echo ${Me.Vending[${MyCurrentContainer}].Consignment[i].Name}
If not, not a huge deal. The new/current way of doing the vending[].consignment[] is a much better way of handling items. It opens up a whole lot more possibilities which I'm sure someone will take full advantage of.
 

Amadeus

The Maestro
Staff member
You would iterate through your consignment items (using the sample iteration script or something similar) until you come to the one (or the item) you're currently viewing.

I'm not sure I know why you'd necessarily need to do this in as far as automation is concerned... It'd be better if you explained what you wanted to do.
 

My.First.MMO

Active Member
Just tring to lessen the amount of editing needed.

On the broker, I wrote a script to automatically process all items in a single container. I just don't need to process every container, everytime, for every run. I know it's simple to code if nothing changes.

What's different is, it's not always the same containers. I run it against container 1 now. Sometime later, I need to run it against, lets say container 3. Log in another account and only need to process containers 4 and 5.

Currently, I'm opening up the .iss file before running the script to change a variable before running. A tiny hassle. Previously, consignment always referenced whichever container was currently open and in view at the broker. So I just opened up the broker, selected the container I wanted to work with then 'run mybrokerscript'. If I needed to work with another account, with a different container number, all I need to do is make sure the correct one is selected before running the script.

Hopefully that makes sense. If it's able to determine which container is 'opened' or the current active one, I can just toss that at the top of my script and let it run without any editing.

If it won't work, is passing in variables from the run command line simple? 'run mybrokerscript 5' for the 5th container. That should work just as well for me.
 

Amadeus

The Maestro
Staff member
Post the script snippet where you do what you're describing and I'll show you how to alter it. Honestly, what you describe sounds kindof strange and inefficient.
 

Cr4zyb4rd

Active Member
If it won't work, is passing in variables from the run command line simple?
ridiculously.

Code:
function main(int MyWackyVariable)
{
  if ${MyWackyVariable} != 0
  {
    echo "The magic number is ${MyWackyVariable}"
  }
  else
  {
    echo "A number!  My kingdom for a number!"
  }
}
 

My.First.MMO

Active Member
OK, passing in the variable will work.

It's not the code that I'm having problems with. It's the actual procedure. I just want it to run through a single bag.

Code:
variable int CurrentContainer=1
declare i int script
i:Set[1]

do
{
	echo ${Me.Vending[{$CurrentContainer}].Consignment[${i}].Name
}
while ${i:Inc} <= ${Me.Vending[${CurrentContainer}].NumItems}
This goes through just bag 1, which is what I want. But maybe a few hours later I need to run it through only bag 2. Currently I have to open the script up and change CurrentContainer=2. If I log in another account, this time I want bag 4, I repeat what I just did, manually change the variable =4 now.

Before the change this is what I used. Naturally, with the recent changes, this is no longer useable.
Code:
declare i int script
i:Set[1]
do
{
	echo ${Me.Consignment[${i}].Name}
}
while ${i:Inc} <= ${Me.NumConsignmentItems}
It ran through a single bag of whichever one you have opened and in your broker window. I'm asking is there any way to determine which bag you are currently viewing(the one that's opened and highlighted) in the broker window? This way I can correctly populate ${CurrentContainer} without continuously modifing that line or even passing in the option when I start.

When you said to iterate through the items until you come to the one you are currently viewing. How can I check to see which bag I'm currently viewing? What am I'm missing?

Code:
function main()
{
   declare i int script
   i:Set[1]

   do
   {
      if (${Me.Vending[${i}](exists)})
      {
         if ${Me.Vending[${i}]==??? [The Container Currently Selected at the Broker]
         {
            CurrentContainer:Set[${i}]
         }
      }
   }
   while ${i:Inc} <= 6         
}
 
Top Bottom