help with /varset timer counting down, and /face

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

2boxingFiend
decaying skeleton
decaying skeleton
Posts: 5
Joined: Tue Dec 16, 2003 11:39 am

help with /varset timer counting down, and /face

Post by 2boxingFiend » Tue Dec 16, 2003 12:07 pm

I'm a first time MQ user. I modified a generic bot script, so that I could have control over when to attack, and slowing down add.

The problem I am having is that the Sub melee loop isn't casting my nuke. And is there a way to use /face without locking my self to the center of the mob. I was getting some motion sickness last night using the bst.mac.

Thank you in advance.

Code: Select all

| bst.mac 
#event Loading "You have been slain by a" 
#event See "You can't see your target"
#event Fizzle "Your spell fizzles!" 
#event Interrupt "Your casting has been interrupted!" 
#event Interrupt "Your spell is interrupted." 
#event Resisted "You target resisted the " 
#event OutOfMana "Insufficient Mana to cast this spell!" 
#event OutOfRange "Your target is out of range, get closer!" 
#event Stunned "You cannot cast while stunned" 
#event Standing "You must be standing to cast a spell" 
#event target "you must first select a target  for this spell" 
#turbo 

Sub Main 
  /declare mytimer global
    :mainLoop
	/if "$combat"=="TRUE" /call melee
    /goto :mainLoop
/return

Sub melee
  /varset mytimer 3s
    :Loop
      /if "$combat"!="TRUE" /return
      /if n $target(distance)>=20 /sendkey down up
      /if n $target(distance)>=18 /sendkey down up
      /if n $target(distance)<=10 /sendkey up up
      /if n $target(distance)<=8 /sendkey up up 
      /face fast
      /doevents
      /if $char(ability,"Kick")>0 /if n $target(distance)<=15 /doability "Kick"
      /if $char(ability,"Begging")>0 /if n $target(distance)<=15 /if n $v30==0 {
      /attack off
      /doability Begging
      /attack on
      }
      /if @mytimer==0 /if n $char(gem,"Frost Spear")!=-2 /if n $char(mana,pct)>15 /call castspell
      /goto :Loop
/return

Sub castspell
/doevent flush
/sendkey up up
/delay 5
/call cast "Frost Spear" 
/varset mytimer 31s 
/return 

Sub Event_Enraged
/varset v30 1
/attack off
/pet hold
/pet back off
/echo Atk off
/sendkey down up
/sendkey up up
/face 
/return 

Sub Event_See
/press down
/face fast
/press down 
/return 

Sub Event_Offrage
/attack on
/pet attack
/return 

Sub Event_Gain
/attack off
/endmacro keep keys 

Sub Event_Loading
/endmacro keep keys

Sub Cast(SpellName)
/if n $char(gem,"@SpellName")==0 
/return CAST_UNKNOWNSPELL
	:StartCast
	/if n $char(gem,"@SpellName")<0 /call WaitForRefresh "@SpellName" /cast "@SpellName"
/return CAST_SUCCESS

Sub WaitForRefresh(SpellName) 
/return 

Sub ClearReturnValue 
/return CAST_SUCCESS 

Sub Event_Fizzle 
/return CAST_RESTART 

Sub event_Interrupt 
/return CAST_RESTART 

Sub Event_Recover
/delay 5 
/return

Sub Event_Standing
/stand
/return CAST_RESTART

Sub Event_OutOfMana
/return CAST_OUTOFMANA

Sub Event_Select
/endmacro keep keys

Sub Event_OutOfRange
/return CAST_OUTOFRANGE

Sub Event_Stunned
/return CAST_STUNNED

Sub Event_Resisted
/return CAST_RESISTED

Sub Event_Stunned
/varset CastStatus CAST_STUNNED
/return

Sub Event_Resisted
/varset CastStatus CAST_RESISTED
/return

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Tue Dec 16, 2003 2:26 pm

Try that:

Code: Select all

| bst.mac 
#event Loading "You have been slain by a" 
#event See "You can't see your target" 
#event Fizzle "Your spell fizzles!" 
#event Interrupt "Your casting has been interrupted!" 
#event Interrupt "Your spell is interrupted." 
#event Resisted "You target resisted the " 
#event OutOfMana "Insufficient Mana to cast this spell!" 
#event OutOfRange "Your target is out of range, get closer!" 
#event Stunned "You cannot cast while stunned" 
#event Standing "You must be standing to cast a spell" 
#event target "you must first select a target  for this spell" 
#turbo 

Sub Main 
  /declare mytimer global 
    :mainLoop 
   /if "$combat"=="TRUE" /call melee 
    /goto :mainLoop 
/return 

Sub melee 
  /varset mytimer 3s 
    :Loop 
      /if "$combat"!="TRUE" /return 
      /if n $target(distance)>=20 /sendkey down up 
      /if n $target(distance)>=18 /sendkey down up 
      /if n $target(distance)<=10 /sendkey up up 
      /if n $target(distance)<=8 /sendkey up up 
      [color=red]/face fast nolook [/color]
      /doevents 
      /if $char(ability,"Kick")>0 /if n $target(distance)<=15 /doability "Kick" 
      /if $char(ability,"Begging")>0 /if n $target(distance)<=15 /if n $v30==0 { 
      /attack off 
      /doability Begging 
      /attack on 
      } 
      [color=red]/if n @mytimer<=0 [/color]/if n $char(gem,"Frost Spear")!=-2 /if n $char(mana,pct)>15 /call castspell 
      /goto :Loop 
/return 

Sub castspell 
/doevent flush 
/sendkey up up 
/delay 5 
/call cast "Frost Spear" 
/varset mytimer 31s 
/return 

Sub Event_Enraged 
/varset v30 1 
/attack off 
/pet hold 
/pet back off 
/echo Atk off 
/sendkey down up 
/sendkey up up 
[color=red]/face fast nolook [/color]
/return 

Sub Event_See 
/press down 
[color=red]/face fast nolook [/color]
/press down 
/return 

Sub Event_Offrage 
/attack on 
/pet attack 
/return 

Sub Event_Gain 
/attack off 
/endmacro keep keys 

Sub Event_Loading 
/endmacro keep keys 

Sub Cast(SpellName) 
/if n $char(gem,"@SpellName")==0 
/return CAST_UNKNOWNSPELL 
   :StartCast 
   /if n $char(gem,"@SpellName")<0 /call WaitForRefresh "@SpellName" /cast "@SpellName" 
/return CAST_SUCCESS 

Sub WaitForRefresh(SpellName) 
/return 

Sub ClearReturnValue 
/return CAST_SUCCESS 

Sub Event_Fizzle 
/return CAST_RESTART 

Sub event_Interrupt 
/return CAST_RESTART 

Sub Event_Recover 
/delay 5 
/return 

Sub Event_Standing 
/stand 
/return CAST_RESTART 

Sub Event_OutOfMana 
/return CAST_OUTOFMANA 

Sub Event_Select 
/endmacro keep keys 

Sub Event_OutOfRange 
/return CAST_OUTOFRANGE 

Sub Event_Stunned 
/return CAST_STUNNED 

Sub Event_Resisted 
/return CAST_RESISTED 

Sub Event_Stunned 
/varset CastStatus CAST_STUNNED 
/return 

Sub Event_Resisted 
/varset CastStatus CAST_RESISTED 
/return