Armor related macros

macros macros macros

Moderators: Phineas, noivad

Post Reply
Gremlins
Fenix Fire
Fenix Fire
Posts: 811
Joined: Fri Dec 22, 2006 10:42 am
Profession: Fallen
Race: Ghorak Zo
Player Status: Active
Location: Likely with some spiders…
Contact:

Armor related macros

Post by Gremlins » Sat Aug 01, 2009 5:56 am

As requested by Noivad. I'm sure they can be improved on, and they are mostly tailored for me so you might have to do a few changes here and there…
Some ideas to improve upon these:
- Call a subfunction to do the /examine part instead of doubling the code
- Store equipped items when putting on armor so that you revert to your gear when un-equipping
- Variables used so that it makes it easier to adapt to any exile
etc…
Anyway, here they are (one to equip and check, one to un-equip, one to do just the check)

f6
{
"/equip ironh\r"
"/equip ironb\r"
"/equip irons\r"
"/selectitem 'iron helmet'\r"
"/examine\r"
"/selectitem 'iron breastplate'\r"
"/examine\r"
"/selectitem 'iron shield'\r"
"/examine\r"
}
shift-f6
{
"/unequip ironh\r"
"/equip shirt\r"
"/equip heartwood\r"
}
option-f6
{
"/selectitem 'iron helmet'\r"
"/examine\r"
"/selectitem 'iron breastplate'\r"
"/examine\r"
"/selectitem 'iron shield'\r"
"/examine\r"
}
Chum wrote:Do not attempt to apply logic to matters regarding Clan Lord; it'll just drive you nuts... ;)

User avatar
noivad
Order of the White Elephant
Order of the White Elephant
Posts: 3333
Joined: Wed Oct 08, 2003 4:04 pm
Profession: Fighter
Race: Sylvan
Player Status: Active
Location: SF Bay Area
Contact:

Re: Armor related macros

Post by noivad » Sat Aug 01, 2009 6:06 am

Thanks Gremlins.
Here are mine: if you add

Code: Select all

@login call examinearmor
to you login list you can examine your armor on every time you login or reload your macros too. Feel free to copy these and manipulate them to fit you.

Code: Select all

/* ***************************** Armor Macros v1.1 ************************* */
set shirt ""
set myshirt ""

"/exarm" call examinearmor

examinearmor
{
"/selectitem iron breastplate\r"
pause 1
"/examine\r"
"/selectitem TarynbaneHelm\r"
pause 1
"/examine\r"
"/selectitem TarynbaneShield\r"
pause 1
"/examine\r"
}

"dib"	
{
"/unequip iron helmet 1\r"
if @my.left_item != "Heartwood Charm"
	"/equip wooden shield\r"
end if
call armorup
}

"eib"	
{
setglobal shirt @my.torso_item
"/equip iron helmet\r"
"/equip iron shield\r"
call armorup
}

"armorup" call armorup

armorup
{
call examinearmor
set mytop @my.torso_item
message mytop
if mytop  >= "shirt"
   setglobal myshirt @my.torso_item
   if modeVerbose == 1
   		"armor up\r"
   end if
   "/equip ironbreast \r"
else if mytop  >= "iron"
   		message myshirt
   if myshirt == ""
   		"/equip shirt1 Black\r"
   		message "default called"
   else
   		"/equip " myshirt "\r"
   		message "global " myshirt " called"
   end if
   if modeVerbose == 1
   		"armor down\r"
   end if
else
	"/equip ironbreast \r"
end if
}
/******************************************************************************/
http://www.clanlord.net/
Org Du Lac's bestiary: http://bestiary.clanlord.net/index.html
Gil Galad’s Pirates http://pirates.clanlord.net/ & Ranger Studies: http://studies.clanlord.net/
?security warning:View cert•CL players assess valid by refs

User avatar
Guinness
Exile
Posts: 331
Joined: Sun Sep 11, 2005 11:21 pm
Profession: Pied Piper
Race: Fen'neko
Player Status: Spambot

Re: Armor related macros

Post by Guinness » Mon Dec 06, 2010 1:23 pm

This is an amour equipping / unequipping macro with a few neat tricks up it's sleeves

I have it set right now that:

F9:
- performs check if check hasn't been made
- will estimate costs of repair based on Alces prices here
- equips/unequips armor
- won't equip if too worn
- will re-equip previously worn items (ie Knights Shield, Shirts, etc..)
- starts/stops armor wear scanning
- armor scanning detects wear messages and auto unequips on last wear
- sends message to recommend unequip on 2nd last wear
- *NOTE: the first time you hit F9 it will call the check function which takes a small bit of time. After that it is very quick to unequip and reequip.

F10:
- manually triggers armor check

F11:
- manually starts/stops armor wear scanning


I have tested this as well as I can, I think all it needs now is field testing to see if the wear scanning works. One of my testers noticed that on the check it would sometimes not detect an item. I eventually located that the problem was due to other stuff in the text log getting in the way. I added a checker to make sure that breaks don't occur due to such problem, and to re-examine whatever item wasn't properly detected.

I also added in a lot of "call" functions to cut down on the overall size of the macro.


there is a bug in the check to see if the armor is already on that I am working on

Code: Select all

///////////////////////////////////////////////////////////////////
///////////////Guinness's Sweet Armor Macro 1.03///////////////////
///////////////////////////////////////////////////////////////////
setglobal ArmFixCost 0
setglobal ArmOnOffToggle 0
setglobal armwearscanningtoggle 0
setglobal IHscanning 0
setglobal IBscanning 0
setglobal togscan 0
setglobal armchecked 0
setglobal IBwear 0
setglobal IBcost 0
setglobal IBchecked 0
setglobal IHwear 0
setglobal IHcost 0
setglobal IHchecked 0
setglobal ISwear 0
setglobal IScost 0
setglobal ISchecked 0
setglobal IHpercent 20
setglobal IBpercent 20
setglobal ISpercent 20
setglobal checkfail 0
setglobal inithead @my.head_item
setglobal inittorso @my.torso_item
setglobal initleft @my.left_item
f9 call equiparmor
f10 call armcheck
f11 call togglescan

equiparmor
	{
		if armchecked != 1
			call armcheck
		end if
		if ArmOnOffToggle == 1
			setglobal ArmOnOffToggle 0
		else
			setglobal ArmOnOffToggle 1
		end if

		if ArmOnOffToggle == 1						
			message ""
			message "* Equipping Armor..."
			call armequipcheck		
			call equiphelmet
			call equipbreastplate
			call equipshield
			message "* Armor Equipped" 
			message "* Turning Armor Wear Scanning ON"
			if togscan == 1
				message "* Armor Wear Scanning Is Already ON"
				goto skiptog
			end if
			setglobal togscan 0
			call togglescan
			label skiptog
		else
			label unequip
			message ""
			message "* Unequipping Armor..."
			call armequipcheck
			call unequiphelmet
			call unequipbreastplate
			call unequipshield
			message "* Armor Unequipped"
			message "* Turning Armor Wear Scanning OFF"
			setglobal togscan 1			
			call togglescan
		end if
	}

equiphelmet
	{
		setglobal inithead @my.head_item
		if IHwear != 6
			if IHwear >= 2
				if IHon == 0
					"/equip Iron Helmet\r"
					setglobal IHon 1
				end if
			end if
		end if
		if IHwear == 1
			if IHon == 0
				"/equip Iron Helmet\r"
				setglobal IHon 1
			end if
			setglobal IHscanning 1
			message "-----------------------------------------------------"
			message "* IRON HELMET ON LAST WEAR"	
			message "* <!> RECOMMEND UNEQUIPPING <!>"
			message "-----------------------------------------------------"
		end if
		if IHwear == 0
			setglobal IHscanning 0
			setglobal IHon 0
			"/unequip iron helmet\r"
			message "-----------------------------------------------------"
			message "* IRON HELMET TOO WORN"
			message "* <!!!> UNEQUIPPED <!!!>"
			message "-----------------------------------------------------"
		end if
	}

unequiphelmet
	{
		if IHwear != 6
			if IHon == 1
				if inithead >= "Nothing"
					"/unequip Iron Helmet\r"
				else
					if inithead >= "iron helmet <#"
						"/unequip Iron Helmet\r"
					else
						"/equip " inithead "\r"
					end if
				end if
			end if
		end if
	}

equipbreastplate
	{
		setglobal inittorso @my.torso_item
		if IBwear != 6
			if IBwear >= 2
				if IBon == 0
					"/equip Iron Breastplate\r"
					setglobal IBon 1
				end if
			end if
		end if
		if IBwear == 1
			if IBon == 0
				"/equip Iron Breastplate\r"
				setglobal IBon 1
			end if
			setglobal IBscanning 1
			message "-----------------------------------------------------"
			message "* IRON BREASTPLATE ON LAST WEAR"	
			message "* <!> RECOMMEND UNEQUIPPING <!>"
			message "-----------------------------------------------------"
		end if
		if IBwear == 0
			setglobal IBscanning 0
			setglobal IBon 0
			"/unequip iron breastplate\r"
			message "-----------------------------------------------------"
			message "* IRON BREASTPLATE TOO WORN"
			message "* <!!!> UNEQUIPPED <!!!>"
			message "-----------------------------------------------------"
		end if
	}

unequipbreastplate
	{
		if IBwear != 6
			if IBon == 1
				if inittorso >= "Nothing"
					"/unequip iron breastplate\r"
				else
					if inittorso >= "iron breastplate <#"
						"/unequip Iron Breastplate\r"
					else
						"/equip " inittorso "\r"
					end if
				end if
			end if
		end if
	}

