SELLITEM.MAC Problems (of course)

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

bheathrow
orc pawn
orc pawn
Posts: 14
Joined: Sun Dec 21, 2003 9:27 am

SELLITEM.MAC Problems (of course)

Post by bheathrow » Thu Feb 26, 2004 5:07 pm

Code: Select all


Sub SELLITEM(ITEMTOSELL)
   /declare OldMoney local
   /declare NewMoney local

   /click left auto
   /sendkey down shift
   /autoinv

   :Finding
      /doevents
      /finditem similar "@ITEMTOSELL"
      /if "$find()"=="FALSE" /goto :Done

   :WaitFind
      /doevents
      /if "$cursor()"=="FALSE" /goto :WaitFind

   :Selling
      /doevents
      /varcalc OldMoney $char(gold)*100+$char(silver)*10+$char(copper)
      /click left merchant buy
	/doevents
/delay 1s
      /click left merchant sell
/delay 1s

   :WaitSell
      /doevents
      /varcalc NewMoney $char(gold)*100+$char(silver)*10+$char(copper)
      /if n @NewMoney==@OldMoney /goto :WaitSell
      /goto :Finding

   :Done
      /doevents flush
      /sendkey up shift

/return 

It works... a few problems though.

I had to add

Code: Select all

/delay 1s
      /click left merchant sell
/delay 1s
because it would not sell all items, it would try to sell too quickly and I
kept getting WOAH! HOLD YOUR HORSES... messages from the merchant (not good)..

Also, I had to add the superflous sell click because sometimes the first click never registers.

I figure that I need to tweak the timing, just not really sure of what value to tweak sections too.

bob_the_builder
a hill giant
a hill giant
Posts: 275
Joined: Tue Jul 22, 2003 1:22 pm

Post by bob_the_builder » Thu Feb 26, 2004 6:01 pm

Seems very similar to this macro ....

http://macroquest2.com/phpBB2/viewtopic.php?t=3784

Just use /sellitem instead of /click. Last post at end of that macro link.

Code: Select all

/sellitem $selecteditem(count) 
Bob

bheathrow
orc pawn
orc pawn
Posts: 14
Joined: Sun Dec 21, 2003 9:27 am

Post by bheathrow » Thu Feb 26, 2004 6:36 pm

Thanks Bob! Love your prior work btw.

Yeah, it's a cribbed macro, the sellitem2.mac iteration I think.

I have had limited sucess with /sellitem, without the delays I still get WOAH! HOLD YOUR... messages from the merchants I sell. However it appears to help with not having to click twice.

Just open to suggestions about #turbo rates in this particular subroutine.

bob_the_builder
a hill giant
a hill giant
Posts: 275
Joined: Tue Jul 22, 2003 1:22 pm

Post by bob_the_builder » Thu Feb 26, 2004 8:26 pm

Check in snippets, put a working #include
I filled 4 bags of different crap and did a /call <item> and didn't ever go too fast ...

Well give it a shot. It is using /sellitem not /click

Bob

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

Post by Draekz » Mon Mar 01, 2004 9:37 am

Hmm just noticed my /sellitem command doesnt work with the MQ2 im using?? I've used latest compile (29/02/04) and for whatever reason /sellitem doesnt seem to work? it does NOT register as "That is an invalid command. Please use help" or whatever..it just doesnt do anything at all.

Hmm thats probably related to the macro prob im having..my /sellitem command just doesnt do anything!

Any chance It could be related to the UI?..perhaps I should give that a shot!

will finish this post once i've tried it ;)

Well just tried it out... /sellitem and /selectitem BOTH dont work?? Is there any issues with these at all that anyone knows of? hmmm doesnt make sense to me that buyitem would work but not sellitem :\

bleh..well in any case if anyone has any ideas, lemme know!

Thanks


Draekz

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

Post by Draekz » Mon Mar 01, 2004 10:22 am

Hmm just looked at the structs for buyitem and sellitem in MQ2commandsAPI and MQ2commands and they are pretty much exactly alike!! meaning if my buy code works my sellcode should work also!!

Grr wtf is going on with my mq2 lol. First my enviro dmg thing (whole nother story) now my /sellitem /selectitem commands are all screwy...I JUST compiled this yesterday night also! so i dunno wtf it could be :\

Bleh..anyone else hear of this problem? with the /sellitem /selectitem not working?

Just curious thanks!

Draekz

bob_the_builder
a hill giant
a hill giant
Posts: 275
Joined: Tue Jul 22, 2003 1:22 pm

Post by bob_the_builder » Mon Mar 01, 2004 11:34 am

I've used latest compile (29/02/04) and for whatever reason /sellitem doesnt seem to work
I'm still using 2/19 compile. I'll try with the newest 3/1 tonight and let you know... Cause the 2/19 /sellitem does work.

Bob