stick.mac (Version: 2.25.04a)

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

LamahHerder
a hill giant
a hill giant
Posts: 299
Joined: Sat Jun 29, 2002 2:37 am

stick.mac (Version: 2.25.04a)

Post by LamahHerder » Sat Feb 07, 2004 4:16 am

For those of us that are tired of clicking combat abilities and chasing mobs.

Basically what it does,
When you attack a NPC, if it is within 150range....
-It will stick to the NPC, attack and do special abilities until it dies.
-It will pause attacking if: you are stunned, on mob enrage
-It will end combat loop if: you switch targets, mob dies, mob gates, you turn off attack
-On the fly taunt toggle/usage
-Keeps stick-npc.ini, currently only info inside is melee distance
(edit your stick-NPC.ini for ae-rampage mobs / mobs with huge hitbox)
-Keeps stick-pc.ini, currently used for combat abilities + default settings
-It also will auto /loot NPC's you gain exp for, as in it will open the corpse and grant you loot rights
(if you were allowed to normally)
-On the fly NinjaLewt usage


Spellcast.inc is commented out along with SK specific code, remove if your a 65 sk with the spells.
http://macroquest2.com/phpBB2/viewtopic ... 6289#36289
I play a SK now so has some sk specific spell useage inside it, this will not effect other class's.




------------------------

Basic usage:
1. First time use per character will create info in stick-pc.ini and you will need to edit & restart.

2. macro will accept 4 paramaters at start, if no params it will use defaults from stick-pc.ini.

3. Syntax = /mac stick "NinjaLoot (0 or 1)" "MeleeAbility_1" "MeleeAbility_2" "MeleeAbility_3"

Taunt Usage:
Basically 4 ways to do this..

1. Change a CombatAbility_# from NULL to "taunt" in stick-pc.ini
2. start it with /mac stick 0 taunt
3. "/echo tt" will toggle taunting on or off,
4. Manually use taunt ability during a fight will taunt that mob until attack loop is ended.
(next mob will not be taunted)

-------------

==================================
Future plans:
1. npc specific ini support for..
a) ranged only fights (fennin etc, for rangers)
b) ???

2. Character/Class specific ini support for...
a) Always arrow fight
b) self spell/item combat and rest buffs

3. better ninjaloot logic (for green cons)

4. stop attacking on mez (soon as i figure something out)

5. logic to decide if should move behind mob
(if your tanking dont want to run in circles and look stupid)

6. Universal combat spell implementation. (possible pure int/wis caster support then)

7. a FAST clean way to find max melee so you dont have to edit stick-npc.ini (everything i have tried is too slow thus annoying)

8. as always... code improvements / logic improvements.

==================================


Only problems i have had so far are with rathe council event / mob you are fighting gets mez'd.
I and many other people run this script 24/7 on our melees and it works great.

Any suggestions are appreciated.
Enjoy.
BUFF's ARE NOT IMPLEMENTED IN THIS VERSION
that is just a placeholder in the ini's

Code: Select all

|===========|
| 02.25.04a |
|___________|
|           |
| stick.mac |
|  by m0nk  |
|___________|
|
| -Syntax = /mac stick "NinjaLoot (0 or 1)" "MeleeAbility_1" "MeleeAbility_2" "MeleeAbility_3"
| example = /mac stick 0 "bash" (will not loot and only bash)
| example = /mac stick 1 "Flying Kick" "Disarm" (will loot, Flying Kick ,disarm)
| example = /mac stick (will do what the defaults are set to in the stick-pc.ini file)
|
#turbo
#define MOBini "stick-npc.ini"
#define PCini "stick-pc.ini
|#include spellcast.inc

#event EXP "experience!!"
#event RageON "has become ENRAGED."
#event RageOFF "is no longer enraged"
#event MobGate " Gates."
#event Invited "To join the group, click on the 'FOLLOW' option, or 'DISBAND' to cancel"
#event StunON "You are stunned"
#event StunON "You lose control of yourself!"
#event StunOFF "You are unstunned"
#event StunOFF "You have control of yourself again."
#event TauntThisRound "to ignore others and attack you!"
#event ToggleTaunt "[MQ2] tt"
#event ToggleNinja "[MQ2] nl"