equipshield
	{
		setglobal initleft @my.left_item
		if ISwear != 6
			if ISwear >= 2
				if ISon == 0
					"/equip Iron Shield\r"
					setglobal ISon 1
				end if
			end if
		end if
		if ISwear == 1
			if ISon == 0
				"/equip Iron Shield\r"
				setglobal ISon 1
			end if
			setglobal ISscanning 1
			message "-----------------------------------------------------"
			message "* IRON SHIELD ON LAST WEAR"	
			message "* <!> RECOMMEND UNEQUIPPING <!>"
			message "-----------------------------------------------------"
		end if
		if IBwear == 0
			setglobal IHscanning 0
			setglobal ISon 0
			"/unequip iron shield\r"
			message "-----------------------------------------------------"
			message "* IRON BREASTPLATE TOO WORN"
			message "* <!!!> UNEQUIPPED <!!!>"
			message "-----------------------------------------------------"
		end if
	}

unequipshield
	{
		if ISwear != 6
			if ISon == 1
				if initleft >= "Nothing"
					"/unequip Iron Shield\r"
				else
					if inithead >= "iron shield <#"
						"/unequip Iron Shield\r"
					else
						"/equip " initshield "\r"
					end if
				end if
			end if
		end if
	}

armequipcheck
	{
		if @my.head_item >= "iron helmet <#"
			setglobal IHon 1
		else
			setglobal IHon 0
		end if

		if @my.torso_item >= "iron breastplate <#"
			setglobal IBon 1
		else
			setglobal IBon 0
		end if

		if @my.left_item >= "iron shield <#"
			setglobal ISon 1
		else
			setglobal ISon 0
		end if	
	}

armcheck
	{
		message ""
		message "* Checking Armor..."
		
		label recheckhelmet
		call checkhelmet
			if IHchecked == 0
				message "* Helmet Check Break Detected"
				message "* Rechecking Helmet"
				goto recheckhelmet
			end if

		label recheckbreastplate
		call checkbreastplate	
			if IBchecked == 0
				message "* Breastplate Check Break Detected"
				message "* Rechecking Breastplate"
				goto recheckbreastplate
			end if

		label recheckshield
		call checkshield
			if ISchecked == 0
				message "* Shield Check Break Detected"
				message "* Rechecking Shield"
				goto recheckshield
			end if

		message "-----------------------------------------------------"
		if IHwear != 6
			message "* Iron Helmet at     ..................    " IHwear " /  5"
		end if
		if IBwear != 6		
			message "* Iron Breastplate at   ..............    " IBwear " /  5"
		end if
		if ISwear != 6
			message "* Iron Shield at    ....................    " ISwear " /  5"
		end if
		message "-----------------------------------------------------"

		call armorcostestimate

		message "* Armor check completed!"
		message "-----------------------------------------------------"
		setglobal armchecked 1
		setglobal ArmFixCost 0
		setglobal IHchecked 0
		setglobal IBchecked 0
		setglobal ISchecked 0
	}

checkhelmet
	{
		"/selectitem 'Iron Helmet'\r"
		"/examine\r"
		setglobal EM @env.textLog
		if EM >= "Most things have nothing interesting about them"
			setglobal IHwear 6
			setglobal IHcost 0
			setglobal IHchecked 1
		end if
		if EM >= "is in nearly perfect condition"
			setglobal IHwear 5
			setglobal IHcost 0
			setglobal IHchecked 1
		end if
		if EM >= "is in very good condition"
			setglobal IHwear 4
			setglobal IHcost 27
			setglobal IHchecked 1
		end if
		if EM >= "is starting to look a little worn"
			setglobal IHwear 3
			setglobal IHcost 54
			setglobal IHchecked 1
		end if
		if EM >= "is in serious need of repair"
			setglobal IHwear 2
			setglobal IHcost 81
			setglobal IHchecked 1
		end if
		if EM >= "is going to fall apart any day now"
			setglobal IHwear 1
			setglobal IHscanning 2
			setglobal IHcost 108
			setglobal IHchecked 1
		end if
		if EM >= "is no longer functional"
			setglobal IHwear 0
			setglobal IHscanning 1
			setglobal IHcost 135
			setglobal IHchecked 1
		end if
	}

checkbreastplate
	{

		"/selectitem 'Iron Breastplate'\r"
		"/examine\r"
		setglobal EM @env.textLog
		if EM >= "Most things have nothing interesting about them"
			setglobal IBwear 6
			setglobal IBcost 0
			setglobal IBchecked 1
		end if
		if EM >= "is in nearly perfect condition"
			setglobal IBwear 5
			setglobal IBcost 0
			setglobal IBchecked 1
		end if
		if EM >= "is in very good condition"
			setglobal IBwear 4
			setglobal IBcost 225
			setglobal IBchecked 1
		end if
		if EM >= "is starting to look a little worn"
			setglobal IBwear 3
			setglobal IBcost 450
			setglobal IBchecked 1
		end if
		if EM >= "is in serious need of repair"
			setglobal IBwear 2
			setglobal IBcost 675
			setglobal IBchecked 1
		end if
		if EM >= "is going to fall apart any day now"
			setglobal IBwear 1
			setglobal IBscanning 2
			setglobal IBcost 900
			setglobal IBchecked 1
		end if
		if EM >= "is no longer functional"
			setglobal IBwear 0
			setglobal IBscanning 1
			setglobal IBcost 1125
			setglobal IBchecked 1
		end if
	}

checkshield
	{
		"/selectitem 'Iron Shield'\r"
		"/examine\r"
		setglobal EM @env.textLog
		if EM >= "Most things have nothing interesting about them"
			setglobal ISwear 6
			setglobal IScost 0
			setglobal ISchecked 1
		end if
		if EM >= "is in nearly perfect condition"
			setglobal ISwear 5
			setglobal IScost 0
			setglobal ISchecked 1
		end if
		if EM >= "is in very good condition"
			setglobal ISwear 4
			setglobal IScost 87
			setglobal ISchecked 1
		end if
		if EM >= "is starting to look a little worn"
			setglobal ISwear 3
			setglobal IScost 174
			setglobal ISchecked 1
		end if
		if EM >= "is in serious need of repair"
			setglobal ISwear 2
			setglobal IScost 261
			setglobal ISchecked 1
		end if
		if EM >= "is going to fall apart any day now"
			setglobal ISwear 1
			setglobal ISscanning 2
			setglobal IScost 348
			setglobal ISchecked 1
		end if
		if EM >= "is no longer functional"
			setglobal ISwear 0
			setglobal ISscanning 1
			setglobal IScost 435
			setglobal ISchecked 1
		end if
	}

armorcostestimate
	{
		setglobal ArmFixCost + IHcost
		setglobal ArmFixCost + IBcost
		setglobal ArmFixCost + IScost

		if IHcost != 0
			message "* Iron Helmet " IHcost "c  to repair"
		end if
		if IBcost != 0
			message "* Iron Breastplate " IBcost "c  to repair"
		end if		
		if IScost != 0
			message "* Iron Shield " IScost "c  to repair"
		end if	
		if ArmFixCost != 0				
		message "* It will cost " ArmFixCost "c  to repair all items"
		message "-----------------------------------------------------"
		end if
	}

togglescan
	{
		if togscan == 1
			setglobal togscan 0
			message "* Armor Wear Scanning Switched OFF"
		else
			setglobal togscan 1
			message "* Armor Wear Scanning Switched ON"
		label top
			if togscan == 1
				if @env.textLog >= "looks less effective"
					setglobal wearmessage @env.textLog
					message "* detected wear, checking..."
					call scancheck
				end if
			else
				goto finish
			end if
		pause 1
		goto top		
		end if
		label finish
	}

scancheck
	{
		if wearmessage >= "helmet"
			label scanrecheckhelmet
			call checkhelmet
				if IHchecked == 0
					message "* Helmet Check Break Detected"
					message "* Rechecking Helmet"
					goto scanrecheckhelmet
				end if
		end if

		if wearmessage >= "breastplate"
			label scanrecheckbreastplate
			call checkbreastplate	
				if IBchecked == 0
					message "* Breastplate Check Break Detected"
					message "* Rechecking Breastplate"
					goto scanrecheckbreastplate
				end if
		end if

		if wearmessage >= "shield"
			label scanrecheckshield
			call checkshield
				if ISchecked == 0
					message "* Shield Check Break Detected"
					message "* Rechecking Shield"
					goto scanrecheckshield
				end if
		end if

		setglobal IHchecked 0
		setglobal IBchecked 0
		setglobal ISchecked 0

		call autounequip
	}

autounequip
	{
		if IHscanning == 2
			if IHwear == 1
				setglobal IHscanning 1
				message "-----------------------------------------------------"
				message "* IRON HELMET ON LAST WEAR"	
				message "* <!> RECOMMEND UNEQUIPPING <!>"
				message "-----------------------------------------------------"	
			end if
		end if
		if IHscanning == 1
			if IHwear == 0
				setglobal IHscanning 0
				call unequiphelmet
				message "-----------------------------------------------------"
				message "* IRON HELMET TOO WORN"
				message "* <!!!> UNEQUIPPED <!!!>"
				message "-----------------------------------------------------"	
			end if
		end if
		if IBscanning == 2
			if IBwear == 1
				setglobal IBscanning 1
				message "-----------------------------------------------------"
				message "* IRON BREASTPLATE ON LAST WEAR"	
				message "* <!> RECOMMEND UNEQUIPPING <!>"
				message "-----------------------------------------------------"	
			end if
		end if
		if IBscanning == 1
			if IBwear == 0
				setglobal IHscanning 0
				call unequipbreastplate
				message "-----------------------------------------------------"
				message "* IRON BREASTPLATE TOO WORN"
				message "* <!!!> UNEQUIPPED <!!!>"	
				message "-----------------------------------------------------"
			end if
		end if
		if ISscanning == 2
			if ISwear == 1
				setglobal ISscanning 1
				message "-----------------------------------------------------"
				message "* IRON SHIELD ON LAST WEAR"	
				message "* <!> RECOMMEND UNEQUIPPING <!>"
				message "-----------------------------------------------------"	
			end if
		end if
		if ISscanning == 1
			if ISwear == 0
				setglobal ISscanning 0
				call unequipshield
				message "-----------------------------------------------------"
				message "* IRON SHIELD TOO WORN"
				message "* <!!!> UNEQUIPPED <!!!>"	
				message "-----------------------------------------------------"
			end if
		end if
	}
