Page 1 of 1

Better way to check for indoor vs. outdoor zone?

Posted: Tue Oct 04, 2005 6:22 pm
by horseshoecrabs
http://www.macroquest2.com/wiki/index.p ... h_Commands

edit: oops! I pasted the edit URL instead of the actual content. Link fixed above.

So above is the post to the Wiki, and yeah it's probably in the wrong place and could probably be divided into two different sections: one talking about cfg files loaded (should be ok where it is) and the other part moved to a section of the wiki that isn't obvious to me. Thanks in advance for the cleanup Lax. :D

So here's my question:

I don't see anything in the documentation describing how to tell if the zone you're in is indoor or outdoor. I was interested in being anal retentive in not attempting to cast a horse more than once in any indoor zone, and today came across the zone.cfg file information, along with several other cfg info tidbits.

Here's my solution, but I'd love to hear if there's something better:

Using the zoned.cfg file...You have a macro that wants to summon a mount (or cast SoW, etc), but should only attempt this in outdoor zones. In zoned.cfg, set a global variable to automatically set the zone to outdoor. Modify your macro to attempt to summon a horse at some appropriate point and capture a failed summon via /doevents. Reset the value of the variable to indoor and it will hold until you zone again.

Posted: Tue Oct 04, 2005 8:14 pm
by A_Druid_00
Even this isn't foolproof since OoW at least, possibly GoD too. There are a number of zones where horses don't work, yet outdoor spells such as SoW do. Same with Lev. I thought about putting together a somewhat intelligent routine in AutoBot, but deemed it not worth the time I'd end up spending working on it.

If you come up with something pretty reliable to handle No Mount, Outdoor, and No Levitation zones; I'll gladly gank it and put it to work in my macro :D

Posted: Tue Oct 04, 2005 8:42 pm
by horseshoecrabs
Well it's nice to know I'm on the right track, even if the tracks go straight to hell.

Off the top of my head, one could look at this as a binary problem with values.

1 - SoW
2 - Mount
4 - Levitation

Adding any combination of the numbers above will yield a unique result.

For example:

1 = 1 (SoW works, but no horses or lev.)
1+2 = 3 (SoW and horses work, but no lev.)
1+4 = 5 (SoW and lev work, but no horses for j00)
etc.

Now there's a unique value available to tell you what can and can't be done. Zoning would reset the var to zero until the bot can run through a series of tests to figure out what the new var value is.

Possibly you could take shortcuts. For example, SoE casting successfully means you have a starting value of at least 5 because the functional values inherited are 1 and 4 from above.

Anyway, feel free to write me a nice snippet. :D

Posted: Tue Oct 04, 2005 8:57 pm
by gimp
You can check out my krust macro, i have this feature in it.
see krust.ini.sample under the section [ZoneInfo] for a list of this data i have compiled manually.

put it in your own INI and read it & use in your scripts.
the data looks like this:

Code: Select all

Provinggrounds_Outdoors=1
Provinggrounds_Levitate=0
Provinggrounds_NoMount=1
However the _NoMount entries are extremley few, because they are not used in krust atm. also this is not a 100% complete list of all the zones in game, just the ones i've been running thru the last 6 months or so.

read the data with something like:

Code: Select all

/declare ZoneAllowsLevitate int local ${Ini[INI_FILE, ZoneInfo, ${Zone.ShortName}_Levitate, 0]}
/if (${ZoneAllowsLevitate}) ...
Here is some code to put in your script to auto figure out if zone allows levitation:

Code: Select all

	/declare ZoneOutdoors int local ${Ini[INI_FILE, ZoneInfo, ${Zone.ShortName}_Outdoors, -1]}
	/if (${ZoneOutdoors} == -1) {
		/echo FIXME: Zone ${Zone.ShortName} data missing in INI
		
		/ini "INI_FILE" "ZoneInfo" "${Zone.ShortName}_Outdoors" "???"
		
		|If i have a levitate buff on, zone allows levitate, right :)
		/if (${Me.Buff["Spirit of Eagle"].ID} || ${Me.Buff["Flight of Eagles"].ID} || ${Me.Buff["Dead Men Floating"].ID} || ${Me.Buff["Levitation"].ID}) {
			/ini "INI_FILE" "ZoneInfo" "${Zone.ShortName}_Levitate" "1"
		} else {
			/ini "INI_FILE" "ZoneInfo" "${Zone.ShortName}_Levitate" "???"
		}
	}
And here is an event that you can use that updates Indoors flag if you cast a outdoor only spell:

Code: Select all

#Event ZoneIndoors "You can only cast this spell in the outdoors.#*#"
Sub Event_ZoneIndoors(string line)
	/declare ZoneOutdoors string local
	/varset ZoneOutdoors ${Ini[INI_FILE, ZoneInfo, ${Zone.ShortName}_Outdoors, -1]}
	/if (${ZoneOutdoors.Equal[???]}) {
		/echo # Debug: Updating Zoneinfo for ${Zone.ShortName}: Indoor zone!
		
		/ini "INI_FILE" "ZoneInfo" "${Zone.ShortName}_Outdoors" "0"
	}
/return
krust macro is on this thread:
http://www.macroquest2.com/phpBB2/viewtopic.php?t=11179
krust uses this for example to show if you miss DMF in buffmode (DMF is not listed if u in potime for example), and to know if it should autorefresh jboots or not.

Posted: Tue Oct 04, 2005 9:22 pm
by A_Druid_00
Technically you could put together a macro that runs each spell once in every zone you visit, go from zone to zone real quick, and populate that puppy fast. :)

I thought of using the 1/2/4 approach too, just to take up less lines in the ini. The TRUE/FALSE for nomout/nolev/nosow works too, just gets real long real fast.

I'd do something like

Code: Select all

[ZoneType]
ZoneA=1
ZoneB=5
ZoneC=3
, or some such. But meh, I'm lazy and have 100 other things I want to put together

Posted: Tue Oct 04, 2005 9:36 pm
by gimp
A_Druid_00 wrote:I thought of using the 1/2/4 approach too, just to take up less lines in the ini. The TRUE/FALSE for nomout/nolev/nosow works too, just gets real long real fast.
Yea, takes less space in ini but lol we're talking about like 10-15k or something at MOST. Besides, mine's actually readable :)

Posted: Tue Oct 04, 2005 9:50 pm
by A_Druid_00
haha, the HUD got me used to reading the 1,2,4 stuff. Yeah, like I said, either way works; it's all matter of preference.

Posted: Wed Oct 05, 2005 9:44 am
by Night Hawk
My Neighbor Toturo!

Posted: Wed Oct 05, 2005 3:34 pm
by Agripa
I maintain a file called Zone.INI with entries like this:

Code: Select all

[Ssratemple]
Levitation=TRUE
Mounts=FALSE
Outdoors=FALSE
Speed=FALSE
Melee Range=( 1/4 )
Mesmerise Level=62
Mesmerise Range=( 200*(1/4) )
Mesmerise ZRange=100
Pacification Range=100
Pacification ZRange=100
Battle Rune=FALSE
Nuke - Low Health=5
When a toon zones, it checks for the existance of the appropriate keys and creates them with defaults if neccessary. During spell casts, if a spell fails, the macro goes back and makes the appropriate change in the key data.