Sub main
	:setupDeclare
		/zapvars
		/declare MA_SB global
		/declare MobID global
		/declare CharX global
		/declare CharY global
		/declare Time_MA_SB timer
		/declare NinjaLewt global
		/declare RestBuff_1 global
		/declare RestBuff_2 global
		/declare RestBuff_3 global
		/declare RestBuff_4 global
		/declare RestBuff_5 global
		/declare RestBuff_6 global
		/declare RestBuff_7 global
		/declare RestBuff_8 global
		/declare CmbtBuff_1 global
		/declare CmbtBuff_2 global
		/declare CmbtBuff_3 global
		/declare CmbtBuff_4 global
		/declare CmbtBuff_5 global
		/declare CmbtBuff_6 global
		/declare CmbtBuff_7 global
		/declare CmbtBuff_8 global
		/declare TauntToggle global
		/declare MA_Timer_SB global
		/declare MeleeAttack_1 global
		/declare MeleeAttack_2 global
		/declare MeleeAttack_3 global
		/declare MeleeDistance global
		/declare RestItemBuff_1 global
		/declare RestItemBuff_2 global
		/declare RestItemBuff_3 global
		/declare RestItemBuff_4 global
		/declare RestItemBuff_5 global
		/declare RestItemBuff_6 global
		/declare RestItemBuff_7 global
		/declare RestItemBuff_8 global
		/declare CmbtItemBuff_1 global
		/declare CmbtItemBuff_2 global
		/declare CmbtItemBuff_3 global
		/declare CmbtItemBuff_4 global
		/declare CmbtItemBuff_5 global
		/declare CmbtItemBuff_6 global
		/declare CmbtItemBuff_7 global
		/declare CmbtItemBuff_8 global
		/declare DefaultMeleeDistance global

	:setupVarset
		/varset MA_SB "NULL"
		/varset MeleeAttack_1 "@Param1"
		/varset MeleeAttack_2 "@Param2"
		/varset MeleeAttack_3 "@Param3"
		/varset MA_Timer_SB 60
		/varset TauntToggle NULL
		/varset NinjaLewt "@Param0"

	:setPCiniOther
		/if $defined(Param0)!=TRUE /varset NinjaLewt $ini("PCini","$char(name)","NinjaLewt")
		/if "@NinjaLewt"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "NinjaLewt" "0"
			/delay 0
			/varset NinjaLewt $ini("PCini","$char(name)","NinjaLewt")
			}

		/if $defined(Param1)!=TRUE /varset MeleeAttack_1 $ini("PCini","$char(name)","MeleeAttack_1")
		/if "@MeleeAttack_1"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "MeleeAttack_1" "NULL"
			/delay 0
			/varset MeleeAttack_1 $ini("PCini","$char(name)","MeleeAttack_1")
			}

		/if $defined(Param2)!=TRUE /varset MeleeAttack_2 $ini("PCini","$char(name)","MeleeAttack_2")
		/if "@MeleeAttack_2"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "MeleeAttack_2" "NULL"
			/delay 0
			/varset MeleeAttack_2 $ini("PCini","$char(name)","MeleeAttack_2")
			}

		/if $defined(Param3)!=TRUE /varset MeleeAttack_3 $ini("PCini","$char(name)","MeleeAttack_3")
		/if "@MeleeAttack_3"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "MeleeAttack_3" "NULL"
			/delay 0
			/varset MeleeAttack_3 $ini("PCini","$char(name)","MeleeAttack_3")
			}

		/varset DefaultMeleeDistance $ini("PCini","$char(name)","DefaultMeleeDistance")
		/if "@DefaultMeleeDistance"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "DefaultMeleeDistance" "15"
			/delay 0
			/varset DefaultMeleeDistance $ini("PCini","$char(name)","DefaultMeleeDistance")
			}

	:setPCiniBuffs
		/varset RestBuff_1 "$ini("PCini","$char(name)","RestBuff_1")"
		/if "@RestBuff_1"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "RestBuff_1" "NULL"
			/delay 0
			/varset RestBuff_1 $ini("PCini","$char(name)","RestBuff_1")
			}
		/varset RestBuff_2 $ini("PCini","$char(name)","RestBuff_2")
		/if "@RestBuff_2"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "RestBuff_2" "NULL"
			/delay 0
			/varset RestBuff_2 $ini("PCini","$char(name)","RestBuff_2")
			}
		/varset RestBuff_3 $ini("PCini","$char(name)","RestBuff_3")
		/if "@RestBuff_3"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "RestBuff_3" "NULL"
			/delay 0
			/varset RestBuff_3 $ini("PCini","$char(name)","RestBuff_3")
			}
		/varset RestBuff_4 $ini("PCini","$char(name)","RestBuff_4")
		/if "@RestBuff_4"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "RestBuff_4" "NULL"
			/delay 0
			/varset RestBuff_4 $ini("PCini","$char(name)","RestBuff_4")
			}
		/varset RestBuff_5 $ini("PCini","$char(name)","RestBuff_5")
		/if "@RestBuff_5"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "RestBuff_5" "NULL"
			/delay 0
			/varset RestBuff_5 $ini("PCini","$char(name)","RestBuff_5")
			}
		/varset RestBuff_6 $ini("PCini","$char(name)","RestBuff_6")
		/if "@RestBuff_6"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "RestBuff_6" "NULL"
			/delay 0
			/varset RestBuff_6 $ini("PCini","$char(name)","RestBuff_6")
			}
		/varset RestBuff_7 $ini("PCini","$char(name)","RestBuff_7")
		/if "@RestBuff_7"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "RestBuff_7" "NULL"
			/delay 0
			/varset RestBuff_7 $ini("PCini","$char(name)","RestBuff_7")
			}
		/varset RestBuff_8 $ini("PCini","$char(name)","RestBuff_8")
		/if "@RestBuff_8"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "RestBuff_8" "NULL"
			/delay 0
			/varset RestBuff_8 $ini("PCini","$char(name)","RestBuff_8")
			}
		/varset CmbtBuff_1 "$ini("PCini","$char(name)","CmbtBuff_1")"
		/if "@CmbtBuff_1"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "CmbtBuff_1" "NULL"
			/delay 0
			/varset CmbtBuff_1 $ini("PCini","$char(name)","CmbtBuff_1")
			}
		/varset CmbtBuff_2 $ini("PCini","$char(name)","CmbtBuff_2")
		/if "@CmbtBuff_2"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "CmbtBuff_2" "NULL"
			/delay 0
			/varset CmbtBuff_2 $ini("PCini","$char(name)","CmbtBuff_2")
			}
		/varset CmbtBuff_3 $ini("PCini","$char(name)","CmbtBuff_3")
		/if "@CmbtBuff_3"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "CmbtBuff_3" "NULL"
			/delay 0
			/varset CmbtBuff_3 $ini("PCini","$char(name)","CmbtBuff_3")
			}
		/varset CmbtBuff_4 $ini("PCini","$char(name)","CmbtBuff_4")
		/if "@CmbtBuff_4"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "CmbtBuff_4" "NULL"
			/delay 0
			/varset CmbtBuff_4 $ini("PCini","$char(name)","CmbtBuff_4")
			}
		/varset CmbtBuff_5 $ini("PCini","$char(name)","CmbtBuff_5")
		/if "@CmbtBuff_5"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "CmbtBuff_5" "NULL"
			/delay 0
			/varset CmbtBuff_5 $ini("PCini","$char(name)","CmbtBuff_5")
			}
		/varset CmbtBuff_6 $ini("PCini","$char(name)","CmbtBuff_6")
		/if "@CmbtBuff_6"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "CmbtBuff_6" "NULL"
			/delay 0
			/varset CmbtBuff_6 $ini("PCini","$char(name)","CmbtBuff_6")
			}
		/varset CmbtBuff_7 $ini("PCini","$char(name)","CmbtBuff_7")
		/if "@CmbtBuff_7"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "CmbtBuff_7" "NULL"
			/delay 0
			/varset CmbtBuff_7 $ini("PCini","$char(name)","CmbtBuff_7")
			}
		/varset CmbtBuff_8 $ini("PCini","$char(name)","CmbtBuff_8")
		/if "@CmbtBuff_8"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "CmbtBuff_8" "NULL"
			/delay 0
			/varset CmbtBuff_8 $ini("PCini","$char(name)","CmbtBuff_8")
			}
		/varset RestItemBuff_1 "$ini("PCini","$char(name)","RestItemBuff_1")"
		/if "@RestItemBuff_1"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "RestItemBuff_1" "NULL"
			/delay 0
			/varset RestItemBuff_1 $ini("PCini","$char(name)","RestItemBuff_1")
			}
		/varset RestItemBuff_2 $ini("PCini","$char(name)","RestItemBuff_2")
		/if "@RestItemBuff_2"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "RestItemBuff_2" "NULL"
			/delay 0
			/varset RestItemBuff_2 $ini("PCini","$char(name)","RestItemBuff_2")
			}
		/varset RestItemBuff_3 $ini("PCini","$char(name)","RestItemBuff_3")
		/if "@RestItemBuff_3"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "RestItemBuff_3" "NULL"
			/delay 0
			/varset RestItemBuff_3 $ini("PCini","$char(name)","RestItemBuff_3")
			}
		/varset RestItemBuff_4 $ini("PCini","$char(name)","RestItemBuff_4")
		/if "@RestItemBuff_4"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "RestItemBuff_4" "NULL"
			/delay 0
			/varset RestItemBuff_4 $ini("PCini","$char(name)","RestItemBuff_4")
			}
		/varset RestItemBuff_5 $ini("PCini","$char(name)","RestItemBuff_5")
		/if "@RestItemBuff_5"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "RestItemBuff_5" "NULL"
			/delay 0
			/varset RestItemBuff_5 $ini("PCini","$char(name)","RestItemBuff_5")
			}
		/varset RestItemBuff_6 $ini("PCini","$char(name)","RestItemBuff_6")
		/if "@RestItemBuff_6"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "RestItemBuff_6" "NULL"
			/delay 0
			/varset RestItemBuff_6 $ini("PCini","$char(name)","RestItemBuff_6")
			}
		/varset RestItemBuff_7 $ini("PCini","$char(name)","RestItemBuff_7")
		/if "@RestItemBuff_7"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "RestItemBuff_7" "NULL"
			/delay 0
			/varset RestItemBuff_7 $ini("PCini","$char(name)","RestItemBuff_7")
			}
		/varset RestItemBuff_8 $ini("PCini","$char(name)","RestItemBuff_8")
		/if "@RestItemBuff_8"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "RestItemBuff_8" "NULL"
			/delay 0
			/varset RestItemBuff_8 $ini("PCini","$char(name)","RestItemBuff_8")
			}
		/varset CmbtItemBuff_1 "$ini("PCini","$char(name)","CmbtItemBuff_1")"
		/if "@CmbtItemBuff_1"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "CmbtItemBuff_1" "NULL"
			/delay 0
			/varset CmbtItemBuff_1 $ini("PCini","$char(name)","CmbtItemBuff_1")
			}
		/varset CmbtItemBuff_2 $ini("PCini","$char(name)","CmbtItemBuff_2")
		/if "@CmbtItemBuff_2"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "CmbtItemBuff_2" "NULL"
			/delay 0
			/varset CmbtItemBuff_2 $ini("PCini","$char(name)","CmbtItemBuff_2")
			}
		/varset CmbtItemBuff_3 $ini("PCini","$char(name)","CmbtItemBuff_3")
		/if "@CmbtItemBuff_3"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "CmbtItemBuff_3" "NULL"
			/delay 0
			/varset CmbtItemBuff_3 $ini("PCini","$char(name)","CmbtItemBuff_3")
			}
		/varset CmbtItemBuff_4 $ini("PCini","$char(name)","CmbtItemBuff_4")
		/if "@CmbtItemBuff_4"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "CmbtItemBuff_4" "NULL"
			/delay 0
			/varset CmbtItemBuff_4 $ini("PCini","$char(name)","CmbtItemBuff_4")
			}
		/varset CmbtItemBuff_5 $ini("PCini","$char(name)","CmbtItemBuff_5")
		/if "@CmbtItemBuff_5"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "CmbtItemBuff_5" "NULL"
			/delay 0
			/varset CmbtItemBuff_5 $ini("PCini","$char(name)","CmbtItemBuff_5")
			}
		/varset CmbtItemBuff_6 $ini("PCini","$char(name)","CmbtItemBuff_6")
		/if "@CmbtItemBuff_6"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "CmbtItemBuff_6" "NULL"
			/delay 0
			/varset CmbtItemBuff_6 $ini("PCini","$char(name)","CmbtItemBuff_6")
			}
		/varset CmbtItemBuff_7 $ini("PCini","$char(name)","CmbtItemBuff_7")
		/if "@CmbtItemBuff_7"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "CmbtItemBuff_7" "NULL"
			/delay 0
			/varset CmbtItemBuff_7 $ini("PCini","$char(name)","CmbtItemBuff_7")
			}
		/varset CmbtItemBuff_8 $ini("PCini","$char(name)","CmbtItemBuff_8")
		/if "@CmbtItemBuff_8"=="NOTFOUND" {
			/ini "PCini" "$char(name)" "CmbtItemBuff_8" "NULL"
			/delay 0
			/varset CmbtItemBuff_8 $ini("PCini","$char(name)","CmbtItemBuff_8")
			}

	:setupSBCheck
		/if ("@MeleeAttack_1"=="bash" || "@MeleeAttack_1"=="slam") {
			/echo Auto @MeleeAttack_1 every @MA_Timer_SB.
			/varset MA_SB "@MeleeAttack_1"
			/varset MeleeAttack_1 "NULL"
			}
		/if ("@MeleeAttack_2"=="bash" || "@MeleeAttack_2"=="slam") {
			/echo Auto @MeleeAttack_2 every @MA_Timer_SB
			/varset MA_SB "@MeleeAttack_2"
			/varset MeleeAttack_2 "NULL"
			}
		/if ("@MeleeAttack_3"=="bash" || "@MeleeAttack_3"=="slam") {
			/echo Auto @MeleeAttack_3 every @MA_Timer_SB
			/varset MA_SB "@MeleeAttack_3"
			/varset MeleeAttack_3 "NULL"
			}

	:start
		/if "@MeleeAttack_1"!="NULL" /echo Auto @MeleeAttack_1 when availiable.
		/if "@MeleeAttack_2"!="NULL" /echo Auto @MeleeAttack_2 when availiable.
		/if "@MeleeAttack_3"!="NULL" /echo Auto @MeleeAttack_3 when availiable.
		/if n @NinjaLewt==1 /echo Auto Ninja Loot

	:mainloop
		/if $combat==TRUE /call Attack
		/doevents
	/goto :mainloop
