AssistLoot Macro

Arph

Lifetimer
Joined
Aug 23, 2009
Messages
76
Reaction score
0
Points
0
Hello all,
i have been using this macro for years, and i cant make it work now on the AssistLoot.ini reference.

What it does: the Mac autoassist the main Assist, and when it identifies a corpse, moveto the corpse, and loot it. This still works perfectly. It then Keeps or Destroys items on cursor based on a .ini file (the AssistLoot.ini).

How its broken: when running the Mac, it doesnt create the LootArray anymore from the AssistLoot.ini, and keeps destroying all the items. The messages on creation are :
- Attempting to Read information from AssisLoot.ini
- "NULL" is not a valid section for FILE:AssistLoot.ini, ending macro
- No loot array created

Anybody would take a look and help me fixing it?
Does it come from the file definition ?

Thx for your help.
Cheers
Arph

NB: the original macro has been written by DemonH2 (thx bro for all this joy through the years).

The Mac code:

| Assist/Loot Macro, Created by DemonH2
|
|
| This is made from several macros. Namely VillageIdiot's Assist and Fry's Pull.
| It will Assist the specified Assistee, and loot mobs in the area for items
| specified in the ini.
|
| Usage: /mac assistloot (char's name your assisting)
|
|

#Event looterror "#*#You may not#*#"

Sub Main
/if (!${Defined[Param0]}) {
/echo Proper usage: /macro assist TankName
/end
}
/declare RT_MyXLOC int outer ${Me.X}
/declare RT_MyyLOC int outer ${Me.Y}
/declare AssistGuy string outer ${Param0}
/declare sZone int outer ${Zone.ID}
/declare MoveMsg int outer 0
/if (!${Plugin[MQ2MoveUtils].Name.Length}) /plugin MQ2MoveUtils
/call ReadINI AssistLoot.ini "${Zone.Name}" Loot
/if (!${Defined[RV_LootArray]}) {
/echo No Loot Array Created...
}
/assist on
/call Mainloop
/return

Sub Mainloop
:Loop
/call Checkshit
/if (${Spawn[${AssistGuy} radius 60].ID}) {
/assist ${AssistGuy}
/if (${Target.ID} && ${Target.Distance} < 30 && ${Target.Type.Equal[NPC]}) /stick 10
}
/if (!${Target.ID} && ${SpawnCount[npc radius 20]} < 1) {
/call MoveToLoc ${RT_MyyLOC} ${RT_MyXLOC}
/varset MoveMsg 1
} else {
/varset MoveMsg 0
}
/delay 3s
/goto :Loop
/return

Sub MoveToLoc(MoveToY, MoveToX)
/declare running int local
/declare distanceNow float local
/declare distanceBefore float local
/declare distanceModifier int local
/declare distanceTimer timer 15
/varset running 0
/varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
/varset distanceModifier 1
/if (!${MoveMsg}) {
/echo Moving to Location: ${MoveToY}, ${MoveToX}.
/echo Distance: ${distanceBefore}
}
:moveToLocation
/call checkshit
/face fast nolook loc ${MoveToY},${MoveToX}
/if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<10) {
/keypress forward
/return
}
/if (${distanceTimer}==0) {
/if (${Me.Sneaking}) {
/varset distanceModifier 2
} else {
/varset distanceModifier 1
}
/varset distanceNow ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
/if (${Math.Calc[${distanceBefore}-${distanceNow}]}<${Math.Calc[10/${distanceModifier}]}) {
/call HitObstacle
}
/varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
/varset distanceTimer 15
}
/if (${running}==0) {
/keypress forward
/if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}>10) {
/varset running 1
/keypress forward hold
}
} else {
/if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<11) {
/varset running 0
/keypress forward
}
}
/goto :moveToLocation
/return

Sub MoveToLoc2(MoveToY, MoveToX)
/declare running int local
/declare distanceNow float local
/declare distanceBefore float local
/declare distanceModifier int local
/declare distanceTimer timer 15
/varset running 0
/varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
/varset distanceModifier 1
/if (!${MoveMsg}) {
/echo Moving to Location: ${MoveToY}, ${MoveToX}.
/echo Distance: ${distanceBefore}
}
:moveToLocation
/face fast nolook loc ${MoveToY},${MoveToX}
/if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<10) {
/keypress forward
/return
}
/if (${distanceTimer}==0) {
/if (${Me.Sneaking}) {
/varset distanceModifier 2
} else {
/varset distanceModifier 1
}
/varset distanceNow ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
/if (${Math.Calc[${distanceBefore}-${distanceNow}]}<${Math.Calc[10/${distanceModifier}]}) {
/call HitObstacle
}
/varset distanceBefore ${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}
/varset distanceTimer 15
}
/if (${running}==0) {
/keypress forward
/if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}>10) {
/varset running 1
/keypress forward hold
}
} else {
/if (${Math.Distance[${Me.Y},${Me.X}:${MoveToY},${MoveToX}]}<11) {
/varset running 0
/keypress forward
}
}
/goto :moveToLocation
/return

