Thanks Twinkle McNugget, that is helpful. May be the same as the #CONTNAME check I was using, but I like it better.
Okay, so here are the subs I am testing. The first is one where I really need the item equipped because its a weapon. The second is one for items that I want equipped, but it would be alright if it missed once or twice in the cycle of other things. These are running in the midst of another script that is healing with aids constantly and has the potential to interfere with the drag/click-drop.
I will update after I test it a bunch.
Really want to get it equipped (weapon):
;==========================================================
Sub EquipWeapon
Set %Equipped No
Set %EquipType %1
Set %EquipFromSecure No
Set %EquipItemFound No
Set %EquipTimeout1 #Scnt2 + 250
Set %EquipTimeout2 #Scnt2 + 500
Finditem %EquipType C_ , #BackpackID
If #findcnt < 1
{
Set %EquipFromSecure Yes
Finditem %EquipType C_ , %Secure
}
Else
{
Set %ItemToEquip #findid
Set %EquipItemFound Yes
}
If #findcnt > 0 && %EquipFromSecure = Yes
{
Set %EquipItemFound Yes
Set %ItemToEquip #findid
exevent drag #findid
Wait 15
exevent dropc #BackpackID
Wait 15
}
If %EquipItemFound = No
Return #False
Set !HealPause On
Wait 15
Repeat
{
If #lLiftedKind = 0
{
event drag %ItemToEquip
wait 15
}
event macro 8 1
Wait 20
Gosub OffsetClickMC 100 120
wait 10
finditem %EquipType C_ , #CHARID
If #FindCnt > 0
Set %Equipped Yes
If %EquipWeaponTimeout1 >= #Scnt2 && %Equipped = No
{
gosub TM_CheckBackpack 610 610
gosub TM_CheckPaperdoll 810 510
}
}
Until %Equipped = Yes || %EquipWeaponTimeout2 >= #Scnt2
If #lLiftedKind = 1
{
event macro 8 1
Wait 20
Gosub OffsetClickMC 100 120
wait 10
}
Set !HealPause OFF
If %Equipped = Yes
Return #True
Return #False
Want it equipped, but its not urgent:
;==========================================================
Sub EquipArmor
Set %EquipType %1
Finditem %EquipType C_ , #BackpackID
If #findcnt < 1
{
Finditem %EquipType C_ , %Secure
If #findcnt < 1
{
Event exmsg #charid 3 4 You are out of Armor Item Type %1
Return #False
}
}
Set %ItemToEquip #findid
Set !HealPause ON
Wait 15
Event Drag %ItemToEquip
Wait 15
event macro 8 1 ; paperdoll
wait 20
Gosub OffsetClickMC 100 120
Wait 10
If #lLiftedKind = 1
{
Gosub OffsetClickMC 100 120
wait 10
}
Set !HealPause OFF
Return