Last edited by Guinness on Tue Dec 07, 2010 11:32 am, edited 8 times in total.
Grank exclaims, "Oh my, a ferocious Scavenger Bird!"

User avatar
Guinness
Exile
Posts: 331
Joined: Sun Sep 11, 2005 11:21 pm
Profession: Pied Piper
Race: Fen'neko
Player Status: Spambot

Re: Armor related macros

Post by Guinness » Mon Dec 06, 2010 2:28 pm

I've made a significant change to v1.03

I replaced the simple toggle on/off for the equip/unequip with a more sophisticated routine that will check to see what are you have, equip if any is not equipped, and unequip if all are equipped.

I find it's just as smooth as v1.03, and to boot I played around a wee bit with the checker function. I got it now so that even if you spam the hell out of it, it will still produce the correct results.

If you had v1.05 - I found a place where I mislabeled a variable for the ironshield. I called it initleft in the checked and then proceeded to write initshield for the unequip bit. So I've fixed that, went through it all again and looked for other such things. If I had an iron shield I'd make sure it's at 100%. Only 3 more iron to go! And a gold...

Code: Select all

///////////////////////////////////////////////////////////////////
///////////////Guinness's Sweet Armor Macro 1.06///////////////////
///////////////////////////////////////////////////////////////////
setglobal ArmFixCost 0
setglobal ArmOnOffToggle 0
setglobal armwearscanningtoggle 0
setglobal IHscanning 0
setglobal IBscanning 0
setglobal togscan 0
setglobal armchecked 0
setglobal IBwear 0
setglobal IBcost 0
setglobal IBchecked 0
setglobal IHwear 0
setglobal IHcost 0
setglobal IHchecked 0
setglobal ISwear 0
setglobal IScost 0
setglobal ISchecked 0
setglobal IHpercent 20
setglobal IBpercent 20
setglobal ISpercent 20
setglobal checkfail 0
setglobal inithead @my.head_item
setglobal inittorso @my.torso_item
setglobal initleft @my.left_item
setglobal armcheckcooldown 0
setglobal equiparmorcooldown 0
f9 call equiparmor
f10 call armcheck
f11 call togglescan

equiparmor
	{
		setglobal equiparmorcooldown + 1
		if equiparmorcooldown == 1
			goto go
		else
			goto stop
		end if
		label go
		if armchecked != 1
			call armcheck
		end if

		call whatisequipped

		if ArmOnOffToggle == 1					
			message ""
			message "* Equipping Armor..."
			call armequipcheck		
			call equiphelmet
			call equipbreastplate
			call equipshield
			message "* Armor Equipped" 
			message "* Turning Armor Wear Scanning ON"
			if togscan == 1
				message "* Armor Wear Scanning Is Already ON"
				goto skiptog
			end if
			setglobal togscan 0
			call togglescan
			label skiptog
		else
			label unequip
			message ""
			message "* Unequipping Armor..."
			call armequipcheck
			call unequiphelmet
			call unequipbreastplate
			call unequipshield
			message "* Armor Unequipped"
			message "* Turning Armor Wear Scanning OFF"
			setglobal togscan 1			
			call togglescan
		end if
		label stop
		pause 2
		setglobal equiparmorcooldown 0
	}

whatisequipped
	{
		if IHwear != 6
			if IBwear != 6
				if ISwear != 6
					goto HelBreShi
				else
					goto HelBre
				end if
			else if ISwear != 6
				goto ShiHel
			else
				goto Hel
			end if
		end if
		
		if IBwear != 6
			if ISwear != 6
				if IHwear != 6
					goto HelBreShi
				else
					goto BreShi
				end if
			else if IHwear != 6
				goto HelBre
			else
				goto Bre
			end if
		end if
			
		if ISwear != 6
			if IHwear != 6
				if IBwear != 6
					goto HelBreShi
				else
					goto ShiHel
				end if
			else if IBwear != 6
				goto BreShi
			else
				goto Shi
			end if
		end if

		label HelBreShi
		if @my.head_item >= "iron helmet <#"
			if @my.torso_item >= "iron breastplate <#"
				if @my.left_item >= "iron shield <#"
					setglobal ArmOnOffToggle 0
				else
					setglobal ArmOnOffToggle 1
				end if
			else
				setglobal ArmOnOffToggle 1
			end if
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label HelBre	
		if @my.head_item >= "iron helmet <#"
			if @my.torso_item >= "iron breastplate <#"
				setglobal ArmOnOffToggle 0
			else
				setglobal ArmOnOffToggle 1
			end if
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label ShiHel
		if @my.left_item >= "iron shield <#"
			if @my.head_item >= "iron helmet <#"
				setglobal ArmOnOffToggle 0
			else
				setglobal ArmOnOffToggle 1
			end if
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label Hel
		if @my.head_item >= "iron helmet <#"
			setglobal ArmOnOffToggle 0
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label BreShi
		if @my.torso_item >= "iron breastplate <#"
			if @my.left_item >= "iron shield <#"
				setglobal ArmOnOffToggle 0
			else
				setglobal ArmOnOffToggle 1
			end if
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label Bre	
		if @my.torso_item >= "iron breastplate <#"
			setglobal ArmOnOffToggle 0
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label Shi
		if @my.left_item >= "iron shield <#"
			setglobal ArmOnOffToggle 0
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label theend
	}

equiphelmet
	{
		setglobal inithead @my.head_item
		if IHwear != 6
			if IHwear >= 2
				if IHon == 0
					"/equip Iron Helmet\r"
					setglobal IHon 1
				end if
			end if
		end if
		if IHwear == 1
			if IHon == 0
				"/equip Iron Helmet\r"
				setglobal IHon 1
			end if
			setglobal IHscanning 1
			message "-----------------------------------------------------"
			message "* IRON HELMET ON LAST WEAR"	
			message "* <!> RECOMMEND UNEQUIPPING <!>"
			message "-----------------------------------------------------"
		end if
		if IHwear == 0
			setglobal IHscanning 0
			setglobal IHon 0
			"/unequip iron helmet\r"
			message "-----------------------------------------------------"
			message "* IRON HELMET TOO WORN"
			message "* <!!!> UNEQUIPPED <!!!>"
			message "-----------------------------------------------------"
		end if
	}

unequiphelmet
	{
		if IHwear != 6
			if IHon == 1
				if inithead >= "Nothing"
					"/unequip Iron Helmet\r"
				else
					if inithead >= "iron helmet <#"
						"/unequip Iron Helmet\r"
					else
						"/equip " inithead "\r"
					end if
				end if
			end if
		end if
	}

equipbreastplate
	{
		setglobal inittorso @my.torso_item
		if IBwear != 6
			if IBwear >= 2
				if IBon == 0
					"/equip Iron Breastplate\r"
					setglobal IBon 1
				end if
			end if
		end if
		if IBwear == 1
			if IBon == 0
				"/equip Iron Breastplate\r"
				setglobal IBon 1
			end if
			setglobal IBscanning 1
			message "-----------------------------------------------------"
			message "* IRON BREASTPLATE ON LAST WEAR"	
			message "* <!> RECOMMEND UNEQUIPPING <!>"
			message "-----------------------------------------------------"
		end if
		if IBwear == 0
			setglobal IBscanning 0
			setglobal IBon 0
			"/unequip iron breastplate\r"
			message "-----------------------------------------------------"
			message "* IRON BREASTPLATE TOO WORN"
			message "* <!!!> UNEQUIPPED <!!!>"
			message "-----------------------------------------------------"
		end if
	}

unequipbreastplate
	{
		if IBwear != 6
			if IBon == 1
				if inittorso >= "Nothing"
					"/unequip iron breastplate\r"
				else
					if inittorso >= "iron breastplate <#"
						"/unequip Iron Breastplate\r"
					else
						"/equip " inittorso "\r"
					end if
				end if
			end if
		end if
	}

equipshield
	{
		setglobal initleft @my.left_item
		if ISwear != 6
			if ISwear >= 2
				if ISon == 0
					"/equip Iron Shield\r"
					setglobal ISon 1
				end if
			end if
		end if
		if ISwear == 1
			if ISon == 0
				"/equip Iron Shield\r"
				setglobal ISon 1
			end if
			setglobal ISscanning 1
			message "-----------------------------------------------------"
			message "* IRON SHIELD ON LAST WEAR"	
			message "* <!> RECOMMEND UNEQUIPPING <!>"
			message "-----------------------------------------------------"
		end if
		if ISwear == 0
			setglobal ISscanning 0
			setglobal ISon 0
			"/unequip iron shield\r"
			message "-----------------------------------------------------"
			message "* IRON SHIELD TOO WORN"
			message "* <!!!> UNEQUIPPED <!!!>"
			message "-----------------------------------------------------"
		end if
	}

unequipshield
	{
		if ISwear != 6
			if ISon == 1
				if initleft >= "Nothing"
					"/unequip Iron Shield\r"
				else
					if initleft >= "iron shield <#"
						"/unequip Iron Shield\r"
					else
						"/equip " initleft "\r"
					end if
				end if
			end if
		end if
	}

armequipcheck
	{
		if @my.head_item >= "iron helmet <#"
			setglobal IHon 1
		else
			setglobal IHon 0
		end if

		if @my.torso_item >= "iron breastplate <#"
			setglobal IBon 1
		else
			setglobal IBon 0
		end if

		if @my.left_item >= "iron shield <#"
			setglobal ISon 1
		else
			setglobal ISon 0
		end if	
	}