/endmacro

Sub attack
	:attackCheck
		/varset MobID $target(id)

	:attackSetup
		/if $target(type)!=NPC {
			/attack off
			/delay 5
			/return
			}
		/if n $target(distance)>150 {
			/attack off
			/delay 5
			/return
			}

	:attackPreFight
		/call ClearReturn
		/if n $char(pet)!=0 /pet attack
		/varset MeleeDistance $ini("MOBini","$zone","$target(name,clean).DistanceMelee")
		/if "@MeleeDistance"=="NOTFOUND" {
			/ini "MOBini" "$zone" "$target(name,clean).DistanceMelee" @DefaultMeleeDistance
			/delay 0
			/varset MeleeDistance $ini("MOBini","$zone","$target(name,clean).DistanceMelee")
			}

	:attackMeleeLoop
		/doevents exp
		/doevents RageOn
		/doevents MobGate
		/doevents StunON
		/doevents ToggleTaunt
		/doevents TauntThisRound
		/if n $target(id)!=@MobID /goto :attackend
		/if $return==EndATK /goto :attackEnd
		/if $combat!=TRUE /goto :attackend
		/if $char(casting)!=TRUE /if n $char(feetwet)!=0 /face fast
		/if $char(casting)!=TRUE /if n $char(feetwet)==0 /face fast nolook
		/if n $target(id)==@MobID /if $char(casting)!=TRUE /if n $target(distance)>@MeleeDistance /sendkey down up
		/if n $target(id)==@MobID /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance /sendkey up up
		/if n $target(id)==@MobID /if $char(casting)!=TRUE /if n $target(distance)<=$calc(@MeleeDistance-5) /press down
		/if "@MeleeAttack_1"!="NULL" /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance /if $char(ability,"@MeleeAttack_1")>0 /doability "@MeleeAttack_1"
		/if "@MeleeAttack_2"!="NULL" /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance /if $char(ability,"@MeleeAttack_2")>0 /doability "@MeleeAttack_2"
		/if "@MeleeAttack_3"!="NULL" /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance /if $char(ability,"@MeleeAttack_2")>0 /doability "@MeleeAttack_3"
		/if "@TauntToggle"!="NULL" /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance /if $char(ability,"taunt")>0 /doability "taunt"
		/if "@MA_SB"!="No" /if n "@Time_MA_SB"=="0" /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance {
			/doability "@MA_SB"
			/varset Time_MA_SB @MA_Timer_SB
			}
		|/if "$char(class)"=="Shadow Knight" /if $target(id)==@MobID /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance /goto :attackSpellsSK
	/goto :attackMeleeLoop

	:attackSpellsSK
		/if n $char(gem,"Zevfeer's Bite")>0 /if n $char(mana,pct)>20 /if n $target(hp,pct)<90 /call cast "Zevfeer's Bite"
		/if n $char(gem,"Aura of Hate")>0 /if n $char(mana,pct)>20 /if n $target(hp,pct)<90 /call cast "Aura of Hate"
		/if n $char(gem,"Spear of Decay")>0 /if n $char(mana,pct)>50 /if n $target(hp,pct)<90 /call cast "Spear of Decay"
		/if n $char(gem,"Spear of Plague")>0 /if n $char(mana,pct)>50 /if n $target(hp,pct)<90 /call cast "Spear of Plague"
		/if n $char(hp,pct)<90 /if n $char(buff,"Bond of Death Recourse")==0 /if n $char(gem,"Bond of Death")>0 /if n $char(mana,pct)>20 /if n $target(hp,pct)<90 /call cast "Bond of Death"
	/goto :attackMeleeLoop

	:attackend
		/if n @NinjaLewt!=0 /doevents exp
		/varset MobID NULL
		/if @TauntToggle!=NULL /varset TauntToggle NULL
		/attack off
		/pet backoff
		/pet hold
		/sendkey up up
