Circling a mob.

Macro requests from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

TheColonel
of what?
of what?
Posts: 164
Joined: Thu Oct 10, 2002 6:34 pm
Location: Golden, CO
Contact:

Circling a mob.

Post by TheColonel » Sat Dec 28, 2002 7:05 am

Useful for a bard, easily done, but how would you go about twisting and circling it... It may actually be better to use specific loc's in a given zone, because chant-kiting a red mob becomes quite painful if you're stuck to a tree. I've been fooling around for the last few days, can't seem to get something to work 100% of the time. Actually... most of it is near 0% but sometimes...
Hell hath no fury like a woman's scorn for EQ.
-==(UDIC)==-

TheColonel
of what?
of what?
Posts: 164
Joined: Thu Oct 10, 2002 6:34 pm
Location: Golden, CO
Contact:

Post by TheColonel » Sat Dec 28, 2002 8:26 am

Bah! This is the best I could figure, dunno about them silly friggin' headings. any help, and I'd consider you my gawd for the evening...

Code: Select all

| - Twist1.mac - 
| 
#event MissedNote "You miss a note, bringing your song to a close!" 
#event Recovered "You haven't recovered yet..." 
#event NeedTarget "You must first select a target for this spell!" 

|#chat tell 
| Read what Event_chat is setup to do before uncommenting it. 

| song queue.  prev/next aren't really doing anything useful 
| right now, I just have them there in case I find a good use later 
#define prevsong v0 
#define cursong v1 
#define nextsong v2 

#define nsongs v3 
#define switch v4 

#define waittime 30 

Sub Main 
  /sendkey down w
  /if $p0=="" /return 
  /if $p0==NULL /return 

  /varset nsongs 1 

  /varset a(0,1) $p0   | First song 
  /echo Song 1: $char(gem,$p0) 

  /if $p1!="" /if $p1!=NULL { 
            /varadd nsongs 1 
            /varset a(0,2) $p1 
            /echo Song 2: $char(gem,$p1) 
      } 

  /if $p2!="" /if $p2!=NULL { 
            /varadd nsongs 1 
            /varset a(0,3) $p2 
            /echo Song 3: $char(gem,$p2) 
      } 

  /if $p3!="" /if $p3!=NULL { 
            /varadd nsongs 1 
            /varset a(0,4) $p3 
            /echo Song 4: $char(gem,$p3) 
      } 

  /varset cursong 1 
  /varset nextsong 2 
  /varset switch 0 

:Sing 
  /stopsong 
  /call circ 2 

  /cast $int($a(0,$cursong)) 
| /echo Playing: $char(gem,$int($a(0,$cursong))) 
  /call circ 1 
  /doevents 

  /if n $switch==1 { 
   /varset switch 0 
   /goto :Sing 
  } 

  /call circ 30

  /varset prevsong $cursong 
  /varset cursong $nextsong 
  /varset nextsong $int($calc($nextsong+1)) 

  /if n $nextsong>$nsongs /varset nextsong 1 

  /goto :Sing 
/return 