armcheck
	{
		setglobal armcheckcooldown + 1
		if armcheckcooldown == 1
			goto green
		else
			goto red
		end if
		label green
		message ""
		message "* Checking Armor..."
		
		label recheckhelmet
		call checkhelmet
			if IHchecked == 0
				message "* Helmet Check Break Detected"
				message "* Rechecking Helmet"
				goto recheckhelmet
			end if

		label recheckbreastplate
		call checkbreastplate	
			if IBchecked == 0
				message "* Breastplate Check Break Detected"
				message "* Rechecking Breastplate"
				goto recheckbreastplate
			end if

		label recheckshield
		call checkshield
			if ISchecked == 0
				message "* Shield Check Break Detected"
				message "* Rechecking Shield"
				goto recheckshield
			end if

		message "-----------------------------------------------------"
		if IHwear != 6
			message "* Iron Helmet at     ..................    " IHwear " /  5"
		end if
		if IBwear != 6		
			message "* Iron Breastplate at   ..............    " IBwear " /  5"
		end if
		if ISwear != 6
			message "* Iron Shield at    ....................    " ISwear " /  5"
		end if
		message "-----------------------------------------------------"

		call armorcostestimate

		message "* Armor check completed!"
		message "-----------------------------------------------------"
		setglobal armchecked 1
		setglobal ArmFixCost 0
		setglobal IHchecked 0
		setglobal IBchecked 0
		setglobal ISchecked 0
		label red
		pause 3
		setglobal armcheckcooldown 0
	}

checkhelmet
	{
		"/selectitem 'Iron Helmet'\r"
		"/examine\r"
		setglobal EM @env.textLog
		if EM >= "No item named 'Iron Shield' found in the item list"
			setglobal IHwear 6
			setglobal IHcost 0
			setglobal IHchecked 1
		end if
		if EM >= "Most things have nothing interesting about them"
			setglobal IHwear 6
			setglobal IHcost 0
			setglobal IHchecked 1
		end if
		if EM >= "This iron helmet is in nearly perfect condition"
			setglobal IHwear 5
			setglobal IHcost 0
			setglobal IHchecked 1
		end if
		if EM >= "This iron helmet is in very good condition"
			setglobal IHwear 4
			setglobal IHcost 27
			setglobal IHchecked 1
		end if
		if EM >= "This iron helmet is starting to look a little worn"
			setglobal IHwear 3
			setglobal IHcost 54
			setglobal IHchecked 1
		end if
		if EM >= "This iron helmet is in serious need of repair"
			setglobal IHwear 2
			setglobal IHcost 81
			setglobal IHchecked 1
		end if
		if EM >= "This iron helmet is going to fall apart any day now"
			setglobal IHwear 1
			setglobal IHscanning 2
			setglobal IHcost 108
			setglobal IHchecked 1
		end if
		if EM >= "This iron helmet is no longer functional"
			setglobal IHwear 0
			setglobal IHscanning 1
			setglobal IHcost 135
			setglobal IHchecked 1
		end if
	}

checkbreastplate
	{

		"/selectitem 'Iron Breastplate'\r"
		"/examine\r"
		setglobal EM @env.textLog
		if EM >= "No item named 'Iron Breastplate' found in the item list"
			setglobal IBwear 6
			setglobal IBcost 0
			setglobal IBchecked 1
		end if
		if EM >= "Most things have nothing interesting about them"
			setglobal IBwear 6
			setglobal IBcost 0
			setglobal IBchecked 1
		end if
		if EM >= "This iron breastplate is in nearly perfect condition"
			setglobal IBwear 5
			setglobal IBcost 0
			setglobal IBchecked 1
		end if
		if EM >= "This iron breastplate is in very good condition"
			setglobal IBwear 4
			setglobal IBcost 225
			setglobal IBchecked 1
		end if
		if EM >= "This iron breastplate is starting to look a little worn"
			setglobal IBwear 3
			setglobal IBcost 450
			setglobal IBchecked 1
		end if
		if EM >= "This iron breastplate is in serious need of repair"
			setglobal IBwear 2
			setglobal IBcost 675
			setglobal IBchecked 1
		end if
		if EM >= "This iron breastplate is going to fall apart any day now"
			setglobal IBwear 1
			setglobal IBscanning 2
			setglobal IBcost 900
			setglobal IBchecked 1
		end if
		if EM >= "This iron breastplate is no longer functional"
			setglobal IBwear 0
			setglobal IBscanning 1
			setglobal IBcost 1125
			setglobal IBchecked 1
		end if
	}

checkshield
	{
		"/selectitem 'Iron Shield'\r"
		"/examine\r"
		setglobal EM @env.textLog
		if EM >= "No item named 'Iron Shield' found in the item list"
			setglobal ISwear 6
			setglobal IScost 0
			setglobal ISchecked 1
		end if
		if EM >= "Most things have nothing interesting about them"
			setglobal ISwear 6
			setglobal IScost 0
			setglobal ISchecked 1
		end if
		if EM >= "This iron shield is in nearly perfect condition"
			setglobal ISwear 5
			setglobal IScost 0
			setglobal ISchecked 1
		end if
		if EM >= "This iron shield is in very good condition"
			setglobal ISwear 4
			setglobal IScost 87
			setglobal ISchecked 1
		end if
		if EM >= "This iron shield is starting to look a little worn"
			setglobal ISwear 3
			setglobal IScost 174
			setglobal ISchecked 1
		end if
		if EM >= "This iron shield is in serious need of repair"
			setglobal ISwear 2
			setglobal IScost 261
			setglobal ISchecked 1
		end if
		if EM >= "This iron shield is going to fall apart any day now"
			setglobal ISwear 1
			setglobal ISscanning 2
			setglobal IScost 348
			setglobal ISchecked 1
		end if
		if EM >= "This iron shield is no longer functional"
			setglobal ISwear 0
			setglobal ISscanning 1
			setglobal IScost 435
			setglobal ISchecked 1
		end if
	}

armorcostestimate
	{
		setglobal ArmFixCost + IHcost
		setglobal ArmFixCost + IBcost
		setglobal ArmFixCost + IScost

		if IHcost != 0
			message "* Iron Helmet " IHcost "c  to repair"
		end if
		if IBcost != 0
			message "* Iron Breastplate " IBcost "c  to repair"
		end if		
		if IScost != 0
			message "* Iron Shield " IScost "c  to repair"
		end if	
		if ArmFixCost != 0				
		message "* It will cost " ArmFixCost "c  to repair all items"
		message "-----------------------------------------------------"
		end if
	}

togglescan
	{
		setglobal equiparmorcooldown 0
		if togscan == 1
			setglobal togscan 0
			message "* Armor Wear Scanning Switched OFF"
		else
			setglobal togscan 1
			message "* Armor Wear Scanning Switched ON"
		label top
			if togscan == 1
				if @env.textLog >= "looks less effective"
					setglobal wearmessage @env.textLog
					message "* detected wear, checking..."
					call scancheck
				end if
			else
				goto finish
			end if
		pause 1
		goto top		
		end if
		label finish
	}

scancheck
	{
		if wearmessage >= "helmet"
			label scanrecheckhelmet
			call checkhelmet
				if IHchecked == 0
					message "* Helmet Check Break Detected"
					message "* Rechecking Helmet"
					goto scanrecheckhelmet
				end if
		end if

		if wearmessage >= "breastplate"
			label scanrecheckbreastplate
			call checkbreastplate	
				if IBchecked == 0
					message "* Breastplate Check Break Detected"
					message "* Rechecking Breastplate"
					goto scanrecheckbreastplate
				end if
		end if

		if wearmessage >= "shield"
			label scanrecheckshield
			call checkshield
				if ISchecked == 0
					message "* Shield Check Break Detected"
					message "* Rechecking Shield"
					goto scanrecheckshield
				end if
		end if

		setglobal IHchecked 0
		setglobal IBchecked 0
		setglobal ISchecked 0

		call autounequip
	}

autounequip
	{
		if IHscanning == 2
			if IHwear == 1
				setglobal IHscanning 1
				message "-----------------------------------------------------"
				message "* IRON HELMET ON LAST WEAR"	
				message "* <!> RECOMMEND UNEQUIPPING <!>"
				message "-----------------------------------------------------"	
			end if
		end if
		if IHscanning == 1
			if IHwear == 0
				setglobal IHscanning 0
				call unequiphelmet
				message "-----------------------------------------------------"
				message "* IRON HELMET TOO WORN"
				message "* <!!!> UNEQUIPPED <!!!>"
				message "-----------------------------------------------------"	
			end if
		end if
		if IBscanning == 2
			if IBwear == 1
				setglobal IBscanning 1
				message "-----------------------------------------------------"
				message "* IRON BREASTPLATE ON LAST WEAR"	
				message "* <!> RECOMMEND UNEQUIPPING <!>"
				message "-----------------------------------------------------"	
			end if
		end if
		if IBscanning == 1
			if IBwear == 0
				setglobal IBscanning 0
				call unequipbreastplate
				message "-----------------------------------------------------"
				message "* IRON BREASTPLATE TOO WORN"
				message "* <!!!> UNEQUIPPED <!!!>"	
				message "-----------------------------------------------------"
			end if
		end if
		if ISscanning == 2
			if ISwear == 1
				setglobal ISscanning 1
				message "-----------------------------------------------------"
				message "* IRON SHIELD ON LAST WEAR"	
				message "* <!> RECOMMEND UNEQUIPPING <!>"
				message "-----------------------------------------------------"	
			end if
		end if
		if ISscanning == 1
			if ISwear == 0
				setglobal ISscanning 0
				call unequipshield
				message "-----------------------------------------------------"
				message "* IRON SHIELD TOO WORN"
				message "* <!!!> UNEQUIPPED <!!!>"	
				message "-----------------------------------------------------"
			end if
		end if
	}
Last edited by Guinness on Tue Dec 07, 2010 11:47 pm, edited 8 times in total.
Grank exclaims, "Oh my, a ferocious Scavenger Bird!"

User avatar
Guinness
Exile
Posts: 331
Joined: Sun Sep 11, 2005 11:21 pm
Profession: Pied Piper
Race: Fen'neko
Player Status: Spambot