/return

Sub ClearReturn
/return NULL

Sub event_exp
	/if n $target(hp,pct)>0 /return
	/if n @NinjaLewt==0 /return EndATK
	/if $target(type)!=CORPSE /target id @MobID
	/loot
	/sendkey up up
	/loot
	/loot
	/loot
/return EndATK

Sub event_RageOn
	/if n $target(hp,pct)>15 /return
	/if n $target(hp,pct)==0 /return
	/if $target(id)==@MobID /if $char(casting)!=TRUE /sendkey up up
	/call ClearReturn
	/echo Rage On
	/attack off
	/pet back off
	/pet hold
	/call ClearReturn

	:waitRage
		/doevents
		/if $target(id)!=@MobID /return EndATK
		/if $return==EndATK /return EndATK
		/if $return==RageOFF /return
/goto :waitRage

Sub event_RageOFF
	/echo Rage OFF
	/attack on
/return RageOFF

Sub event_MobGate
	/if n $target(distance)<100 /return
	/echo MOB GATED!
	/attack off
/return EndATK

Sub event_Invited
	/invite
/return

Sub event_StunON
	/doevents flush StunOFF
	/call ClearReturn

	:LoopStunOFF
		/doevents StunOFF
		/if "$return"=="StunOFF" {
			/call ClearReturn
			/return
			}
