This macro basically just needs to be told a few things before start.
1) Total number of bags, excluding the combiner you may have in your inventory.
Code: Select all
/varset totBags 8Code: Select all
/varset a(21,1) "1205 120"Code: Select all
/varset a(22,1) 10Code: Select all
/varset cmbPos "405 120"Code: Select all
/varset cmbBtn "425 315"Code: Select all
/varset cmbSlots 10Items to be added to the combiner are added with 2 lines like this:
Code: Select all
/varset curItem "Large Block of Clay"
/call chkItem
/varset curItem "Water Flask"
/call chkItem
/varset curItem "Water Flask"
/call chkItemCode: Select all
/call doCombineThis makes it safe to let it drop items into previously emptied slots.
The script have been tested on pottery only, 3 different combines, all successfull, should be able to do any combine that it has the items for.
If you want it to destroy items rather than keep then just modify the script to do it.
Edit:Added the dsSlot variable for the distance between each slot in a bag, the default UI have a distance of 40.
Code: Select all
#turbo
#define totBags v1
#define curBag v2
#define curSlot v3
#define mouseX1 v4
#define mouseX2 v5
#define mouseY v6
#define chkCol v7
#define tmp01 v8
#define tmp02 v9
#define tmp03 v10
#define tmp04 v11
#define tmp05 v12
#define curItem v13
#define cmbPos v14
#define cmbSlots v15
#define cmbSlot v16
#define cmbBtn v17
#define dsSlot v18
sub main
/varset a(21,1) "1205 120"
/varset a(22,1) 10
/varset a(21,2) "1105 120"
/varset a(22,2) 10
/varset a(21,3) "1005 120"
/varset a(22,3) 10
/varset a(21,4) "905 120"
/varset a(22,4) 10
/varset a(21,5) "805 120"
/varset a(22,5) 10
/varset a(21,6) "705 120"
/varset a(22,6) 10
/varset a(21,7) "605 120"
/varset a(22,7) 10
/varset a(21,8) "505 120"
/varset a(22,8) 10
/varset cmbPos "405 120"
/varset cmbSlots 10
/varset cmbBtn "425 315"
/varset totBags 8
/varset chkCol 0
/varset dsSlot 40
/call bagWalk
:loop
/press ctrl
/press shift
/press alt
/varset cmbSlot 0
/varset curItem "Unfired Casserole Dish"
/call chkItem
/varset curItem "High Quality Firing Sheet"
/call chkItem
/call doCombine
/goto :loop
/return
sub doCombine
/mouseto $cmbBtn
/click left
/delay 5
/if "$cursor()"!="NULL" {
/click left auto
/delay 1
}
/return
sub chkItem
/varset curBag 1
:bagLoop
/varset curSlot 1
:slotLoop
/if "$a($curBag,$curSlot)"~~"$curItem" {
/mouseto $a(21,$curBag)
/varset mouseX1 $mouse(X)
/varset mouseX2 $mouse(X)
/varadd mouseX2 $dsSlot
/varset mouseY $mouse(Y)
/varcalc tmp01 $curSlot-1
/varcalc mouseY $mouseY+$tmp01/2%$curSlot*$dsSlot
/varcalc chkCol $curSlot%2
/if n $chkCol==1 /mouseto $mouseX1 $mouseY
/if n $chkCol==0 /mouseto $mouseX2 $mouseY
/call addItem
/varsub a(1$curBag,$curSlot) 1
/if n $a(1$curBag,$curSlot)==0 {
/varset a($curBag,$curSlot) "empty"
}
/goto :End
} else /if n $curSlot<$a(22,$curBag) {
/varadd curSlot 1
/goto :slotLoop
}
/if n $curBag<$totBags {
/varadd curBag 1
/goto :bagLoop
}
/echo Error: Out of $curItem, aborting.
/endmacro
:End
/return
sub bagWalk
/echo Indexing...
/varset curBag 1
:bagLoop
/mouseto $a(21,$curBag)
/varset curSlot 1
/varset mouseX1 $mouse(X)
/varset mouseX2 $mouse(X)
/varadd mouseX2 $dsSlot
/varset mouseY $mouse(Y)
:slotLoop
/varcalc chkCol $curSlot%2
/if n $chkCol==1 /mouseto $mouseX1 $mouseY
/if n $chkCol==0 /mouseto $mouseX2 $mouseY
/sendkey down shift
/click left
/sendkey up shift
/delay 1
/if "$cursor()"!="NULL" {
/varset a($curBag,$curSlot) "$cursor(name)"
/varset a(1$curBag,$curSlot) $cursor(stack)
/if n $chkCol==1 /mouseto $mouseX1 $mouseY
/if n $chkCol==0 /mouseto $mouseX2 $mouseY
/click left
/delay 1
} else {
/varset a($curBag,$curSlot) "empty"
/varset a(1$curBag,$curSlot) 0
}
/if n $curSlot<$a(22,$curBag) {
/varadd curSlot 1
/if n $chkCol==0 /varadd mouseY $dsSlot
/goto :slotLoop
}
/if n $curBag<$totBags {
/varadd curBag 1
/goto :bagLoop
}
:End
/echo Finished indexing...
/return
sub addItem
/if n $cmbSlot<1 {
/varset cmbSlot 1
} else {
/varadd cmbSlot 1
}
/varcalc chkCol $cmbSlot%2
/sendkey down ctrl
/click left
/sendkey up ctrl
/delay 1
/if n $cursor(stack)>1 {
/echo Error: Got $cursor(stack)x $cursor(name), aborting.
/endmacro
}
/mouseto $cmbPos
/varset mouseX1 $mouse(X)
/varset mouseX2 $mouse(X)
/varadd mouseX2 $dsSlot
/varset mouseY $mouse(Y)
/varcalc tmp01 $cmbSlot-1
/varcalc mouseY $mouseY+$tmp01/2%$cmbSlot*$dsSlot
/varcalc chkCol $cmbSlot%2
/if n $chkCol==1 /mouseto $mouseX1 $mouseY
/if n $chkCol==0 /mouseto $mouseX2 $mouseY
/click left
/delay 1
:End
/return


