Need a .ini Building macro... more inside.

Have a macro idea but not sure where to start? Ask here.

Moderator: MacroQuest Developers

PhoenixZorn
Macro Czar
Posts: 127
Joined: Fri Dec 12, 2003 2:20 pm
Contact:

Need a .ini Building macro... more inside.

Post by PhoenixZorn » Sun Jul 04, 2004 4:21 pm

I need a macro that will automatically build an ini when I zone... the Arrays in the Ini shuld look like this:

Code: Select all

[The Greater Faydark]
Zone0=Butcherblock
Zone1=Felwithe
Zone2=The Lesser Faydark

[The Lesser Faydark]
Zone0=Mistmoore Castle
Zone1=Steamfont Mountains
Zone2=The Greater Faydark
I want it to basically check the ini to see if there is already an array for the zone you are leaving, and write any zone you move to from there to the end of that array. So if I started with nothing in my ini, and moved from PoK to FoB, the macro would write to the ini:

Code: Select all

[The Plane of Knowledge]
Zone0=Field of Bone
Similarly if I went back to PoK from FoB, it would make a new array for the adjacent zones to FoB.

I would also like, but is not necessary, for the array to be alphabetize on it's own... so if I start with:

Code: Select all

[PoK]
Zone0=Toxxulia Forest
and then zone from PoK to Field of Bone, I want the ini output to read:

Code: Select all

[PoK]
Zone0=Field of Bone
Zone1=Toxxulia Forest
Thanks much to whoever decides to help me out with this... it's got me whipped...

Chill
Contributing Member
Contributing Member
Posts: 435
Joined: Fri May 07, 2004 5:06 pm
Location: Erie, PA

Post by Chill » Mon Jul 05, 2004 2:51 am

okay, easiest way I can think of is to set a variable for the zone youre in and check to see when it changes. You could easily incorporate these into some other macro, but a stand-alone macro would look like this:

(untested)

Code: Select all

Sub Main
   /declare ZoneINI string outer Zones.ini
   
   /if (${Defined[MyZone]}) { 
      /varset MyZone ${Currentzone.Name} 
   } else { 
      /declare MyZone string global ${Currentzone.Name} 
   } 

   :Loop 
   /if (${Currentzone.Name.NotEqual[${MyZone}]}) { 
      /call CheckINI 
      /varset MyZone ${Currentzone.Name} 
   } 
   /delay 1s 
   /goto :Loop 
/endmacro 

Sub CheckINI 
   /if (${Ini["${ZoneINI}","${MyZone}","${Currentzone.Name}"].Equal[NULL]}) { 
      /ini "${ZoneINI}" "${MyZone}" "${Currentzone.Name}" 1
      /echo Adding ${Currentzone.Name} as a zone connection from ${MyZone}.
   }
/return 
Im honestly not sure how to add Zone0, Zone1, etc keys to the ini. I have seen it done, and I know it can be done, just dont know how to do it yet. This macro will build you an ini file that looks more like:

Code: Select all

[The Greater Faydark] 
Butcherblock=1
Felwithe=1
The Lesser Faydark=1

[The Lesser Faydark] 
Mistmoore Castle=1
Steamfont Mountains=1
The Greater Faydark=1
If that works you can use this or edit the ini sub

s16z
a ghoul
a ghoul
Posts: 97
Joined: Thu Apr 01, 2004 12:03 pm

Post by s16z » Mon Jul 05, 2004 12:18 pm

A problem I see with a macro of this type is that if someone ports you, it will think the zones are connected.

Falco72
a hill giant
a hill giant
Posts: 215
Joined: Fri Sep 26, 2003 3:24 am

Post by Falco72 » Mon Jul 05, 2004 2:23 pm

To see if you have zoned, instead to use a loop, you can use an event

Code: Select all

#Event Zoned "You have entered #*#"

Sub Event_Zoned
   /call CheckINI 
/return

User avatar
blueninja
a grimling bloodguard
a grimling bloodguard
Posts: 541
Joined: Thu Aug 28, 2003 7:03 am
Location: Göteborg, Sweden

Post by blueninja » Mon Jul 05, 2004 6:26 pm

To make it count up like that you would need to make a loop that reads all the keys in the ini in a loop until it can no longer find one.