/goto :LoopStunOFF

Sub event_StunOFF
/return StunOFF

Sub event_TauntThisRound
	/if "@TauntToggle"!="Yes" /if "@MeleeAttack_1"!="taunt" /if "@MeleeAttack_2"!="taunt" /if "@MeleeAttack_3"!="taunt") {
		/echo Taunting this round against %t
		/varset TauntToggle Yes
		}
/return

Sub event_ToggleTaunt
		/if "@MeleeAttack_1"=="taunt" {
			/varset MeleeAttack_1 "NULL"
			/echo Will no longer taunt.
			/return
			}
		/if "@MeleeAttack_2"=="taunt" {
			/varset MeleeAttack_2 "NULL"
			/echo Will no longer taunt.
			/return
			}
		/if "@MeleeAttack_3"=="taunt" {
			/varset MeleeAttack_3 "NULL"
			/echo Will no longer taunt.
			/return
			}
		/if "@MeleeAttack_1"=="NULL" {
			/varset MeleeAttack_1 taunt
			/echo Auto @MeleeAttack_1 when availiable.
			/return
			}
		/if "@MeleeAttack_2"=="NULL" {
			/varset MeleeAttack_2 taunt
			/echo Auto @MeleeAttack_2 when availiable.
			/return
			}
		/if "@MeleeAttack_3"=="NULL" {
			/varset MeleeAttack_3 taunt
			/echo Auto @MeleeAttack_3 when availiable.
			/return
			}
