No response, so I'm trying, but I think that while I may be close I may be way off as well..... any help would be deeply appreciatedLike it says, vendor diving..... perhaps something with ini support where I can add things to the ini as I decide I need them, would like it to loop itself not doing anything if no vendor was open, and then as soon as I click on a vendor it would continue to the main part find items in the ini and purchase them, and then close the vendor and go back to looping until the next vendor is opened..... probably would be nice if a paramater could be entered on the command line for max number of any given item to purchase..... or perhaps even better on the line in the ini where you put in the item you could also put the max number to purchase from a given vendor for that specific item.... I have some ideas of how to write this, but I am woefully new to MQ and C++, and every time I try to think it thru my brain shuts down =)
Crun
Code: Select all
Sub Main
/declare mytimer timer
/declare path global
/declare sect global
/declare key global
/declare keyq global
/declare mycash global
/declare theItem global
/declare quantity global
:Start
/if $gm==TRUE /call GM
/varset path .\diver.ini
/varset sect Main
/varset key 1
/if "$merchant"!="TRUE" {
/call BuyRoutine
}else{/goto :Start
}
/return
Sub BuyRoutine
:BuyTop
/for key 1 to 10
/varset theItem $ini("@path", "@sect", "@key")
/varset quantity $ini("@path", "@sect", "@key"q)
/call BuyTheItem "@theitem" "@quantity"
/next key
/goto :Start
/return
Sub BuyTheItem(theItem,quantity)
:BuyItemTop
/selectitem "@theItem" merchant
:waitforselection
/varset mytimer 3s
/if "$selecteditem(name)"!="@theItem" {
/delay 0
/if n @mytimer<=0 /goto :BuyItemTop
/goto :waitforselection
}
/delay 2
:dopurchase
/varset mycash $char(cash)
/buyitem @theItem @quantity
/varset mytimer 3s
:waitforpurchasetogothrough
/if n @mycash==$char(cash) {
/delay 0
/if n @mytimer<=0 /goto :dopurchase
/goto :waitforpurchasetogothrough
}
/return Crun
