/varset Locations?

Tempest

Lifetimer
Joined
Jul 20, 2008
Messages
278
Reaction score
0
Points
16
Hi guys, I had been using the LS MM macro a while back and noticed an interesting use of locations...

I was wondering how it worked so I could use it is a mac I have to kill static spawns in instances rather then just warping and targeting...

An extract that I would have thought would do the job (or close to it) that I have taken from the MM mac is below... Any ideas what I am missing?

I usually get the error "/for loop using invalid variable".

Thanks

Code:
Sub Main

/declare Mobloc[3]  string outer
/declare intcount	int local
/call Warping
/return

Sub Warping

/varset Mobloc[1]	-485, -483, 73
/varset Mobloc[2]	-504, -535, 58
/varset Mobloc[3]	-471, -570, 44


:warploop
/echo testing
/delay 5s

/warp loc ${Mobloc[${intcount}]}
/goto :warploop
/next intcount
/end
/return
 
Last edited:
Hi guys, I had been using the LS MM macro a while back and noticed an interesting use of locations...

I was wondering how it worked so I could use it is a mac I have to kill static spawns in instances rather then just warping and targeting...

An extract that I would have thought would do the job (or close to it) that I have taken from the MM mac is below... Any ideas what I am missing?

I usually get the error "/for loop using invalid variable".

Thanks

Code:
Sub Main

/declare Mobloc[3]  string outer
/declare intcount	int local
/call Warping
/return

Sub Warping

/varset Mobloc[1]	-485, -483, 73
/varset Mobloc[2]	-504, -535, 58
/varset Mobloc[3]	-471, -570, 44


:warploop
/echo testing
/delay 5s

/warp loc ${Mobloc[${intcount}]}
/goto :warploop
/next intcount
/end
/return
I don't even see a /for heh.

intcount is delcared local (to sub main), change it to outer, or move declare to the sub you use it in (Warping).
 
Thanks!

Thanks for that HTW, I will give it a shot tonight when I get home.

The /for I must have removed on the many attempts at changing it around to get it to work.

Thanks again, and will repost if it works/has any more issues.
 
