Old Combine.inc - converted

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

NobodyImportant
a lesser mummy
a lesser mummy
Posts: 46
Joined: Sun Nov 02, 2003 8:42 pm

Old Combine.inc - converted

Post by NobodyImportant » Sun Nov 02, 2003 8:57 pm

This is just the same old Combine.inc that probably 9/10ths of the forum readers have already converted, but its not posted so i figured i would for those that need it. There are some new combine mac but i dont like them because their either to slow, or to spammy with statistics.

Code: Select all

#Event failure "You lacked the skills to fashion the items together."


Sub Combineall
/declare l0 local
/declare l1 local
/declare l2 local
/declare l3 local
/declare l4 local
/declare l5 local
/declare l6 local
/declare l7 local
/declare l8 local
/declare l9 local
/declare v86 global
/declare t22 timer

/for l0 0 to 9
  /if "$right(1,"@Param@l0")"=="@l0" /goto :Continueall
/next l0

:Continueall

/varset l2 100000


/for l1 1 to $int(@l0-1)

  /if "$left(1,"@Param@l1")"=="+" {
   /varset Param@l1 "$right($calc($strlen("$defined(param@l1)")-2),"$left($calc($strlen("$defined(param@l1)")-1),"$defined(param@l1)")")"
   /varadd v86 1 
  } else {
    /if n @l2>$count("$defined(param@l1)") /varset l2 $count("$defined(param@l1)")
  }
/delay 1
/if n $count("@Param@l1")==0 {
  /echo Missing "$defined(param@l1)"
  /return
  }
/next l1

/for l3 1 to 10000

  /delay 0
  /call combine "@Param0" "@Param1" "@Param2" "@Param3" "@Param4" "@Param5" "@Param6" "@Param7" "@Param8" "@Param9"
  /if n $freeinv(space)<2 /return

/next l3
/return

|************************************************************************************************************|
Sub Combine
/declare l0 local
/declare l1 local
/declare l2 local
/declare l3 local
/declare l4 local
/declare l5 local
/declare l6 local
/declare l7 local
/declare l8 local
/declare l9 local


/if "$defined(param0)"!="Environment" {
  /call FindCombiner "@Param0"
  /if n $return==-1 /return
  /varset l0 $return
}

/for l1 0 to 9
/if "$right(1,"@Param@l1")"=="@l1" /goto :Continue
/next l1

:Continue

 /if n @t22==0 {
/if "$defined(param0)"!="Environment" {
    /call clean
    /delay 5
  } else {
    /call clean
    /delay 2
    /face fast item
    /delay 2
    /click left item
    /delay 2
} 
/call Openbags
}

/varset t22 105
/sendkey down ctrl
/delay 3

/if "$defined(param0)"=="Environment" {

    |***************ENVIRO GET ITEMS*******************|

    /for l2 1 to $int(@l1-1)
    :ENVIROFindDelay
    /doevents
    /if "$cursor()"=="TRUE" /goto :ENVIROFindDelay
    /finditem "$defined(param@l2)"
    :ENVIRODropDelay
    /doevents
    /if "$cursor()"=="NULL" /goto :ENVIRODropDelay
    /click left button enviro_$int(@l2-1)
    /next l2

    |************ENVIRO Combine Items********************|

    :ENVIROCombineDelay
    /doevents
    /if "$cursor()"=="TRUE" /goto :ENVIROCombineDelay
    /click left button enviro_combine

/goto :AutoDelay
}


|***************GET ITEMS*******************|

/for l2 1 to $int(@l1-1)
:FindDelay
/doevents
/if "$cursor()"=="TRUE" /goto :FindDelay
   /finditem "@Param@l2"
:DropDelay
/doevents
/if "$cursor()"=="NULL" /goto :DropDelay 
  /click left button inv_pack"@l0"_$int(@l2-1)
/next l2

|************Combine Items********************|

:CombineDelay
/doevents
/if "$cursor()"=="TRUE" /goto :CombineDelay
   /mouseto button inv_pack"@l0"_combine

/call Combineat @l0
   

|************Put Finished Item in Inventory*****|
:AutoDelay
/doevents failure
/if n $return==1 {
/if @v86!="" {
/for l5 1 to @v86
/click left auto
/doevents
/next l5
}
/goto :DoneDelay
}
/if "$cursor()"=="NULL" /goto :AutoDelay
:DoneDelay
   /click left button auto |placing in inventory
   /if @v86!="" {
   /for l5 1 to @v86
   /click left auto
   /doevents
   /next l5
   }
   /delay 1
/if "$cursor()"=="TRUE" /goto :DoneDelay
   /doevents
/sendkey up ctrl
/return


