Combine this Bard twist macro with this Sense Heading Macro

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

Moderator: MacroQuest Developers

seph_yaro
a lesser mummy
a lesser mummy
Posts: 72
Joined: Sat Jul 26, 2003 1:12 pm

Combine this Bard twist macro with this Sense Heading Macro

Post by seph_yaro » Sun Aug 10, 2003 2:57 am

This is the twist macro -

Code: Select all

| - Twi.mac - 
| 
#include exp.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!" 
#event Slow      "You slow down" 
#event Outran      "out of range" 
#event Outran      "You cannot see" 

|#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 temp v4 
#define amtem v5 

#define WAITTIME 33   |Cast time of one song. 
#define AMPL 5        |This is the hole that it gets in the queue 
#define SELOS 6       | ^^ditto^^ 

Sub Main 
  /if $p0=="" /return 
  /if $p0==NULL /return 
  /varset nsongs 0 
  /varset v60 0 
  /varset cursong 0 
  /call EXPSETUP 

  /varset a(1,0) $p0 
  /if $p1!="" /varset a(1,1) $p1 
  /if $p2!="" /varset a(1,2) $p2 
  /if $p3!="" /varset a(1,3) $p3 
  /if $p4!="" /varset a(1,4) $p4  
  /if $p5!="" /varset a(1,5) $p5 
  /if $p6!="" /varset a(1,6) $p6 
  /if $p7!="" /varset a(1,7) $p7 
  /if $p8!="" /varset a(1, $p8 
  :setupLoop 
    /if $a(1,$v60)=="amp" { 
      /varcalc temp $v60+1 
      /varset a(0,AMPL) $a(1,$temp) 
      /varadd v60 2 
      /echo Found $char(gem,$a(0,AMPL)) at Gem $a(0,AMPL) 
      /varset amtem 7 
      /goto :setuploop 
    } 
    /if $a(1,$v60)=="selo" { 
      /varcalc temp $v60+1 
      /varset a(0,SELOS) $a(1,$temp) 
      /varadd v60 2 
      /echo Found $char(gem,$a(0,SELOS)) at Gem $a(0,SELOS) 
      /goto :setuploop 
    } 
    /if $a(1,$v60)!="" /if $a(1,$v60)!=NULL { 
      /varset a(0,$int($nsongs)) $int($a(1,$v60)) 
      /echo Song $int($nsongs+1): $char(gem,$a(0,$int($nsongs))) 
      /varadd nsongs 1 
      /varadd v60 1 
      /goto :setuploop 
    } 
  /if n $a(0,SELOS)>0 /varset cursong $a(0,SELOS) 
:Loop 
  /if n $a(0,SELOS)>0 { 
    /if n $t1<=$calc($t0+WAITTIME) /varset cursong SELOS 
    /if n $t1<=WAITTIME /varset t0 1    |INTERRUPTS CURRENT SONG! 
  } 
  /if n $a(0,AMPL)>0 /if n $amtem>6 /varset cursong AMPL 
  /if n $t0<=0 /call Sing $int($a(0,$cursong)) 
  /delay 0 
  /doevents 
  /goto :Loop 
/return 

Sub Sing 
  /varset t0 WAITTIME 
  /if n $cursong==SELOS /varset t1 1500 
  /if n $cursong==AMPL /varset amtem 0 
  /stopsong 
  /cast $p0 
  /varadd amtem 1 
  /varset prevsong $cursong 
  /varadd cursong 1 
  /if n $cursong>=$nsongs /varset cursong 0 
  /doevents 
/return 


Sub Event_MissedNote 
  /varset cursong $prevsong 
  /varsub amtem 1 
  /varset t0 0 
  /doevents 
/return 

Sub Event_Slow 
  /varset cursong SELOS 
  /varset t0 0 
/return 

Sub Event_Outran 
  /varset t0 0 
  /varadd targcount 1 
  /varsub amtem 1 
  /if n $targcount>=4 { 
    /varset targcount 0 
    /tar npc 
  } 
  /doevents 
/return 

Sub Event_Recovered 
  /varset t0 0 
  /varsub amtem 1 
  /varset cursong $prevsong 
  /doevents 
/return 

Sub Event_NeedTarget 
  /varadd targcount 1 
  /if n $targcount>=2 { 
    /varset targcount 0 
    /tar npc 
  } 
  /doevents 
/return
 
and this is the Sense Heading macro -

Code: Select all

| Sense Heading Trainer

sub main 

:senseheadingloop 
   /if n $char(ability,"Sense Heading")>0 /doability "Sense Heading" 
   /if n $char(skill,"Sense Heading")<$calc($calc($char(level)*5)+5)  /goto :senseheadingloop 
/return 
I have read around and all, and tried injecting the sh.mac code into the twi.mac, without success. I have also tried to #include it, also without success. When I include it, it just does the SH macro, and doesn't do any of the twi.mac /sigh

loadingpleasewait
a snow griffon
a snow griffon
Posts: 332
Joined: Sat Sep 14, 2002 8:46 am

Post by loadingpleasewait » Sun Aug 10, 2003 10:59 am

Havnt tested it as I do not have a bard, but this should work

Code: Select all

| - Twi.mac - 
| 
#include exp.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!" 
#event Slow      "You slow down" 
#event Outran      "out of range" 
#event Outran      "You cannot see" 

|#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 temp v4 
#define amtem v5 

#define WAITTIME 33   |Cast time of one song. 
#define AMPL 5        |This is the hole that it gets in the queue 
#define SELOS 6       | ^^ditto^^ 

Sub Main 
  /if $p0=="" /return 
  /if $p0==NULL /return 
  /varset nsongs 0 
  /varset v60 0 
  /varset cursong 0 
  /call EXPSETUP 

  /varset a(1,0) $p0 
  /if $p1!="" /varset a(1,1) $p1 
  /if $p2!="" /varset a(1,2) $p2 
  /if $p3!="" /varset a(1,3) $p3 
  /if $p4!="" /varset a(1,4) $p4  
  /if $p5!="" /varset a(1,5) $p5 
  /if $p6!="" /varset a(1,6) $p6 
  /if $p7!="" /varset a(1,7) $p7 
  /if $p8!="" /varset a(1, $p8 
  :setupLoop 
    /if $a(1,$v60)=="amp" { 
      /varcalc temp $v60+1 
      /varset a(0,AMPL) $a(1,$temp) 
      /varadd v60 2 
      /echo Found $char(gem,$a(0,AMPL)) at Gem $a(0,AMPL) 
      /varset amtem 7 
      /goto :setuploop 
    } 
    /if $a(1,$v60)=="selo" { 
      /varcalc temp $v60+1 
      /varset a(0,SELOS) $a(1,$temp) 
      /varadd v60 2 
      /echo Found $char(gem,$a(0,SELOS)) at Gem $a(0,SELOS) 
      /goto :setuploop 
    } 
    /if $a(1,$v60)!="" /if $a(1,$v60)!=NULL { 
      /varset a(0,$int($nsongs)) $int($a(1,$v60)) 
      /echo Song $int($nsongs+1): $char(gem,$a(0,$int($nsongs))) 
      /varadd nsongs 1 
      /varadd v60 1 
      /goto :setuploop 
    } 
  /if n $a(0,SELOS)>0 /varset cursong $a(0,SELOS) 
:Loop 
  /if n $a(0,SELOS)>0 { 
    /if n $t1<=$calc($t0+WAITTIME) /varset cursong SELOS 
    /if n $t1<=WAITTIME /varset t0 1    |INTERRUPTS CURRENT SONG! 
  } 
  /if n $a(0,AMPL)>0 /if n $amtem>6 /varset cursong AMPL 
  /if n $t0<=0 /call Sing $int($a(0,$cursong)) 
  [b] /if n $char(skill,"Sense Heading")<$calc($calc($char(level)*5)+5)  /call senseheading[/b]
/delay 0 
  /doevents 
  /goto :Loop 
/return 

Sub Sing 
  /varset t0 WAITTIME 
  /if n $cursong==SELOS /varset t1 1500 
  /if n $cursong==AMPL /varset amtem 0 
  /stopsong 
  /cast $p0 
  /varadd amtem 1 
  /varset prevsong $cursong 
  /varadd cursong 1 
  /if n $cursong>=$nsongs /varset cursong 0 
  /doevents 
/return 


Sub Event_MissedNote 
  /varset cursong $prevsong 
  /varsub amtem 1 
  /varset t0 0 
  /doevents 
/return 

Sub Event_Slow 
  /varset cursong SELOS 
  /varset t0 0 
/return 

Sub Event_Outran 
  /varset t0 0 
  /varadd targcount 1 
  /varsub amtem 1 
  /if n $targcount>=4 { 
    /varset targcount 0 
    /tar npc 
  } 
  /doevents 
/return 

Sub Event_Recovered 
  /varset t0 0 
  /varsub amtem 1 
  /varset cursong $prevsong 
  /doevents 
/return 

Sub senseheading
[b]    /if n $char(ability,"Sense Heading")>0 /doability "Sense Heading" 
/return[/b]

Sub Event_NeedTarget 
  /varadd targcount 1 
  /if n $targcount>=2 { 
    /varset targcount 0 
    /tar npc 
  } 
  /doevents 
/return 
LOADING PLEASE WAIT...

seph_yaro
a lesser mummy
a lesser mummy
Posts: 72
Joined: Sat Jul 26, 2003 1:12 pm

Post by seph_yaro » Tue Aug 12, 2003 6:53 am

thanks :-) will test it soon as i get the chance

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

Post by L124RD » Tue Aug 12, 2003 11:45 am

Salutations,
Yeah, something like that.
loadingpleasewait: why did you decide to call a function instead of putting it in one line?

seph_yaro
a lesser mummy
a lesser mummy
Posts: 72
Joined: Sat Jul 26, 2003 1:12 pm

Post by seph_yaro » Sat Aug 16, 2003 5:42 am

Neither of the code's were done by me. Just wanted to combine them... totalnewbie to this kind of coding :-)
And, yes, it does work. With a minor burp every so many loops

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

Post by TheColonel » Sun Aug 24, 2003 2:34 pm

Either way would work... I never even thought about adding that, as I was the kid who sat down and wrote a macro to skill my instruments while doing sense heading and forage... but that was back in the oldui days...
Hell hath no fury like a woman's scorn for EQ.
-==(UDIC)==-