Sub HitObstacle
/call checkshit
/echo Obstacle hit, moving around it...
/keypress forward
/keypress back hold
/delay 3
/keypress back
/if (${Math.Rand[2]}) {
/keypress strafe_right hold
} else {
/keypress strafe_left hold
}
/delay 5
/keypress strafe_right
/keypress strafe_left
/keypress forward hold
/return

Sub Checkshit
/if (${SpawnCount[npccorpse radius 50]} > 0 && ${SpawnCount[npc radius 50]} < 1) /call loot
/if (${Zone.ID}!=${sZone}) /call Rez
/if (${SpawnCount[npc radius 50]} < 1) /call sit
/return

Sub Rez
/if (${Me.State.Equal[Stand]}) /sit
:rezloop
/if (${Zone.ID}!=${sZone}) /goto :rezloop
/return

Sub Sit
/call MoveToLoc2 ${RT_MyyLOC} ${RT_MyXLOC}
/delay 1s
/if (${Me.State.Equal[Stand]}) /sit
:sloop
/if (${SpawnCount[npccorpse radius 50]} > 0 && ${SpawnCount[npc radius 50]} < 1) /call loot
/if (${SpawnCount[npc radius 50]} < 1) /goto :sloop
/delay ${Math.Calc[${Math.Rand[50]}+15]}
/if (${Me.State.Equal[Sit]}) /stand
/return

Sub Loot
/if (${Me.State.Equal[Sit]}) /stand
/target npccorpse
/face fast
/delay 1s
/moveto ID
/call Looting
/delay 2s
/doevents
/call MainLoop
/return

Sub Looting
/declare LootSlot int inner 0
/declare LootCheck int inner 0
/declare LootTotal int inner 0
/keypress forward
/keypress back
/fastdrop on
/lootn never
/echo Looting
/loot
/delay 1s
/doevents
/if (!${Corpse.Items}) {
/echo NO LOOT! Cheap Bastard!
/notify LootWnd DoneButton leftmouseup
/return
} else {
/varset LootTotal ${Corpse.Items}
/for LootSlot 1 to ${LootTotal}
/nomodkey /shift /itemnotify ${Corpse.Item[${LootSlot}].InvSlot} leftmouseup
/delay 1s
/if (${RV_LootAllItems}) {
/autoinventory
/delay 1s
} else {
/for LootCheck 1 to ${RV_LootArray.Size}
/if (${Cursor.Name.Find[${RV_LootArray[${LootCheck}]}]}) {
/echo Keeping a ${Cursor.Name}... WOOT!
/varcalc RV_LootStats[${LootCheck}] ${RV_LootStats[${LootCheck}]}+1
/autoinventory
/delay 1s
}
/next LootCheck
}
/if (${Cursor.ID}) {
/echo Destroying a ${Cursor.Name}...
/destroy
/delay 1s
}
/next LootSlot
/notify LootWnd DoneButton leftmouseup
}
/return

Sub ReadINI(FileName,Loot,ArrayType)
/echo Attempting to Read Information from ${FileName}...
/declare nValues int local 1
/declare nArray int local 0
/declare KeySet string local ${Ini[${FileName}]}
/if (${Ini[${FileName},Loot,-1,NO].Equal[NO]}) {
/echo "${SectionName}" is not a Valid Section for FILE:${FileName}, ending macro...
/delay 1s
/return
}
:CounterLoop
/if (${String[${Ini[${FileName},Loot,${ArrayType}${nValues}]}].Equal[null]}) {
/varcalc nValues ${nValues}-1
/goto :MakeArray
}
/varcalc nValues ${nValues}+1
/goto :CounterLoop

:MakeArray
/if (!${nValues}) /return
/if (${FileName.Equal["AssistLoot.ini"]}&&${nValues}>0) {
/echo Declaring Loot Array...
/declare RV_LootArray[${nValues}] string outer
/declare RV_LootStats[${nValues}] string outer
}
/for nArray 1 to ${nValues}
/if (${FileName.Equal["AssistLoot.ini"]}) {
/varset RV_LootArray[${nArray}] ${Ini[${FileName},Loot,${ArrayType}${nArray}]}
/varset RV_LootStats[${nArray}] 0
}
/next nArray
/echo Information Read Successfully from ${FileName}...
/delay 1s
/return

Sub Event_looterror
/echo You can't loot the corpse!!!
/end
/return

And my AssistLoot.ini:

[Loot]
Loot1=Diamond
Loot2=Lumber
Loot3=Sapphire
Loot4=Spell:
Loot5=Essence
Loot6=Song:
Loot7=Class
Loot8=Immaculate
Loot9=Gemmed
Loot10=Chronal
Loot11=Ancient
Loot12=Extruded
Loot13=The Guardian's Pouch
Loot14=Spongy
Loot15=Brell's
Loot16=Smudged
Loot17=Pallorax
Loot18=Dulled
Loot19=Trade-In
Loot20=Sooty
Loot21=Crystalline
Loot22=Fantastic
Loot23=Pretty
Loot24=Small
Loot25=Tantalum
Loot26=Ruby
Loot27=Miragestone
Loot28=Vanadium
Loot29=Befouled
Loot30=Osmium
Loot31=Scuffed
Loot32=Petite
Loot33=Uncut
Loot34=Tiny
Loot35=Meager
Loot36=Shimmering
Loot37=Exquisite
Loot38=Alaris
Loot39=Gloom
Loot40=Fluffy
Loot41=Pickaxe
Loot42=Fleshborn
Loot43=Energized
Loot44=Planar Energy Shard
Loot45=Antithesis
Loot46=Glowing
Loot47=Median
Loot48=Greater
Loot49=Lesser
Loot50=Minor
Loot51=Fear Touched
Loot52=Dread Mote
Loot53=Apparition Flesh
Loot54=Severed
Loot55=Stick
Loot56=Deceitful Resolve
Loot57=Trick
Loot58=Gloom Mane
Loot59=Stygian
Loot60=Mane of Congealed Revulsion
Loot61=Vanishing
Loot62=Lost
Loot63=The Hole
Loot64=Watcher
Loot65=Frost Bunny
Loot66=People-eater
Loot67=Dark
Loot68=Corrupted Loam
Loot69=Gildorn's
Loot70=Scorched
Loot71=High Quality
Loot72=Fatback
Loot73=Mysterious
Loot74=Strip
Loot75=Sausage
Loot76=Enchanted Stone
Loot77=Natural
Loot78=The Whole
Loot79=The Chief's Influence
Loot80=Taelosian
Loot81=See-through
Loot82=Action
Loot83=Spoon
Loot84=Scroll
Loot85=Invisible
Loot86=Elegant Shank
Loot87=Al-Metes
Loot88=Ornemental Guard Halberd
Loot89=pork chop
Loot90=Exotic
Loot91=Fragment
Loot92=Palladium
Loot93=Medicinal
Loot94=Black sapphire
Loot95=Wretched brain
Loot96=Palladium
Loot97=Writing
Loot98=edam
Loot99=Planar
Loot100=Fresh
Loot101=beautiful
Loot102=Energized
Loot103=bacon
Loot104=Fine
Loot105=Blue Diamond
Loot106=Braxi Horn
Loot107=Goral Fins
Loot108=Deformed
Loot109=Split
Loot110=Warped
Loot111=Ethernere
Loot112=New
Loot113=Encased
Loot114=Phased
Loot115=Ether
Loot116=Shifting
Loot117=Temporal
Loot118=Child
Loot119=Bent
Loot120=Cloth Bolt
Loot121=Steel
Loot122=Bixie Chitin Sword
Loot123=Cosgrove Powder
Loot124=Titanium Ore
Loot125=Metallic Moonglow Bow
Loot126=Spiked Innoruuk Gauntlet
Loot127=Necromancy Ritual Knife
Loot128=Black Powder Pouch
Loot129=Dark Elf
Loot130=Tome
Loot131=Enchanted
Loot132=Jewel-Tipped
Loot133=Stone of Tranquility
Loot134=Ornate Bonecrafter Sword
Loot135=Latent
Loot136=Cristanos
Loot137=Pristine
Loot138=Glowrock
Loot139=Glowstone
Loot140=Glowgem
Loot141=Loam
Loot142=Smooth
Loot143=Magnetized
Loot144=Jacinth
Loot145=Dragon
Loot146=Drake
Loot147=Wyvern
Loot148=Black Marble
Loot149=Immaculate
Loot150=Raw
Loot151=Living
Loot152=Fractured shard
Loot153=August
Loot154=fright
Loot155=horror
Loot156=Leather Roll
Loot157=Jom
Loot158=Ribs
Loot159=Loin
Loot160=Briny
Loot161=Ocean
Loot162=Preserved
Loot163=Combine
Loot164=Damaged
Loot165=Grubson
Loot166=Tideworn
Loot167=Skeletal
Loot168=Deep
Loot169=Carved
Loot170=Aged
Loot171=Sultry
Loot172=Endless
Loot173=Scorched
 
Try this, not positive, but I think it's along the changes eqmule made to ini tlo (I haven't tested with it any yet):

Change:

/if (${Ini[${FileName},Loot,-1,NO].Equal[NO]}) {

To:

/if (${Ini[${FileName},Loot].Count[|]}==0) {
 
Perfect!!
I wish i was you.
Arph