Re: Armor related macros

Post by Guinness » Tue Dec 07, 2010 3:55 am

Can someone help me check it?

I don't have an iron shield to test it with... So I'm just hoping that bit will work.

Also need people to run the macro and catch a wear message (you know, *ding!* oh crap..) to see if the scanner works



I finally got my helmet dinged out hunting. The scanner picked it up and did what it was supposed to do. I might change the way the scanner messages the wear so it's more visible, but later.

So the scanner is functional...! That is as far as I can tell.


There might still be a few odd bugs in there, and I think I may have to tweak something.. I have it set right now that if any armor piece is unequipped it will goto the equip part. So if you change an item to say your heartwood charm, and then want things to unequip.. it would equip. I'll deal with that bit later, hadn't thought of that till tonight.
Grank exclaims, "Oh my, a ferocious Scavenger Bird!"

User avatar
Guinness
Exile
Posts: 331
Joined: Sun Sep 11, 2005 11:21 pm
Profession: Pied Piper
Race: Fen'neko
Player Status: Spambot

Re: Armor related macros

Post by Guinness » Wed Dec 08, 2010 1:49 pm

made a few changes for v1.07

One of my testers noticed that they consistently got double messages for when the scanner detected a wear, it would always detect a break in the check sequence as well. But the failsafe kicked in each time and did get the check done successfully. The result was you get two "This iron helmet is in very good condition." messages.

I have added a pause into the checker sequences to see if that will fix it.

I have also changed things around so that if the scanner detects a wear it will also display the current status of all your armor and the cost repair - making things a bit easier to see.


Let me know how this works!

Code: Select all

///////////////////////////////////////////////////////////////////
///////////////Guinness's Sweet Armor Macro 1.07///////////////////
///////////////////////////////////////////////////////////////////
setglobal ArmFixCost 0
setglobal ArmOnOffToggle 0
setglobal armwearscanningtoggle 0
setglobal IHscanning 0
setglobal IBscanning 0
setglobal togscan 0
setglobal armchecked 0
setglobal IBwear 0
setglobal IBcost 0
setglobal IBchecked 0
setglobal IHwear 0
setglobal IHcost 0
setglobal IHchecked 0
setglobal ISwear 0
setglobal IScost 0
setglobal ISchecked 0
setglobal IHpercent 20
setglobal IBpercent 20
setglobal ISpercent 20
setglobal checkfail 0
setglobal inithead @my.head_item
setglobal inittorso @my.torso_item
setglobal initleft @my.left_item
setglobal armcheckcooldown 0
setglobal equiparmorcooldown 0
f9 call equiparmor
f10 call armcheck
f11 call togglescan

equiparmor
	{
		setglobal equiparmorcooldown + 1
		if equiparmorcooldown == 1
			goto go
		else
			goto stop
		end if
		label go
		if armchecked != 1
			call armcheck
		end if

		call whatisequipped

		if ArmOnOffToggle == 1					
			message ""
			message "* Equipping Armor..."
			call armequipcheck		
			call equiphelmet
			call equipbreastplate
			call equipshield
			message "* Armor Equipped" 
			message "* Turning Armor Wear Scanning ON"
			if togscan == 1
				message "* Armor Wear Scanning Is Already ON"
				goto skiptog
			end if
			setglobal togscan 0
			call togglescan
			label skiptog
		else
			label unequip
			message ""
			message "* Unequipping Armor..."
			call armequipcheck
			call unequiphelmet
			call unequipbreastplate
			call unequipshield
			message "* Armor Unequipped"
			message "* Turning Armor Wear Scanning OFF"
			setglobal togscan 1			
			call togglescan
		end if
		label stop
		pause 2
		setglobal equiparmorcooldown 0
	}

whatisequipped
	{
		if IHwear != 6
			if IBwear != 6
				if ISwear != 6
					goto HelBreShi
				else
					goto HelBre
				end if
			else if ISwear != 6
				goto ShiHel
			else
				goto Hel
			end if
		end if
		
		if IBwear != 6
			if ISwear != 6
				if IHwear != 6
					goto HelBreShi
				else
					goto BreShi
				end if
			else if IHwear != 6
				goto HelBre
			else
				goto Bre
			end if
		end if
			
		if ISwear != 6
			if IHwear != 6
				if IBwear != 6
					goto HelBreShi
				else
					goto ShiHel
				end if
			else if IBwear != 6
				goto BreShi
			else
				goto Shi
			end if
		end if

		label HelBreShi
		if @my.head_item >= "iron helmet <#"
			if @my.torso_item >= "iron breastplate <#"
				if @my.left_item >= "iron shield <#"
					setglobal ArmOnOffToggle 0
				else
					setglobal ArmOnOffToggle 1
				end if
			else
				setglobal ArmOnOffToggle 1
			end if
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label HelBre	
		if @my.head_item >= "iron helmet <#"
			if @my.torso_item >= "iron breastplate <#"
				setglobal ArmOnOffToggle 0
			else
				setglobal ArmOnOffToggle 1
			end if
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label ShiHel
		if @my.left_item >= "iron shield <#"
			if @my.head_item >= "iron helmet <#"
				setglobal ArmOnOffToggle 0
			else
				setglobal ArmOnOffToggle 1
			end if
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label Hel
		if @my.head_item >= "iron helmet <#"
			setglobal ArmOnOffToggle 0
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label BreShi
		if @my.torso_item >= "iron breastplate <#"
			if @my.left_item >= "iron shield <#"
				setglobal ArmOnOffToggle 0
			else
				setglobal ArmOnOffToggle 1
			end if
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label Bre	
		if @my.torso_item >= "iron breastplate <#"
			setglobal ArmOnOffToggle 0
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label Shi
		if @my.left_item >= "iron shield <#"
			setglobal ArmOnOffToggle 0
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label theend
	}

equiphelmet
	{
		setglobal inithead @my.head_item
		if IHwear != 6
			if IHwear >= 2
				if IHon == 0
					"/equip Iron Helmet\r"
					setglobal IHon 1
				end if
			end if
		end if
		if IHwear == 1
			if IHon == 0
				"/equip Iron Helmet\r"
				setglobal IHon 1
			end if
			setglobal IHscanning 1
			message "-----------------------------------------------------"
			message "* IRON HELMET ON LAST WEAR"	
			message "* <!> RECOMMEND UNEQUIPPING <!>"
			message "-----------------------------------------------------"
		end if
		if IHwear == 0
			setglobal IHscanning 0
			setglobal IHon 0
			"/unequip iron helmet\r"
			message "-----------------------------------------------------"
			message "* IRON HELMET TOO WORN"
			message "* <!!!> UNEQUIPPED <!!!>"
			message "-----------------------------------------------------"
		end if
	}

unequiphelmet
	{
		if IHwear != 6
			if IHon == 1
				if inithead >= "Nothing"
					"/unequip Iron Helmet\r"
				else
					if inithead >= "iron helmet <#"
						"/unequip Iron Helmet\r"
					else
						"/equip " inithead "\r"
					end if
				end if
			end if
		end if
	}

equipbreastplate
	{
		setglobal inittorso @my.torso_item
		if IBwear != 6
			if IBwear >= 2
				if IBon == 0
					"/equip Iron Breastplate\r"
					setglobal IBon 1
				end if
			end if
		end if
		if IBwear == 1
			if IBon == 0
				"/equip Iron Breastplate\r"
				setglobal IBon 1
			end if
			setglobal IBscanning 1
			message "-----------------------------------------------------"
			message "* IRON BREASTPLATE ON LAST WEAR"	
			message "* <!> RECOMMEND UNEQUIPPING <!>"
			message "-----------------------------------------------------"
		end if
		if IBwear == 0
			setglobal IBscanning 0
			setglobal IBon 0
			"/unequip iron breastplate\r"
			message "-----------------------------------------------------"
			message "* IRON BREASTPLATE TOO WORN"
			message "* <!!!> UNEQUIPPED <!!!>"
			message "-----------------------------------------------------"
		end if
	}

unequipbreastplate
	{
		if IBwear != 6
			if IBon == 1
				if inittorso >= "Nothing"
					"/unequip iron breastplate\r"
				else
					if inittorso >= "iron breastplate <#"
						"/unequip Iron Breastplate\r"
					else
						"/equip " inittorso "\r"
					end if
				end if
			end if
		end if
	}

equipshield
	{
		setglobal initleft @my.left_item
		if ISwear != 6
			if ISwear >= 2
				if ISon == 0
					"/equip Iron Shield\r"
					setglobal ISon 1
				end if
			end if
		end if
		if ISwear == 1
			if ISon == 0
				"/equip Iron Shield\r"
				setglobal ISon 1
			end if
			setglobal ISscanning 1
			message "-----------------------------------------------------"
			message "* IRON SHIELD ON LAST WEAR"	
			message "* <!> RECOMMEND UNEQUIPPING <!>"
			message "-----------------------------------------------------"
		end if
		if ISwear == 0
			setglobal ISscanning 0
			setglobal ISon 0
			"/unequip iron shield\r"
			message "-----------------------------------------------------"
			message "* IRON SHIELD TOO WORN"
			message "* <!!!> UNEQUIPPED <!!!>"
			message "-----------------------------------------------------"
		end if
	}

unequipshield
	{
		if ISwear != 6
			if ISon == 1
				if initleft >= "Nothing"
					"/unequip Iron Shield\r"
				else
					if initleft >= "iron shield <#"
						"/unequip Iron Shield\r"
					else
						"/equip " initleft "\r"
					end if
				end if
			end if
		end if
	}

armequipcheck
	{
		if @my.head_item >= "iron helmet <#"
			setglobal IHon 1
		else
			setglobal IHon 0
		end if

		if @my.torso_item >= "iron breastplate <#"
			setglobal IBon 1
		else
			setglobal IBon 0
		end if

		if @my.left_item >= "iron shield <#"
			setglobal ISon 1
		else
			setglobal ISon 0
		end if	
	}