/return

Sub event_ToggleNinja
		/if n "@NinjaLewt"=="0" {
			/varset NinjaLewt 1
			/echo NinjaLewt On
			/return
			}
		/if n "@NinjaLewt"=="1" {
			/varset NinjaLewt 1
			/echo NinjaLewt Off
			}
/return
example stick-npc.ini
You dont need to copy this....

By default , stick-pc.ini sets defaultmeleedistance to 15
edit stick-npc.ini for the zone/mob-name of mobs with large hit box's

Code: Select all

[Doomfire, The Burning Lands]
Jaxoliz Dawneyes.DistanceMelee=30
a soldier of fire.DistanceMelee=15
Pyronis.DistanceMelee=25
Blazzax the Omnifiend.DistanceMelee=60
Criare Sunmane.DistanceMelee=50
Quavonis Firetail.DistanceMelee=50
a diviner of fire.DistanceMelee=15
General Druav Flamesinger.DistanceMelee=25
example stick-pc.ini
You dont need to copy this....

The only edit i did was add bash, the macro will create this file+data, for each character it is run on, you will need to edit it for each character.

Code: Select all

[Character-Name-Here]
NinjaLewt=0
MeleeAttack_1=Bash
MeleeAttack_2=NULL
MeleeAttack_3=NULL
DefaultMeleeDistance=15
RestBuff_1=NULL
RestBuff_2=NULL
RestBuff_3=NULL
RestBuff_4=NULL
RestBuff_5=NULL
RestBuff_6=NULL
RestBuff_7=NULL
RestBuff_8=NULL
CmbtBuff_1=NULL
CmbtBuff_2=NULL
CmbtBuff_3=NULL
CmbtBuff_4=NULL
CmbtBuff_5=NULL
CmbtBuff_6=NULL
CmbtBuff_7=NULL
CmbtBuff_8=NULL
RestItemBuff_1=NULL
RestItemBuff_2=NULL
RestItemBuff_3=NULL
RestItemBuff_4=NULL
RestItemBuff_5=NULL
RestItemBuff_6=NULL
RestItemBuff_7=NULL
RestItemBuff_8=NULL
CmbtItemBuff_1=NULL
CmbtItemBuff_2=NULL
CmbtItemBuff_3=NULL
CmbtItemBuff_4=NULL
CmbtItemBuff_5=NULL
CmbtItemBuff_6=NULL
CmbtItemBuff_7=NULL
CmbtItemBuff_8=NULL
BUFF's ARE NOT IMPLEMENTED IN THIS VERSION
that is just a placeholder in the ini's
Last edited by LamahHerder on Wed Mar 03, 2004 9:06 pm, edited 8 times in total.

rzmonk76
a hill giant
a hill giant
Posts: 165
Joined: Sat Jan 31, 2004 1:37 pm
Contact:

wow

Post by rzmonk76 » Sat Feb 07, 2004 11:35 am

m0nk your my hero. this is the best stickonmob i've found so far. i made a bard twisitng script with code based from here too if you wana look. sorry in advance if i used your name in vain. hehe

http://macroquest2.com/phpBB2/viewtopic ... 6837#36837

rzmonk76
a hill giant
a hill giant
Posts: 165
Joined: Sat Jan 31, 2004 1:37 pm
Contact:

correction sir

Post by rzmonk76 » Fri Feb 13, 2004 12:28 pm

-NT problem fixed
Last edited by rzmonk76 on Sat Feb 21, 2004 2:07 am, edited 1 time in total.

daerck
a ghoul
a ghoul
Posts: 134
Joined: Mon Jan 12, 2004 8:44 pm

Post by daerck » Fri Feb 13, 2004 5:04 pm

Some feedback...

Code: Select all

      /if $defined(Param1)!=TRUE /varset MA_1 [color=red]Bash [/color]
      /varset MA_1Timer 60       
