Vendor Diving

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

Crun
orc pawn
orc pawn
Posts: 12
Joined: Wed Dec 03, 2003 12:16 am

Vendor Diving

Post by Crun » Fri Dec 05, 2003 2:23 am

Posted this in the the mac request board
Like 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
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 appreciated

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 
Some of it is extrapolation using other's code as example, some of it is a direct copy from one of EqMule's macro's. Bottom line though is that much of what I put in there I only just barely understand, and some of it I don't understand at all, so as I said any help would be most welcome. =)

Crun

Crun
orc pawn
orc pawn
Posts: 12
Joined: Wed Dec 03, 2003 12:16 am

Post by Crun » Fri Dec 05, 2003 2:46 am

sorry I shoulda also put in there that the ini file would look like this:

Code: Select all

[Main]
1=Spider Silk
1q=200
2=Spiderling Silk
2q=200
3=etc. etc. etc
Crun

Crun
orc pawn
orc pawn
Posts: 12
Joined: Wed Dec 03, 2003 12:16 am

Post by Crun » Sun Dec 07, 2003 8:41 am

/shameless bump

actually, I'm starting to wonder if this doesn't some how fall into a grey area surrounding the unspoken(or maybe not so unspoken) "profit macro" rules, like somehow if you put vendor in your post it will be avoided by all. And while I don't really see how it could be used that way, and my intent is purely to reduce the amount of time I spend search the pok, pot and various other zone vendor's for tradeskill supplies, if this on the risque(sp?) side and you guy's want me to leave off, just say so.... otherwised like I said some help here would be deeply appreciated as I am COMPLETELY lost..... tested what I have and as far as I can tell it does...... a big ol NOTHIN =)

Crun