Sub Openbags
/declare l0 local
/declare l1 local
/declare l2 local
/declare l3 local
/declare l4 local
/declare l5 local
/declare l6 local
/declare l7 local
/declare l8 local
/declare l9 local
/delay 2
/for l0 0 to 7
/if "$pack(@l0,open)"!="TRUE" {
/delay 3
/click right button inv_@l0
}
/next l0
/return

Sub Combineat
/declare l0 local
/declare l1 local
/declare l2 local
/declare l3 local
/declare l4 local
/declare l5 local
/declare l6 local
/declare l7 local
/declare l8 local
/declare l9 local

|*****************Bag Slot List*****************|

|   l0  =  the number of slots in the bag

/if "$item(inv,@Param0,name)"=="Foldable Medicine Bag" /varset l0 6
/if "$item(inv,@Param0,name)"=="Mixing Bowl" /varset l0 4
/if "$item(inv,@Param0,name)"=="Spit" /varset l0 6
/if "$item(inv,@Param0,name)"=="Collapsible Sewing Kit" /varset l0 8
/if "$item(inv,@Param0,name)"=="Collapsible Mortar and Pestle" /varset l0 6
/if "$item(inv,@Param0,name)"=="Collapsible Mixing Bowl" /varset l0 4
/if "$item(inv,@Param0,name)"=="Collapsible Spit" /varset l0 6
/if "$item(inv,@Param0,name)"=="Collapsible Fletching Kit" /varset l0 8
/if "$item(inv,@Param0,name)"=="Collapsible Toolbox" /varset l0 8
/if "$item(inv,@Param0,name)"=="Collapsible Jeweller's Kit" /varset l0 6
/if "$item(inv,@Param0,name)"=="Jeweller's Kit" /varset l0 6
/if "$item(inv,@Param0,name)"=="Planar Jeweller's Kit" /varset l0 6
/if "$item(inv,@Param0,name)"=="Large Sewing Kit" /varset l0 8
/if "$item(inv,@Param0,name)"=="Coldain Tanners Kit" /varset l0 8
/if "$item(inv,@Param0,name)"=="Deluxe Sewing Kit" /varset l0 10
/if "$item(inv,@Param0,name)"=="Fletching Kit" /varset l0 8
/if "$item(inv,@Param0,name)"=="Mortar and Pestle" /varset l0 6
/if "$item(inv,@Param0,name)"=="planar fletching kit" /varset l0 8
/if "$item(inv,@Param0,name)"=="Planar Sewing Kit" /varset l0 8
|************************************************|

    /varcalc l1 $calc(10-@l0)*-20
   /doevents
   /mouseto +0 "@l1"
   /delay 0
   /click left
/return


Sub FindCombiner
/declare l0 local
/declare l1 local
/declare l2 local
/declare l3 local
/declare l4 local
/declare l5 local
/declare l6 local
/declare l7 local
/declare l8 local
/declare l9 local
 /for l1 7 downto 0
  /if "$pack(@l1,combine)"=="@Param0" /return @l1
 /next l1
 /echo You do not appear to have a valid $defined(param0) container.
/return -1


Sub Event_failure
/delay 0
/return 1


Sub 10potion
/call FindCombiner Alchemy
/if n $return==-1 /return
/varset l0 $return

/if n $count("$defined(param0)")<10 {
/echo You only have $count("$defined(param0)") $defined(param0)
/return
}

:Again

/varset l9 $count("$defined(param0)")

/if n @t22==0 {
    /call Clean
    /delay 5
  /call Openbags
}
/varset t22 50

|***************GET Potions*******************|


/for l2 1 to 10
:FindDelay
/delay 0
/if "$cursor()"=="TRUE" /goto :FindDelay
   /finditem "$defined(param0)"
:DropDelay
/delay 0
/if "$cursor()"=="NULL" /goto :DropDelay
   /click left button inv_pack@l0_$int(@l2-1)
/next l2

|************Combine Potions********************|

:CombineDelay
/delay 0
/if "$cursor()"=="TRUE" /goto :CombineDelay
   /click left button inv_pack@l0_combine
:DoneDelay
/delay 0
/if n @l9==$count("$defined(param0)") /goto :DoneDelay

/if n $count("$defined(param0)")=>10 /goto :Again
/return

Sub Clean
/cleanup
/press i
/delay 2
/return

PS. Its a bit sloppy because it was my 1st convert, but it works for me, so thats all im concerned with:) If any of the guru's wanna clean it up and such, be my guest.

Just_Another
decaying skeleton
decaying skeleton
Posts: 5
Joined: Sun Nov 30, 2003 11:14 am

Post by Just_Another » Sun Nov 30, 2003 11:37 am

Just 1 thing, how do I get it to "find" a continer in inv? like a mixing bowl