Bash is set as default...

Code: Select all

      /if "@MA_1"!="NULL" /if n "@TimerMA_1"=="0" /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance /goto :attackMA_1 
      /if "@MA_2"!="NULL" /if n "@TimerMA_2"=="0" /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance /goto :attackMA_2 
      /if "@MA_3"!="NULL" /if n "@TimerMA_3"=="0" /if $char(casting)!=TRUE /if n $target(distance)<=@MeleeDistance /goto :attackMA_3 
I personally don't really like the logic of this (and the way the spells for SKs are called alike).
You call the first ability and after that it gets send back to the beginning of the attack loop, checks for positioning, moves around (, possibly move behind the mob or do whatever you add to the routine), then comes back to check if the timer for ability 1 has elapsed yet. If the previous position checks, etc. take very long you may never see ability 2 or even 3 fire off.
A (imo) much better solution is to use something like this

Code: Select all

/if n $char(ability,"MA_X")>0 /doability "MA_X"
/if n $char(ability,"MA_X")>0 /doability "MA_Y"
...
This way you don't need to check for the timer, nor "MA_X"!=NULL.


Another thing I found odd:

Code: Select all

Sub event_RageOn 
   /if $target(id)==@MobID /if $char(casting)!=TRUE /if n $target(distance)[color=red]==[/color]@MeleeDistance /sendkey up up 
   /attack off 
(found in a number of places)
I'm really not sure what you are trying to do with this line as it makes no sense to me, but in case you probably want to use <=,!= or >= instead of ==.

One last thing, which is probably a matter of taste, try to use some nested /if's or the && operator to combine your /If's. If used correctly it greatly improves readability of the code (imo).
I.e.

Code: Select all

    :attackSpellsSK 
      /if n $char(gem,"Zevfeer's Bite")>0 /if n $char(mana,pct)>20 /if n $target(hp,pct)<90 /call cast "Zevfeer's Bite" 
      /if n $char(gem,"Aura of Hate")>0 /if n $char(mana,pct)>20 /if n $target(hp,pct)<90 /call cast "Aura of Hate" 
      /if n $char(gem,"Spear of Decay")>0 /if n $char(mana,pct)>50 /if n $target(hp,pct)<90 /call cast "Spear of Decay" 
      /if n $char(gem,"Spear of Plague")>0 /if n $char(mana,pct)>50 /if n $target(hp,pct)<90 /call cast "Spear of Plague" 
   /goto :attackMeleeLoop 
vs

Code: Select all

/if n $target(hp,pct)<90 {
   /if n $char(mana,pct)>20 {
      /if n $char(gem,"Zevfeer's Bite")>0 /call cast "Zevfeer's Bite"
      /if n $char(gem,"Aura of Hate")>0 /call cast "Aura of Hate"
   }
   /if n $char(mana,pct)>50 {
      /if n $char(gem,"Spear of Decay")>0 /call cast "Spear of Decay"
      /if n $char(gem,"Spear of Plague")>0 /call cast "Spear of Plague"
   }
}

LamahHerder
a hill giant
a hill giant
Posts: 299
Joined: Sat Jun 29, 2002 2:37 am

Post by LamahHerder » Sat Feb 14, 2004 8:33 pm

UPDATED
Version 2.14.04a

Changes:

-Stun code
-Taunt toggle code
-stick-mobs.ini added
-ONLY bash/slam are on timers now, everything else w/ $char(ability,xxx)
-gate code changes
-enrage logic changes
-misc code changes
-Implemented $combat since it now works. (attack on/off events removed)
-auto join group on invite

LamahHerder
a hill giant
a hill giant
Posts: 299
Joined: Sat Jun 29, 2002 2:37 am

Post by LamahHerder » Sun Feb 15, 2004 3:07 am

Thanks for response daerck
Bash is set as default...
Macro is just a copy of what I currently use, I guess i could change it but /shrug this script is geared moreso to Knights/Warriors then other melee's althou it mostly works for them.
You call the first ability and after that it gets send back to the beginning of the attack loop,
Yea i didnt like that either should have put it in {}'s originally but my orig code was like that and didnt get around to change it since I didnt have problems, it is however changed now.
A (imo) much better solution is to use something like this
Code:

/if n $char(ability,"MA_X")>0 /doability "MA_X"
/if n $char(ability,"MA_X")>0 /doability "MA_Y"
...


This way you don't need to check for the timer, nor "MA_X"!=NULL.
$char(ability,bash) & $char(ability,slam) do not work like the other abilitys
so had to use timers (and still have to)
all other ability's use $char(ability,xxx) just wasnt implementedsince in actuall usage it never caused issues for me.
One last thing, which is probably a matter of taste, try to use some nested /if's or the && operator to combine your /If's. If used correctly it greatly improves readability of the code (imo).
Not useing nestings because things can change during the time the call for cast is done and the time it is completed.