sub circ 
:turn
  /if n $target(distance)>150 /if n $calc($target(headingto)-$char(heading)<0 { 
     /face heading $calc($target(headingto)+70) 
  } else { 
    /face heading $calc($target(headingto)-70) 
  }    
  /if n $target(distance)<75 /if n $calc($target(headingto)-$char(heading)<0 { 
     /face heading $calc($target(headingto)+110) 
  } else { 
    /face heading $calc($target(headingto)-110) 
  }  
  /delay 1 
  /varcalc p0 $p0-1
  /if n $p0==0 /return 
  /goto :turn
/return

Sub Event_MissedNote 
  /cast $int($a(0,$cursong)) 
  /call circ 4 
  /doevents 
/return 

Sub Event_Recovered 
  /cast $int($a(0,$cursong)) 
  /call circ 4
  /doevents 
/return 

Sub Event_chat 
  /if "$p2"~~"assist me" { 
    /assist $p1 
    /call circ 2 
    /g assisting $p1 on %t 
  } 

  /if "$p2"~~"camp" { 
    /sit 
    /camp 
    /end 
  } 
/return 

Sub Event_NeedTarget 
  /varset prevsong $cursong 
  /varset cursong $nextsong 
  /varset nextsong $int($calc($nextsong+1)) 

  /if n $nextsong>$nsongs /varset nextsong 1 

  /varset switch 1 
/return
Hope I got the code block dealy in there right... We'll see!

(It's messy, I bastardized Phantal's twisting macro...)
Hell hath no fury like a woman's scorn for EQ.
-==(UDIC)==-

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Sat Dec 28, 2002 2:10 pm

Salutations,
so you're tryign to circle it or... ? I would suggest looking at the backstab script so taht you can goto a poitn around a mob, then just set it to go in front 100 clicks or whatever...

TheColonel
of what?
of what?
Posts: 164
Joined: Thu Oct 10, 2002 6:34 pm
Location: Golden, CO
Contact:

Post by TheColonel » Sat Dec 28, 2002 3:08 pm

Hmm... that sounds about 10,000 times easier than what I was trying... The logic that I came up with last night wasn't exactly a circle... it was (supposed) to turn more towards the mob if you get more than 150 away, and more away if you get too close. Which worked ok in my mind, but I ended up dead to a mob 4 levels my elder. =(
Hell hath no fury like a woman's scorn for EQ.
-==(UDIC)==-

User avatar
SingleServing
a hill giant
a hill giant
Posts: 195
Joined: Tue Dec 17, 2002 11:00 pm

or...

Post by SingleServing » Sat Dec 28, 2002 9:26 pm

not sure at the exact syntax and I don't feel like looking it up but this is as easy as it gets without stealing code...(that I can think of at least)

Sub Main

/autorun 1

:Loop

/face heading $v01
/delay 10
/varadd v01 10
/goto :Loop

/return

That should get you running in a circle....

If you want to make a check to see if your stuck just add 180 to turn them around and run from CW to CCW or CCW to CW....then you can slightly change the step per loop (ie /varadd v01 7) so you don't hit the same thing again. Edit: you'll want to change it to /varsub v01 7 if you turn 180 deg sorry :wink: /varadd = CCW /varsub = CW (I think, havn't tested this)


I'm not sure how face reacts to values over 359, I assume it decrements the number by 360 (or increases if <0) until the value is 359 or less (&>0)..other wise just do something like

/if n $v01>=350 /varset v01 0

I put the > in just incase you get lag spike might want to make it 340 if lag is really bad

If you want bigger circles decrease the step per cycle or add a delay your choice

I have only played a bard to 8 so I don't know if you want to dot them and run around them until dot wears of then wait for them to get in range and run again or if you want them in range the entire time or even what the DOT range is!!

Your level will change your run speed etc etc and that changes more vars, might be able to make an equation on the size of the circle you want based on your run speed with $char(speed) ....nm I'm just starting to ramble :roll:
[color=DarkBlue]Everything,[/color] [color=DarkBlue][b]is[/b][/color] [color=black]black[/color] [color=DarkBlue]and[/color] [color=white]white[/color][color=DarkBlue], when you zoom out it looks[/color] [color=gray]grey[/color][color=DarkBlue].[/color]

TheColonel
of what?
of what?
Posts: 164
Joined: Thu Oct 10, 2002 6:34 pm
Location: Golden, CO
Contact:

Post by TheColonel » Sun Dec 29, 2002 12:18 pm

Ok... it's all coming together, by tonight I'll have something beautiful posted... but ATM I've got a question.... on timers and events, can you make a timer an event? Well... kinda... umm... yeah, as opposed to a... well what are event's limited to? ONLY text from the chat box? or can you use a regular old bool value? If not, then I'm just gonna have to make a loop with some timer 'if' statements.
Hell hath no fury like a woman's scorn for EQ.
-==(UDIC)==-

TheColonel
of what?
of what?
Posts: 164
Joined: Thu Oct 10, 2002 6:34 pm
Location: Golden, CO
Contact:

Post by TheColonel » Sun Dec 29, 2002 1:34 pm

Well... I got something that works, I hard-coded a loc to circle(it's in DSP if you're curious)... it seems to stay around 70-80 clicks away, which is about right. I found out quickly that circling a mob was gonna put you in trouble fast.... so instead it just circles a loc, and hopes that the mob is slower than you. Being a bard, that's hard to screw up. =) But anyhow I envoke it with "/mac twist1 1 2 3" for spell gems, 1, 2, and 3... I gotta give credit to Phantal since it was his twist script that got mangled... but anyhow, I'll stop typing and just copy/paste.

Code: Select all

| - Twist1.mac - 
| 
#event MissedNote "You miss a note, bringing your song to a close!" 
#event Recovered "You haven't recovered yet..." 
#event NeedTarget "You must first select a target for this spell!" 

#define cursong v1 

#define nsongs v3 
#define switch v4 

Sub Main 
  /if $p0=="" /return 
  /if $p0==NULL /return 

  /varset nsongs 1 

  /varset a(0,1) $p0   | First song 
  /echo Song 1: $char(gem,$p0) 

  /if $p1!="" /if $p1!=NULL { 
            /varadd nsongs 1 
            /varset a(0,2) $p1 
            /echo Song 2: $char(gem,$p1) 
      } 

  /if $p2!="" /if $p2!=NULL { 
            /varadd nsongs 1 
            /varset a(0,3) $p2 
            /echo Song 3: $char(gem,$p2) 
      } 

  /if $p3!="" /if $p3!=NULL { 
            /varadd nsongs 1 
            /varset a(0,4) $p3 
            /echo Song 4: $char(gem,$p3) 
      } 

  /varset cursong 1 
  /varset switch 0 
  /varset t0 33
:Loop
  /if n $t0<=0 /call Sing $int($a(0,$cursong))
  /call circ 1487 -1123
  /doevents
/goto :Loop

/return


Sub Sing
:Sing 
  /varset t0 33
  /stopsong 
  /cast $P0
  /delay 0
  /doevents
  /if n $switch==1 { 
   /varset switch 0 
   /goto :Sing 
  } 
  /varadd cursong 1
  /if n $cursong>$nsongs /varset cursong 1
/return 

sub circ 
  /if n $distance($p0,$p1)>300 {
    /face heading $calc($heading($p0,$p1))
  } else /if n $distance($p0,$p1)>100 {
    /face heading $calc($heading($p0,p1)+100)
  } else /face heading $calc($heading($p0,$p1)+80)
/return

Sub Event_MissedNote 
  /cast $int($a(0,$cursong)) 
  /delay 0
  /doevents 
/return 

Sub Event_Recovered 
  /cast $int($a(0,$cursong)) 
  /delay 0
  /doevents 
/return 

Sub Event_NeedTarget 
  /varset prevsong $cursong 
  /varset cursong $nextsong 
  /varset nextsong $int($calc($nextsong+1)) 

  /if n $nextsong>$nsongs /varset nextsong 1 

  /varset switch 1 
/return
I used a timer to get the songs to go off when they should, and just looped, seems to work flawlessly... let me know! =)
Hell hath no fury like a woman's scorn for EQ.
-==(UDIC)==-