Sellitem / Sellall Macro

Macro requests from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

meep
orc pawn
orc pawn
Posts: 10
Joined: Sun Jan 19, 2003 11:18 am

Sellitem / Sellall Macro

Post by meep » Sun Jun 15, 2003 4:58 pm

Hey folks,

Has anyone fixed the old sellitems macro that used to be quite useful, it's great for selling the results of tradecrafting as its a pain selling each item/stack individually.

Many thanks in advance.

User avatar
Imperfect
Macro Author
Macro Author
Posts: 319
Joined: Fri Jun 14, 2002 1:52 am

This works

Post by Imperfect » Thu Jun 19, 2003 5:44 pm

Code: Select all


| - SellItem.mac -
|
| Usage: /macro SellItem "Bottle of Milk"
|

#turbo
#chat say

Sub Main
   /varset v65 0
   /target npc
   /varset v66 "$target(name,clean)"
   /click right target
   :WaitForMerchant
      /doevents
   /if n $v65==0 /goto :WaitForMerchant

   /sendkey down shift
   :Selling
      /finditem similar "$p0"
      /delay 5
      /if $find()==FALSE /goto :Done
      /call SellItem
   /goto :Selling

   :done
   /sendkey up shift
   /press esc
/return

sub Event_Chat
   /if "$p1"=="$v66" /if "$p0"~~"say" /if "$p2"~~"$char(name)" /varset v65 1
/return 


Sub SellItem
   /varset v99 $char(cash) 
   /click left merchant buy
   /delay 5
   /varset t9 15s
   :WaitSell
      /doevents
      /if n $v99!=$char(cash) /goto :WaitEnd
   /if $t9>0 /goto :WaitSell
   :WaitEnd
   /varset t9 0
/return