All pastes #192698 Raw Edit

Stuff

public text v1 · immutable
·published 2006-10-06 04:01 UTC
rendered paste body
#include partypriest/moveto.iss 

function main() 
{ 
	echo PartyPriest.iss now running... 

	declare AutoFollow bool global FALSE
	declare AutoAttack bool global FALSE
	declare AutoLoot bool global FALSE
	declare AutoBuff bool global FALSE
	declare ShadowProtection bool global FALSE
	declare AoE_OK bool global FALSE
	declare FollowCloser bool global FALSE

	declare MT string global
	declare BuffChk int global 1 
	declare groupMemberCounter int script 1 
	declare PausedScript string global FALSE
	declare Debug bool script TRUE

	; Load our user interface elements.
	ui -load wowskin/wowskin.xml
	ui -load -skin wowskin partypriest.xml

	; Main loop
	do 
	{
		; Various wait checks
		if !${Me(exists)} || ${Me.Casting} || ${PausedScript.Equal[TRUE]} || ${WoWScript[LootFrame:IsShown()]} || ${Me.Dead} || ${Me.Buff[Ghost](exists)} || ${Me.Buff[Wisp](exists)} 
		{
			waitframe
			continue
		}

		; If we've got a dead mob on target then clear it. 
		if ${Target.Dead}
			wowscript ClearTarget() 

		if ${Player[${MT}].Distance}>10 && ${FollowCloser}
			call movetoobject ${Player[${MT}].GUID} 10 0

		if ${Player[${MT}].Distance}>40 && ${AutoFollow}
			call movetoobject ${Player[${MT}].GUID} 40 0 

		; More wait checks.
		if ${Me.Mount(exists)} || ${Me.Sitting}
		{
			waitframe
			continue
		}

		wowscript CHL_PanicHeal()

		; ************ LOOTING ************

		if !${Me.InCombat} && ${AutoLoot}
		{
			call Loot
		}

		if !${Me.InCombat} && ${Me.PctMana} < 70 && ${AutoDrink}
		{
			call Drink
		}

		waitframe
	} 
	while TRUE
}

function Drink()
{

	Item[Conjured Crystal Water]:Use

	while ${Me.Buff[Drink](exists)} && ${Me.PctMana} < 99
		waitframe

	wowpress SITORSTAND
}

function Loot()
{
	declare i int local 1
	declare Corpses guidlist local
	declare LootGUID string local

	; Only loot if we have open inventory slots.
	if ${Me.EmptyInventorySlots}==0
	{
		return
	}

	;Use the object search to find all nearby lootable corpses  
	Corpses:Search[-units,-lootable,-nearest,-range 0-15]

	;If we found lootable corpses then cycle through them
	if ${Corpses.Count}>0
	{
		do
		{
			LootGUID:Set[${Corpses.GUID[${i}]}]

			;Make sure the unit is still lootable and its not too far off.
			if ${Unit[${LootGUID}](exists)} && ${Unit[${LootGUID}].Lootable} && ${Unit[${LootGUID}].Distance}<15
			{
				;Target the corpse
				Target ${LootGUID}
	
				;Make sure we are close enough to loot it
				call movetoobject ${LootGUID} 5
	
				;Hold down shift so that we loot all.
				Keyboard:Hold[shift]

				waitframe
	
				;Use the target to loot it.
				Unit[${LootGUID}]:Use
	
				;Wait for looting to finish
				wait 20 !${Unit[${LootGUID}].Lootable}

				if ${WoWScript[LootFrame:IsShown()]}
				{
					Unit[${LootGUID}]:Use
					wait 20 !${Unit[${LootGUID}].Lootable}
				}
	
				if ${WoWScript[LootFrame:IsShown()]}
				{
					Unit[${LootGUID}]:Use
					wait 20 !${Unit[${LootGUID}].Lootable}
				}

				if ${WoWScript[LootFrame:IsShown()]}
				{
					Keyboard:Press[esc]
				}
	
				;Release the shift key
				Keyboard:Release[shift]

				waitframe
			}
		}
		while ${i:Inc}<=${Corpses.Count} && !${Me.InCombat}

		wait 10
	}

}


; *******************************************************************************************
function DebugMessage(string message)
{
	if ${Debug}
	{
		wowecho "${message}"
	}
}

; *******************************************************************************************
function atexit() 
{ 
	; antiafk off 
	echo PartyPriest.iss has stopped. 

	; Unload our ui elements.
	ui -unload scripts\\partypriest\\UI\\partypriest.xml
}