Hmmmm Tried the below (Changed the Local to Outer but it still doesn't seem to be working. Says "You must provide <y> <x> <z> if going to a location...

Code:
Sub Main

/declare Mobloc[3]  string outer
/declare intcount	int Outer
/call Warping
/return

Sub Warping

/varset Mobloc[1]	-485, -483, 73
/varset Mobloc[2]	-504, -535, 58
/varset Mobloc[3]	-471, -570, 44


:warploop
/echo testing
/delay 5s

/warp loc ${Mobloc[${intcount}]}
/goto :warploop
/next intcount
/end
/return
 
Hmmm

Nope the Capital O was not the issue.

Also while I remember I did try changing intcount to outer and tried moving the declare to the warping sub...

I am missing something lol.
 
/varset Mobloc[1] -485, -483, 73
/varset Mobloc[2] -504, -535, 58
/varset Mobloc[3] -471, -570, 44

You can't do that.

Well.. you can, but it won't do what you expect.

htw
 
What I am trying to do is have it...

Warp to Loc [1] /check for near by mobs (If any do combat sub)

Warp to Loc [2] /check for near by mobs (If any do combat sub)

Warp to Loc [3] /check for near by mobs (If any do combat sub)

in that order and not have to repeat past locs.

At the moment I am warping to each loc each time even if I have checked there 5 times already...

Isn't this what this bit of coding would do? Obviously I need the /call Combat, but I can add that in later. Just trying to get this working and try understand how something works...

Or is there something I am missing?
 
Your last posted code looks like it will never exit the :warploop. Try adding in a conditional to exit it. Something like adding a counter and each time you check a loc add 1 to it, and when your counter equals the number of locs to check, you can have it exit the warploop. Wiht that last code are you warping to all of the locs? or just one loc over and over?
 
Code:
[B]/varset Mobloc[1]	-485, -483, 73
/varset Mobloc[2]	-504, -535, 58
/varset Mobloc[3]	-471, -570, 44[/B]

As HTW said I dont think you can do this.

You need to do something like this
Code:
/declare MoblocX[3] int outer
/declare MoblocY[3] int outer
/declare MoblocZ[3] int outer
/varset MoblocX[1] -485
/varset MoblocY[1] -483
/varset MoblocZ[1] 73

/varset MoblocX[2] -485
/varset MoblocY[2] -483
/varset MoblocZ[2] 73

/varset MoblocX[3] -485
/varset MoblocY[3] -483
/varset MoblocZ[3] 73
 
Hmmmm ok... Will give that a go tonight after work...

But on the LS Monster Mission Macro that I got the idea from it has the below... But either way would be good lol.

Code:
/declare Waittimer	int outer	0
/declare Missiontimer	timer outer	0
/declare WinCount	int outer	0
/declare Goblincount	int outer	0
/declare Currentzone	string outer	${Zone.ID}
/declare Goblinloc[24]  string outer
/declare InPullLoop     int outer       0
/varset Goblinloc[1]	-485 -483 73
/varset Goblinloc[2]	-504 -535 58
/varset Goblinloc[3]	-471 -570 44
/varset Goblinloc[4]	-565 -558 55
/varset Goblinloc[5]	-546 -657 55
/varset Goblinloc[6]	-621 -675 49
/varset Goblinloc[7]	-530 -705 51
/varset Goblinloc[8]	-543 -789 50
/varset Goblinloc[9]	-568 -841 43
/varset Goblinloc[10]	-574 -901 42
/varset Goblinloc[11]	-495 -633 55
/varset Goblinloc[12]	-447 -611 55
/varset Goblinloc[13]	-441 -746 33
/varset Goblinloc[14]	-419 -777 43
/varset Goblinloc[15]	-368 -566 38
/varset Goblinloc[16]	-655 -541 44
/varset Goblinloc[17]	-435 -869 42
/varset Goblinloc[18]	-387 -890 44
/varset Goblinloc[19]	-439 -922 43
/varset Goblinloc[20]	-356 -614 56
/varset Goblinloc[21]	-338 -663 56
/varset Goblinloc[22]	-365 -778 44
/varset Goblinloc[23]	-330 -744 44
/varset Goblinloc[24]	-539 -915 42
 
It looks like you still have a fundamental problem with the subroutine in that you have a /next without a /for (/next was never getting executed) and therefore nothing was incrementing intcount. You should also get rid of the , in the loc.

Try this for Sub Warping:

Code:
Sub Warping

/varset Mobloc[1]	[COLOR="Red"]-485 -483 73[/COLOR]
/varset Mobloc[2]	[COLOR="Red"]-504 -535 58[/COLOR]
/varset Mobloc[3]	[COLOR="Red"]-471 -570 44[/COLOR]


[COLOR="Red"]/for intcount 1 to 3[/COLOR]
/echo testing
/delay 5s

/warp loc ${Mobloc[${intcount}]}
/next intcount
/end
/return
 
Thanks for the try Blujahz, but that one doesn't quite work either...

It does an Echo, pause, Echo, pause, echo pause then ends

So almost there except for the warp part! :)

Any more ideas guys?
 
Was just thinking there may be another way around it...

If there a way to check if a particular named mob (Even just trash) is up?

It would be less versatile but for particular targets it would still be ok... Still very interested to try and get the /varset working...

I could do a...

Code:
/tar A Mob
/if (${Target.ID}) {
	/warp t
}
/tar A Different Mob
/if (${Target.ID}) {
	/warp t
}

But I have always read that lots of spam targets are bad and to use a Spawn count of some kind, but I haven't been able to figure out how to use it or if it is even possible...

Code:
/if (${SpawnCount["A Mob"]}) { /tar A Mob
	/warp t
}
/if (${SpawnCount["A Different Mob"]}) { /tar A Mob
	/warp t
}
 
I tested your macro with the changes Blujahzs suggested, and it worked just fine for me. The only difference between my code and yours was the locations (i did my test in a dain MM)

Code:
Sub Main
/declare Mobloc[3]  string outer
/declare intcount	int outer

/call Warping
/return

Sub Warping
/varset Mobloc[1]	-1894 -3912 254
/varset Mobloc[2]	-1922 -3867 251
/varset Mobloc[3]	-1928 -3929 251

/for intcount 1 to 3
/echo testing
/delay 5s
/warp loc ${Mobloc[${intcount}]}
/next intcount

/end
/return

You could try the SpawnCount way with

Code:
/if (${SpawnCount[radius # loc x y]}>=1) { 
        /tar ${NearestSpawn[radius # loc x y]}
	/warp t
}
 
I use alert lists for named as they change per zone and you do not have to hard code them

Code:
/alert add 1 npc SomeName
/alert add 1 npc SomeName2
/alert add 2npc SomeNameYouWantToAvoid


/if (${SpawnCount[npc alert 1 noalert 2]}) {
/target alert 1 noalert 2
/delay 5
/warp t
}