armcheck
	{
		setglobal armcheckcooldown + 1
		if armcheckcooldown == 1
			goto green
		else
			goto red1
		end if
		label green
		message ""
		message "* Checking Armor..."
		
		label recheckhelmet
		call checkhelmet
			if IHchecked == 0
				message "* Helmet Check Break Detected"
				message "* Rechecking Helmet"
				goto recheckhelmet
			end if

		label recheckbreastplate
		call checkbreastplate	
			if IBchecked == 0
				message "* Breastplate Check Break Detected"
				message "* Rechecking Breastplate"
				goto recheckbreastplate
			end if

		label recheckshield
		call checkshield
			if ISchecked == 0
				message "* Shield Check Break Detected"
				message "* Rechecking Shield"
				goto recheckshield
			end if
		message "-----------------------------------------------------"
		message "* Armor check completed!"
		message "-----------------------------------------------------"
		call costcheck
		setglobal armchecked 1
		setglobal IHchecked 0
		setglobal IBchecked 0
		setglobal ISchecked 0
		pause 3
		setglobal armcheckcooldown 0
		label red
	}

costcheck
	{
		if IHwear != 6
			message "* Iron Helmet at     ..................    " IHwear " /  5"
		end if
		if IBwear != 6		
			message "* Iron Breastplate at   ..............    " IBwear " /  5"
		end if
		if ISwear != 6
			message "* Iron Shield at    ....................    " ISwear " /  5"
		end if
		message "-----------------------------------------------------"

		call armorcostestimate
		setglobal ArmFixCost 0
	}

checkhelmet
	{
		"/selectitem 'Iron Helmet'\r"
		pause 1
		"/examine\r"
		setglobal EM @env.textLog
		if EM >= "No item named 'Iron Shield' found in the item list"
			setglobal IHwear 6
			setglobal IHcost 0
			setglobal IHchecked 1
		end if
		if EM >= "Most things have nothing interesting about them"
			setglobal IHwear 6
			setglobal IHcost 0
			setglobal IHchecked 1
		end if
		if EM >= "This iron helmet is in nearly perfect condition"
			setglobal IHwear 5
			setglobal IHcost 0
			setglobal IHchecked 1
		end if
		if EM >= "This iron helmet is in very good condition"
			setglobal IHwear 4
			setglobal IHcost 27
			setglobal IHchecked 1
		end if
		if EM >= "This iron helmet is starting to look a little worn"
			setglobal IHwear 3
			setglobal IHcost 54
			setglobal IHchecked 1
		end if
		if EM >= "This iron helmet is in serious need of repair"
			setglobal IHwear 2
			setglobal IHcost 81
			setglobal IHchecked 1
		end if
		if EM >= "This iron helmet is going to fall apart any day now"
			setglobal IHwear 1
			setglobal IHscanning 2
			setglobal IHcost 108
			setglobal IHchecked 1
		end if
		if EM >= "This iron helmet is no longer functional"
			setglobal IHwear 0
			setglobal IHscanning 1
			setglobal IHcost 135
			setglobal IHchecked 1
		end if
	}

checkbreastplate
	{

		"/selectitem 'Iron Breastplate'\r"
		pause 1
		"/examine\r"
		setglobal EM @env.textLog
		if EM >= "No item named 'Iron Breastplate' found in the item list"
			setglobal IBwear 6
			setglobal IBcost 0
			setglobal IBchecked 1
		end if
		if EM >= "Most things have nothing interesting about them"
			setglobal IBwear 6
			setglobal IBcost 0
			setglobal IBchecked 1
		end if
		if EM >= "This iron breastplate is in nearly perfect condition"
			setglobal IBwear 5
			setglobal IBcost 0
			setglobal IBchecked 1
		end if
		if EM >= "This iron breastplate is in very good condition"
			setglobal IBwear 4
			setglobal IBcost 225
			setglobal IBchecked 1
		end if
		if EM >= "This iron breastplate is starting to look a little worn"
			setglobal IBwear 3
			setglobal IBcost 450
			setglobal IBchecked 1
		end if
		if EM >= "This iron breastplate is in serious need of repair"
			setglobal IBwear 2
			setglobal IBcost 675
			setglobal IBchecked 1
		end if
		if EM >= "This iron breastplate is going to fall apart any day now"
			setglobal IBwear 1
			setglobal IBscanning 2
			setglobal IBcost 900
			setglobal IBchecked 1
		end if
		if EM >= "This iron breastplate is no longer functional"
			setglobal IBwear 0
			setglobal IBscanning 1
			setglobal IBcost 1125
			setglobal IBchecked 1
		end if
	}

checkshield
	{
		"/selectitem 'Iron Shield'\r"
		pause 1
		"/examine\r"
		setglobal EM @env.textLog
		if EM >= "No item named 'Iron Shield' found in the item list"
			setglobal ISwear 6
			setglobal IScost 0
			setglobal ISchecked 1
		end if
		if EM >= "Most things have nothing interesting about them"
			setglobal ISwear 6
			setglobal IScost 0
			setglobal ISchecked 1
		end if
		if EM >= "This iron shield is in nearly perfect condition"
			setglobal ISwear 5
			setglobal IScost 0
			setglobal ISchecked 1
		end if
		if EM >= "This iron shield is in very good condition"
			setglobal ISwear 4
			setglobal IScost 87
			setglobal ISchecked 1
		end if
		if EM >= "This iron shield is starting to look a little worn"
			setglobal ISwear 3
			setglobal IScost 174
			setglobal ISchecked 1
		end if
		if EM >= "This iron shield is in serious need of repair"
			setglobal ISwear 2
			setglobal IScost 261
			setglobal ISchecked 1
		end if
		if EM >= "This iron shield is going to fall apart any day now"
			setglobal ISwear 1
			setglobal ISscanning 2
			setglobal IScost 348
			setglobal ISchecked 1
		end if
		if EM >= "This iron shield is no longer functional"
			setglobal ISwear 0
			setglobal ISscanning 1
			setglobal IScost 435
			setglobal ISchecked 1
		end if
	}

armorcostestimate
	{
		setglobal ArmFixCost + IHcost
		setglobal ArmFixCost + IBcost
		setglobal ArmFixCost + IScost

		if IHcost != 0
			message "* Iron Helmet " IHcost "c  to repair"
		end if
		if IBcost != 0
			message "* Iron Breastplate " IBcost "c  to repair"
		end if		
		if IScost != 0
			message "* Iron Shield " IScost "c  to repair"
		end if	
		if ArmFixCost != 0				
		message "* It will cost " ArmFixCost "c  to repair all items"
		message "-----------------------------------------------------"
		end if
	}

togglescan
	{
		setglobal equiparmorcooldown 0
		if togscan == 1
			setglobal togscan 0
			message "* Armor Wear Scanning Switched OFF"
		else
			setglobal togscan 1
			message "* Armor Wear Scanning Switched ON"
		label top
			if togscan == 1
				if @env.textLog >= "looks less effective"
					setglobal wearmessage @env.textLog
					message "* detected wear, checking..."
					call scancheck
				end if
			else
				goto finish
			end if
		pause 1
		goto top		
		end if
		label finish
	}

scancheck
	{
		if wearmessage >= "helmet"
			label scanrecheckhelmet
			call checkhelmet
				if IHchecked == 0
					message "* Helmet Checker Break Detected"
					message "* Rechecking Helmet"
					goto scanrecheckhelmet
				end if
		end if

		if wearmessage >= "breastplate"
			label scanrecheckbreastplate
			call checkbreastplate	
				if IBchecked == 0
					message "* Breastplate Checker Break Detected"
					message "* Rechecking Breastplate"
					goto scanrecheckbreastplate
				end if
		end if

		if wearmessage >= "shield"
			label scanrecheckshield
			call checkshield
				if ISchecked == 0
					message "* Shield Checker Break Detected"
					message "* Rechecking Shield"
					goto scanrecheckshield
				end if
		end if

		setglobal IHchecked 0
		setglobal IBchecked 0
		setglobal ISchecked 0
		message "-----------------------------------------------------"
		call costcheck
		call autounequip
	}

autounequip
	{
		if IHscanning == 2
			if IHwear == 1
				setglobal IHscanning 1
				message "-----------------------------------------------------"
				message "* IRON HELMET ON LAST WEAR"	
				message "* <!> RECOMMEND UNEQUIPPING <!>"
				message "-----------------------------------------------------"	
			end if
		end if
		if IHscanning == 1
			if IHwear == 0
				setglobal IHscanning 0
				call unequiphelmet
				message "-----------------------------------------------------"
				message "* IRON HELMET TOO WORN"
				message "* <!!!> UNEQUIPPED <!!!>"
				message "-----------------------------------------------------"	
			end if
		end if
		if IBscanning == 2
			if IBwear == 1
				setglobal IBscanning 1
				message "-----------------------------------------------------"
				message "* IRON BREASTPLATE ON LAST WEAR"	
				message "* <!> RECOMMEND UNEQUIPPING <!>"
				message "-----------------------------------------------------"	
			end if
		end if
		if IBscanning == 1
			if IBwear == 0
				setglobal IBscanning 0
				call unequipbreastplate
				message "-----------------------------------------------------"
				message "* IRON BREASTPLATE TOO WORN"
				message "* <!!!> UNEQUIPPED <!!!>"	
				message "-----------------------------------------------------"
			end if
		end if
		if ISscanning == 2
			if ISwear == 1
				setglobal ISscanning 1
				message "-----------------------------------------------------"
				message "* IRON SHIELD ON LAST WEAR"	
				message "* <!> RECOMMEND UNEQUIPPING <!>"
				message "-----------------------------------------------------"	
			end if
		end if
		if ISscanning == 1
			if ISwear == 0
				setglobal ISscanning 0
				call unequipshield
				message "-----------------------------------------------------"
				message "* IRON SHIELD TOO WORN"
				message "* <!!!> UNEQUIPPED <!!!>"	
				message "-----------------------------------------------------"
			end if
		end if
	}