LamahHerder
a hill giant
a hill giant
Posts: 299
Joined: Sat Jun 29, 2002 2:37 am

Post by LamahHerder » Thu Feb 19, 2004 9:15 am

btw,few people have had problems with being out of range....
to fix....

max melee is set at 17 which works fine for an ogre but most others it doesnot
Suggest you use 15 or 16, edit it in :editDefaults section

rzmonk76
a hill giant
a hill giant
Posts: 165
Joined: Sat Jan 31, 2004 1:37 pm
Contact:

hiho

Post by rzmonk76 » Thu Feb 19, 2004 1:53 pm

was thinking of two things mOnk. first was to add exp for each mob report. would be a nice adition IMO. second would be a solution for your move behind problem. i listed some threads of the movebehind code and exp code found on the forums.


example of second mac to initiate move behind and then handback to main mac code. second behind code i listed is actualy better. doesnt look so robotic. but this example can give you an idea of how to work around the problem of having aggro and bringing attention to yourself by continuing to try to get to the back of the target.
http://macroquest2.com/phpBB2/viewtopic ... hind+rogue


example of strafe move behind code. this "strafing code looks much more natural than the gerky move code of the rogue above"
http://macroquest2.com/phpBB2/viewtopic.php?t=4882

EDIT
xp report, just updated this to another thread with code that looks promising but untested.
http://macroquest2.com/phpBB2/viewtopic.php?t=5419

rzmonk76
a hill giant
a hill giant
Posts: 165
Joined: Sat Jan 31, 2004 1:37 pm
Contact:

correction sir

Post by rzmonk76 » Sat Feb 21, 2004 2:48 pm

example = /mac stick 1 "bash" (will not loot and only bash)
should be

Code: Select all

example = /mac stick 1 "bash" (will loot and only bash) 
am i right or wrong?

question this meleedistance code will automaticly gauge the right max melee distance to be at? thats great!

rzmonk76
a hill giant
a hill giant
Posts: 165
Joined: Sat Jan 31, 2004 1:37 pm
Contact:

re exp code

Post by rzmonk76 » Tue Feb 24, 2004 8:54 am

there is a slight incompatability with the xp report code. please visit the xp thread i posted to see. something to do with timers or something like that.

rzmonk76
a hill giant
a hill giant
Posts: 165
Joined: Sat Jan 31, 2004 1:37 pm
Contact:

a more human like /face

Post by rzmonk76 » Thu Feb 26, 2004 12:40 pm

http://macroquest2.com/phpBB2/viewtopic.php?t=5482a more human like /face

ill incorperate it and test this and the exp report snipets soon. I'm in the middle of a move and not settled in yet.

EDIT*

well its nice but its bugged it makes you run in circles around the mob sometimes because up key is held down.
Last edited by rzmonk76 on Tue Mar 02, 2004 4:54 pm, edited 1 time in total.

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Thu Feb 26, 2004 1:10 pm

Looks like an expansion to autofight.inc. I'm gonna steal your Gate code and incorporate that there.

Timers are not necessary for bash and slam. It doesn't matter if the button is mashed rapidly, it won't go off if it isn't ready and everybody manually mashes the button anyway. Using timers might mess things up in a high lag situation. Just use the standard /if $char(ability,###) statements for them. It really doesn't cause any problems. The only way I'd modify that is if you are saving Bash to interrupt casters. You'd add an event for "mob begins to cast".

Autofight.inc (in Snippets) has a pretty good set of melee ranges in it. I tweaked those over a long time to give the best balance of too close/not close enough, allowing for periods of lag and the shorter range on Bash.

thisisjustatest80
orc pawn
orc pawn
Posts: 10
Joined: Sun Feb 22, 2004 9:08 am

Post by thisisjustatest80 » Sun Feb 29, 2004 4:37 am

What i'm not seeing is how to keep my PC closer to the npc - he stays too far back and sometimes backs up if he's "too close" and I'm not finding exactly the logic for this. Please help

rzmonk76
a hill giant
a hill giant
Posts: 165
Joined: Sat Jan 31, 2004 1:37 pm
Contact:

Post by rzmonk76 » Mon Mar 01, 2004 3:23 pm

find this line

Code: Select all

/ini "NPCini" "$zone" "$target(name,clean).DistanceMelee" 17 
and change it to this

Code: Select all

/ini "NPCini" "$zone" "$target(name,clean).DistanceMelee" [color=red]15[/color]
if your one of the smallz you may need to decrease it even more. mebe 13 or so. The height of you and your target coralates in the max distance to your target.

you must edit the npc.ini file on the fly the first time you fight the raid boss mob to acomidate for mobs that rampage or small radius ae.

rzmonk76
a hill giant
a hill giant
Posts: 165
Joined: Sat Jan 31, 2004 1:37 pm
Contact:

bard version

Post by rzmonk76 » Wed Mar 03, 2004 12:28 pm

combined this code into a bardish version you can find it here

http://macroquest2.com/phpBB2/viewtopic ... 73e9c1fd8d