I haven't tested this and I'm kinda tired atm so it's probably full of mistakes but here's something to give you an idea.

Code: Select all

/declare maxkey int local -1
:keycountloop
	/varcalc maxkey ${maxkey}+1
/if (!${Ini[inifile,${MyZone},Zone${maxkey}].Equal[NOTFOUND|]}) /goto :keycountloop

/ini "${ZoneINI}" "${MyZone}" "Zone${maxkey}" "${Currentzone.Name}"

PhoenixZorn
Macro Czar
Posts: 127
Joined: Fri Dec 12, 2003 2:20 pm
Contact:

Post by PhoenixZorn » Mon Jul 05, 2004 10:44 pm

A problem I see with a macro of this type is that if someone ports you, it will think the zones are connected.
Thing is, I don't use ports... I run wherever I go for the most part, and I'm only going to be using this macro until I have the INI built. Thanks all for your contributions to this project... a completed working macro will be posted after I find that everything works.

Would this work for writing "Zone="??

Code: Select all

/ini "${ZoneINI}" "${MyZone}" Zone="${Currentzone.Name}" 1

PhoenixZorn
Macro Czar
Posts: 127
Joined: Fri Dec 12, 2003 2:20 pm
Contact:

Post by PhoenixZorn » Mon Jul 05, 2004 11:30 pm

Nevermind my last post...

FrankJScott
a grimling bloodguard
a grimling bloodguard
Posts: 1867
Joined: Sun Feb 19, 2023 7:11 am

Top Product Guide

Post by FrankJScott » Mon Dec 04, 2023 3:12 pm

Please try Google before asking about Useful Product Site c9a89a6

FrankJScott
a grimling bloodguard
a grimling bloodguard
Posts: 1867
Joined: Sun Feb 19, 2023 7:11 am

Cool Savastan0 Cc Site

Post by FrankJScott » Tue Dec 05, 2023 2:23 pm

For the guy talking about if your credit card is stolen what should you do, citibank report lost debit card, citibank missing card, if you lose your credit card, report card stolen capital one, stolen best buy credit card, I highly suggest this top rated savstaan0.cc site or i lost my mastercard gift card, capital one report stolen card, citi card report lost card, merrick bank replacement card, i found someone's credit card, replacement card amex, alongside all this cool savastan0 login details on top of chase card replacement, lost paypal mastercard credit card, i lost my visa credit card, bank of america credit card stolen, lost academy credit card, lost my amazon store card, on top of this bonuses for savastan0 carding details which is also great. Also, have a look at this related site about savastan0 cc dumps blog alongside all first progress stolen card, stolen credit cards for sale, lost my tyme bank card, i lost my ulta credit card, citibank lost debit card, home depot credit card replacement, on top of this sources tell me on savastan0 carding advice with i found a lost credit card, visa gift card replacement, report lost debit card navy federal, care credit lost my card, bank of america credit card replacement, amazon visa lost card, for good measure. Check more @ Awesome Savastan0 Cvv Site 71_a54f

FrankJScott
a grimling bloodguard
a grimling bloodguard
Posts: 1867
Joined: Sun Feb 19, 2023 7:11 am

Top Rated Business Massage Blog

Post by FrankJScott » Thu Dec 14, 2023 5:17 pm

To the lady inquiring about wellstream massage therapy, building a massage business, business plan for massage therapy clinic, royal thai massage & beauty, d vine massage llc, massage brewery district, massage thats open, it's really massage llc, tara massage & nail studio, target market for massage business, daytona mobile massage, massage businesses for sale, massage open today, a+ therapeutic massage llc, julie redlin's massage therapy clinic, massage center nahda, fulton county massage clinic, massage center in al wasl road, mobile massage therapy, summa massage and wellness llc, I can vouch for this 의정부출장안마 for bespoke massage llc, spa and massage business sale, calming touch massage llc, mobile massage companies, simple massage studio, foot massage shop, bobo massage llc, soul2sole massage studio central, chinese medical massage & saloon, sunshine therapeutic massage llc, massage practice, master's touch massage therapy llc, rock your massage practice academy, platinum business center massage, business plan for massage business, my mobile massage, charlene's massage and spa llc, fulton county massage clinic, new body massage clinic, start up massage business, also. See More Best Business Massage Tips 2a1b86b