Grank exclaims, "Oh my, a ferocious Scavenger Bird!"

User avatar
Guinness
Exile
Posts: 331
Joined: Sun Sep 11, 2005 11:21 pm
Profession: Pied Piper
Race: Fen'neko
Player Status: Spambot

Re: Armor related macros

Post by Guinness » Fri Dec 10, 2010 1:49 pm

It seems that mac users are having an issue with the double messages in the macro.. It's working fine on my PC.

I changed where the pause was in the checker functions.. maybe that'll do something?

Code: Select all

///////////////////////////////////////////////////////////////////
///////////////Guinness's Sweet Armor Macro 1.07b//////////////////
///////////////////////////////////////////////////////////////////
setglobal ArmFixCost 0
setglobal ArmOnOffToggle 0
setglobal armwearscanningtoggle 0
setglobal IHscanning 0
setglobal IBscanning 0
setglobal togscan 0
setglobal armchecked 0
setglobal IBwear 0
setglobal IBcost 0
setglobal IBchecked 0
setglobal IHwear 0
setglobal IHcost 0
setglobal IHchecked 0
setglobal ISwear 0
setglobal IScost 0
setglobal ISchecked 0
setglobal IHpercent 20
setglobal IBpercent 20
setglobal ISpercent 20
setglobal checkfail 0
setglobal inithead @my.head_item
setglobal inittorso @my.torso_item
setglobal initleft @my.left_item
setglobal armcheckcooldown 0
setglobal equiparmorcooldown 0
f9 call equiparmor
f10 call armcheck
f11 call togglescan

equiparmor
	{
		setglobal equiparmorcooldown + 1
		if equiparmorcooldown == 1
			goto go
		else
			goto stop
		end if
		label go
		if armchecked != 1
			call armcheck
		end if

		call whatisequipped

		if ArmOnOffToggle == 1					
			message ""
			message "* Equipping Armor..."
			call armequipcheck		
			call equiphelmet
			call equipbreastplate
			call equipshield
			message "* Armor Equipped" 
			message "* Turning Armor Wear Scanning ON"
			if togscan == 1
				message "* Armor Wear Scanning Is Already ON"
				goto skiptog
			end if
			setglobal togscan 0
			call togglescan
			label skiptog
		else
			label unequip
			message ""
			message "* Unequipping Armor..."
			call armequipcheck
			call unequiphelmet
			call unequipbreastplate
			call unequipshield
			message "* Armor Unequipped"
			message "* Turning Armor Wear Scanning OFF"
			setglobal togscan 1			
			call togglescan
		end if
		label stop
		pause 2
		setglobal equiparmorcooldown 0
	}

whatisequipped
	{
		if IHwear != 6
			if IBwear != 6
				if ISwear != 6
					goto HelBreShi
				else
					goto HelBre
				end if
			else if ISwear != 6
				goto ShiHel
			else
				goto Hel
			end if
		end if
		
		if IBwear != 6
			if ISwear != 6
				if IHwear != 6
					goto HelBreShi
				else
					goto BreShi
				end if
			else if IHwear != 6
				goto HelBre
			else
				goto Bre
			end if
		end if
			
		if ISwear != 6
			if IHwear != 6
				if IBwear != 6
					goto HelBreShi
				else
					goto ShiHel
				end if
			else if IBwear != 6
				goto BreShi
			else
				goto Shi
			end if
		end if

		label HelBreShi
		if @my.head_item >= "iron helmet <#"
			if @my.torso_item >= "iron breastplate <#"
				if @my.left_item >= "iron shield <#"
					setglobal ArmOnOffToggle 0
				else
					setglobal ArmOnOffToggle 1
				end if
			else
				setglobal ArmOnOffToggle 1
			end if
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label HelBre	
		if @my.head_item >= "iron helmet <#"
			if @my.torso_item >= "iron breastplate <#"
				setglobal ArmOnOffToggle 0
			else
				setglobal ArmOnOffToggle 1
			end if
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label ShiHel
		if @my.left_item >= "iron shield <#"
			if @my.head_item >= "iron helmet <#"
				setglobal ArmOnOffToggle 0
			else
				setglobal ArmOnOffToggle 1
			end if
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label Hel
		if @my.head_item >= "iron helmet <#"
			setglobal ArmOnOffToggle 0
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label BreShi
		if @my.torso_item >= "iron breastplate <#"
			if @my.left_item >= "iron shield <#"
				setglobal ArmOnOffToggle 0
			else
				setglobal ArmOnOffToggle 1
			end if
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label Bre	
		if @my.torso_item >= "iron breastplate <#"
			setglobal ArmOnOffToggle 0
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label Shi
		if @my.left_item >= "iron shield <#"
			setglobal ArmOnOffToggle 0
		else
			setglobal ArmOnOffToggle 1
		end if
		goto theend

		label theend
	}

equiphelmet
	{
		setglobal inithead @my.head_item
		if IHwear != 6
			if IHwear >= 2
				if IHon == 0
					"/equip Iron Helmet\r"
					setglobal IHon 1
				end if
			end if
		end if
		if IHwear == 1
			if IHon == 0
				"/equip Iron Helmet\r"
				setglobal IHon 1
			end if
			setglobal IHscanning 1
			message "-----------------------------------------------------"
			message "* IRON HELMET ON LAST WEAR"	
			message "* <!> RECOMMEND UNEQUIPPING <!>"
			message "-----------------------------------------------------"
		end if
		if IHwear == 0
			setglobal IHscanning 0
			setglobal IHon 0
			"/unequip iron helmet\r"
			message "-----------------------------------------------------"
			message "* IRON HELMET TOO WORN"
			message "* <!!!> UNEQUIPPED <!!!>"
			message "-----------------------------------------------------"
		end if
	}

unequiphelmet
	{
		if IHwear != 6
			if IHon == 1
				if inithead >= "Nothing"
					"/unequip Iron Helmet\r"
				else
					if inithead >= "iron helmet <#"
						"/unequip Iron Helmet\r"
					else
						"/equip " inithead "\r"
					end if
				end if
			end if
		end if
	}

equipbreastplate
	{
		setglobal inittorso @my.torso_item
		if IBwear != 6
			if IBwear >= 2
				if IBon == 0
					"/equip Iron Breastplate\r"
					setglobal IBon 1
				end if
			end if
		end if
		if IBwear == 1
			if IBon == 0
				"/equip Iron Breastplate\r"
				setglobal IBon 1
			end if
			setglobal IBscanning 1
			message "-----------------------------------------------------"
			message "* IRON BREASTPLATE ON LAST WEAR"	
			message "* <!> RECOMMEND UNEQUIPPING <!>"
			message "-----------------------------------------------------"
		end if
		if IBwear == 0
			setglobal IBscanning 0
			setglobal IBon 0
			"/unequip iron breastplate\r"
			message "-----------------------------------------------------"
			message "* IRON BREASTPLATE TOO WORN"
			message "* <!!!> UNEQUIPPED <!!!>"
			message "-----------------------------------------------------"
		end if
	}

unequipbreastplate
	{
		if IBwear != 6
			if IBon == 1
				if inittorso >= "Nothing"
					"/unequip iron breastplate\r"
				else
					if inittorso >= "iron breastplate <#"
						"/unequip Iron Breastplate\r"
					else
						"/equip " inittorso "\r"
					end if
				end if
			end if
		end if
	}

equipshield
	{
		setglobal initleft @my.left_item
		if ISwear != 6
			if ISwear >= 2
				if ISon == 0
					"/equip Iron Shield\r"
					setglobal ISon 1
				end if
			end if
		end if
		if ISwear == 1
			if ISon == 0
				"/equip Iron Shield\r"
				setglobal ISon 1
			end if
			setglobal ISscanning 1
			message "-----------------------------------------------------"
			message "* IRON SHIELD ON LAST WEAR"	
			message "* <!> RECOMMEND UNEQUIPPING <!>"
			message "-----------------------------------------------------"
		end if
		if ISwear == 0
			setglobal ISscanning 0
			setglobal ISon 0
			"/unequip iron shield\r"
			message "-----------------------------------------------------"
			message "* IRON SHIELD TOO WORN"
			message "* <!!!> UNEQUIPPED <!!!>"
			message "-----------------------------------------------------"
		end if
	}

unequipshield
	{
		if ISwear != 6
			if ISon == 1
				if initleft >= "Nothing"
					"/unequip Iron Shield\r"
				else
					if initleft >= "iron shield <#"
						"/unequip Iron Shield\r"
					else
						"/equip " initleft "\r"
					end if
				end if
			end if
		end if
	}

armequipcheck
	{
		if @my.head_item >= "iron helmet <#"
			setglobal IHon 1
		else
			setglobal IHon 0
		end if

		if @my.torso_item >= "iron breastplate <#"
			setglobal IBon 1
		else
			setglobal IBon 0
		end if

		if @my.left_item >= "iron shield <#"
			setglobal ISon 1
		else
			setglobal ISon 0
		end if	
	}

armcheck
	{
		setglobal armcheckcooldown + 1
		if armcheckcooldown == 1
			goto green
		else
			goto red1
		end if
		label green
		message ""
		message "* Checking Armor..."
		
		label recheckhelmet
		call checkhelmet
			if IHchecked == 0
				message "* Helmet Check Break Detected"
				message "* Rechecking Helmet"
				goto recheckhelmet
			end if

		label recheckbreastplate
		call checkbreastplate	
			if IBchecked == 0
				message "* Breastplate Check Break Detected"
				message "* Rechecking Breastplate"
				goto recheckbreastplate
			end if

		label recheckshield
		call checkshield
			if ISchecked == 0
				message "* Shield Check Break Detected"
				message "* Rechecking Shield"
				goto recheckshield
			end if
		message "-----------------------------------------------------"
		message "* Armor check completed!"
		message "-----------------------------------------------------"
		call costcheck
		setglobal armchecked 1
		setglobal IHchecked 0
		setglobal IBchecked 0
		setglobal ISchecked 0
		pause 3
		setglobal armcheckcooldown 0
		label red
	}

