Code:
Global $usePumpkin = True ; set it on true and he use it
Global $useLightbringer = True ; set to true and he use it
Global $ITEM_ID_PUMPKINPIE = 28436
Global Const $ITEM_ID_Scroll_of_the_Lightbringer = 21233
#Region Pcons
Func UsePumpkinPie()
pconsScanInventory()
Sleep(GetPing() + 200)
If $usePumpkin Then
If (GetMapLoading() == 1) And (GetIsDead(-2) == False) Then
If $pconsPumpkinPie_slot[0] > 0 And $pconsPumpkinPie_slot[1] > 0 Then
If DllStructGetData(GetItemBySlot($pconsPumpkinPie_slot[0], $pconsPumpkinPie_slot[1]), "ModelID") == $ITEM_ID_PUMPKINPIE Then
UseItemBySlot($pconsPumpkinPie_slot[0], $pconsPumpkinPie_slot[1])
EndIf
EndIf
EndIf
EndIf
Sleep(GetPing() + 500)
If $useLightbringer Then
If (GetMapLoading() == 1) And (GetIsDead(-2) == False) Then
If $scrollsLightbringer_slot[0] > 0 And $scrollsLightbringer_slot[1] > 0 Then
If DllStructGetData(GetItemBySlot($scrollsLightbringer_slot[0], $scrollsLightbringer_slot[1]), "ModelID") == $ITEM_ID_Scroll_of_the_Lightbringer Then
UseItemBySlot($scrollsLightbringer_slot[0], $scrollsLightbringer_slot[1])
EndIf
EndIf
EndIf
EndIf
EndFunc ;==>UsePumpkinPie
;~ This searches the bags for the specific pcon you wish to use.
Func pconsScanInventory()
Local $bag
Local $size
Local $SLOT
Local $item
Local $ModelID
$pconsPumpkinPie_slot[0] = $pconsPumpkinPie_slot[1] = 0
$scrollsLightbringer_slot[0] = $scrollsLightbringer_slot[1] = 0
For $bag = 1 To 4 Step 1
If $bag == 1 Then $size = 20
If $bag == 2 Then $size = 5
If $bag == 3 Then $size = 10
If $bag == 4 Then $size = 10
For $SLOT = 1 To $size Step 1
$item = GetItemBySlot($bag, $SLOT)
$ModelID = DllStructGetData($item, "ModelID")
Switch $ModelID
Case 0
ContinueLoop
Case $ITEM_ID_PUMPKINPIE
$pconsPumpkinPie_slot[0] = $bag
$pconsPumpkinPie_slot[1] = $SLOT
Case $ITEM_ID_Scroll_of_the_Lightbringer
$scrollsLightbringer_slot[0] = $bag
$scrollsLightbringer_slot[1] = $SLOT
EndSwitch
Next
Next
EndFunc ;==>pconsScanInventory
Func UseItemBySlot($aBag, $aSlot)
Local $item = GetItemBySlot($aBag, $aSlot)
Return SendPacket(0x8, 0x78, DllStructGetData($item, "ID"))
EndFunc ;==>UseItemBySlot
Func arrayContains($array, $item)
For $i = 1 To $array[0]
If $array[$i] == $item Then
Return True
EndIf
Next
Return False
EndFunc ;==>arrayContains
#EndRegion Pcons
If you are lazy can just change pie model id to bu model id but should help you with adding use of BU| Thank Ext3h and Savsuds