costcheck
	{
		if IHwear != 6
			message "* Iron Helmet at     ..................    " IHwear " /  5"
		end if
		if IBwear != 6		
			message "* Iron Breastplate at   ..............    " IBwear " /  5"
		end if
		if ISwear != 6
			message "* Iron Shield at    ....................    " ISwear " /  5"
		end if
		message "-----------------------------------------------------"

		call armorcostestimate
		setglobal ArmFixCost 0
	}

checkhelmet
	{
		"/selectitem 'Iron Helmet'\r"

		"/examine\r"
		pause 1
		setglobal EM @env.textLog
		if EM >= "No item named 'Iron Shield' found in the item list"
			setglobal IHwear 6
			setglobal IHcost 0
			setglobal IHchecked 1
		end if
		if EM >= "Most things have nothing interesting about them"
			setglobal IHwear 6
			setglobal IHcost 0
			setglobal IHchecked 1
		end if
		if EM >= "This iron helmet is in nearly perfect condition"
			setglobal IHwear 5
			setglobal IHcost 0
			setglobal IHchecked 1
		end if
		if EM >= "This iron helmet is in very good condition"
			setglobal IHwear 4
			setglobal IHcost 27
			setglobal IHchecked 1
		end if
		if EM >= "This iron helmet is starting to look a little worn"
			setglobal IHwear 3
			setglobal IHcost 54
			setglobal IHchecked 1
		end if
		if EM >= "This iron helmet is in serious need of repair"
			setglobal IHwear 2
			setglobal IHcost 81
			setglobal IHchecked 1
		end if
		if EM >= "This iron helmet is going to fall apart any day now"
			setglobal IHwear 1
			setglobal IHscanning 2
			setglobal IHcost 108
			setglobal IHchecked 1
		end if
		if EM >= "This iron helmet is no longer functional"
			setglobal IHwear 0
			setglobal IHscanning 1
			setglobal IHcost 135
			setglobal IHchecked 1
		end if
	}

checkbreastplate
	{

		"/selectitem 'Iron Breastplate'\r"

		"/examine\r"
		pause 1
		setglobal EM @env.textLog
		if EM >= "No item named 'Iron Breastplate' found in the item list"
			setglobal IBwear 6
			setglobal IBcost 0
			setglobal IBchecked 1
		end if
		if EM >= "Most things have nothing interesting about them"
			setglobal IBwear 6
			setglobal IBcost 0
			setglobal IBchecked 1
		end if
		if EM >= "This iron breastplate is in nearly perfect condition"
			setglobal IBwear 5
			setglobal IBcost 0
			setglobal IBchecked 1
		end if
		if EM >= "This iron breastplate is in very good condition"
			setglobal IBwear 4
			setglobal IBcost 225
			setglobal IBchecked 1
		end if
		if EM >= "This iron breastplate is starting to look a little worn"
			setglobal IBwear 3
			setglobal IBcost 450
			setglobal IBchecked 1
		end if
		if EM >= "This iron breastplate is in serious need of repair"
			setglobal IBwear 2
			setglobal IBcost 675
			setglobal IBchecked 1
		end if
		if EM >= "This iron breastplate is going to fall apart any day now"
			setglobal IBwear 1
			setglobal IBscanning 2
			setglobal IBcost 900
			setglobal IBchecked 1
		end if
		if EM >= "This iron breastplate is no longer functional"
			setglobal IBwear 0
			setglobal IBscanning 1
			setglobal IBcost 1125
			setglobal IBchecked 1
		end if
	}

checkshield
	{
		"/selectitem 'Iron Shield'\r"

		"/examine\r"
		pause 1
		setglobal EM @env.textLog
		if EM >= "No item named 'Iron Shield' found in the item list"
			setglobal ISwear 6
			setglobal IScost 0
			setglobal ISchecked 1
		end if
		if EM >= "Most things have nothing interesting about them"
			setglobal ISwear 6
			setglobal IScost 0
			setglobal ISchecked 1
		end if
		if EM >= "This iron shield is in nearly perfect condition"
			setglobal ISwear 5
			setglobal IScost 0
			setglobal ISchecked 1
		end if
		if EM >= "This iron shield is in very good condition"
			setglobal ISwear 4
			setglobal IScost 87
			setglobal ISchecked 1
		end if
		if EM >= "This iron shield is starting to look a little worn"
			setglobal ISwear 3
			setglobal IScost 174
			setglobal ISchecked 1
		end if
		if EM >= "This iron shield is in serious need of repair"
			setglobal ISwear 2
			setglobal IScost 261
			setglobal ISchecked 1
		end if
		if EM >= "This iron shield is going to fall apart any day now"
			setglobal ISwear 1
			setglobal ISscanning 2
			setglobal IScost 348
			setglobal ISchecked 1
		end if
		if EM >= "This iron shield is no longer functional"
			setglobal ISwear 0
			setglobal ISscanning 1
			setglobal IScost 435
			setglobal ISchecked 1
		end if
	}

armorcostestimate
	{
		setglobal ArmFixCost + IHcost
		setglobal ArmFixCost + IBcost
		setglobal ArmFixCost + IScost

		if IHcost != 0
			message "* Iron Helmet " IHcost "c  to repair"
		end if
		if IBcost != 0
			message "* Iron Breastplate " IBcost "c  to repair"
		end if		
		if IScost != 0
			message "* Iron Shield " IScost "c  to repair"
		end if	
		if ArmFixCost != 0				
		message "* It will cost " ArmFixCost "c  to repair all items"
		message "-----------------------------------------------------"
		end if
	}

togglescan
	{
		setglobal equiparmorcooldown 0
		if togscan == 1
			setglobal togscan 0
			message "* Armor Wear Scanning Switched OFF"
		else
			setglobal togscan 1
			message "* Armor Wear Scanning Switched ON"
		label top
			if togscan == 1
				if @env.textLog >= "looks less effective"
					setglobal wearmessage @env.textLog
					message "* detected wear, checking..."
					call scancheck
				end if
			else
				goto finish
			end if
		pause 1
		goto top		
		end if
		label finish
	}

scancheck
	{
		if wearmessage >= "helmet"
			label scanrecheckhelmet
			call checkhelmet
				if IHchecked == 0
					message "* Helmet Checker Break Detected"
					message "* Rechecking Helmet"
					goto scanrecheckhelmet
				end if
		end if

		if wearmessage >= "breastplate"
			label scanrecheckbreastplate
			call checkbreastplate	
				if IBchecked == 0
					message "* Breastplate Checker Break Detected"
					message "* Rechecking Breastplate"
					goto scanrecheckbreastplate
				end if
		end if

		if wearmessage >= "shield"
			label scanrecheckshield
			call checkshield
				if ISchecked == 0
					message "* Shield Checker Break Detected"
					message "* Rechecking Shield"
					goto scanrecheckshield
				end if
		end if

		setglobal IHchecked 0
		setglobal IBchecked 0
		setglobal ISchecked 0
		message "-----------------------------------------------------"
		call costcheck
		call autounequip
	}

autounequip
	{
		if IHscanning == 2
			if IHwear == 1
				setglobal IHscanning 1
				message "-----------------------------------------------------"
				message "* IRON HELMET ON LAST WEAR"	
				message "* <!> RECOMMEND UNEQUIPPING <!>"
				message "-----------------------------------------------------"	
			end if
		end if
		if IHscanning == 1
			if IHwear == 0
				setglobal IHscanning 0
				call unequiphelmet
				message "-----------------------------------------------------"
				message "* IRON HELMET TOO WORN"
				message "* <!!!> UNEQUIPPED <!!!>"
				message "-----------------------------------------------------"	
			end if
		end if
		if IBscanning == 2
			if IBwear == 1
				setglobal IBscanning 1
				message "-----------------------------------------------------"
				message "* IRON BREASTPLATE ON LAST WEAR"	
				message "* <!> RECOMMEND UNEQUIPPING <!>"
				message "-----------------------------------------------------"	
			end if
		end if
		if IBscanning == 1
			if IBwear == 0
				setglobal IBscanning 0
				call unequipbreastplate
				message "-----------------------------------------------------"
				message "* IRON BREASTPLATE TOO WORN"
				message "* <!!!> UNEQUIPPED <!!!>"	
				message "-----------------------------------------------------"
			end if
		end if
		if ISscanning == 2
			if ISwear == 1
				setglobal ISscanning 1
				message "-----------------------------------------------------"
				message "* IRON SHIELD ON LAST WEAR"	
				message "* <!> RECOMMEND UNEQUIPPING <!>"
				message "-----------------------------------------------------"	
			end if
		end if
		if ISscanning == 1
			if ISwear == 0
				setglobal ISscanning 0
				call unequipshield
				message "-----------------------------------------------------"
				message "* IRON SHIELD TOO WORN"
				message "* <!!!> UNEQUIPPED <!!!>"	
				message "-----------------------------------------------------"
			end if
		end if
	}
Grank exclaims, "Oh my, a ferocious Scavenger Bird!"

Tafari
Exile
Posts: 273
Joined: Thu Feb 12, 2009 1:25 pm
Profession: Ranger
Race: Fen'neko
Player Status: Active
Contact:

Re: Armor related macros

Post by Tafari » Sun Sep 11, 2011 4:59 pm

So laptop was stolen and lost all my macros, didn't have them backed up, dumb! Anyways what I had before was an armor macro that equipped and unequipped with only one f key. It also examined each piece of armor as I either equipped or unequipped. What it did was check if I was wearing the breastplate or a shirt, I carry only one, and based on that it would equip or unequip. Could anyone help me make this simple macro, or even better, does anyone already have one like this? Thanks for any help, much appreciated.

Post Reply