kill static spawn and move to loc dont move to loc HELP plz

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

Villager
decaying skeleton
decaying skeleton
Posts: 2
Joined: Sat Jan 24, 2004 10:26 am

kill static spawn and move to loc dont move to loc HELP plz

Post by Villager » Sat Jan 24, 2004 10:33 am

im trying to kill a static spawn and when im done looting it move back to its loc i assign it to 469.01,162.30,-186.19 but just not quite working for me any help would be nice here what I got.



Sub Main
/declare MobToHunt global
/declare MainArray array2
/declare MyXLOC global
/declare MyYLOC global
/declare KSRadius global
/declare NotSee global
/declare TooFar global
/declare MyTarget global
/declare TargetDead global
/declare HasTarget global
/declare ObstCount global
/declare LootSlot global
/declare CheckLoot global
/declare LootTotal global
/declare MobArraySize global
/declare RangeMax global
/declare RangeMin global
/declare FastRange global
/press esc
/press esc
/press esc
/press esc
/press alt
/press shift
/press ctrl
/varset RangeMax 10
/varset RangeMin 8
/varset FastRange 14
/varset LootSlot 0
/varset CheckLoot 0
/varset MainArray(1,0) "what ever u want to loot"
/varset MainArray(1,1) "what ever u want to loot"
| Add as many of these as you want but make sure you
| increase LootTotal
| Add as many of these as you want but make sure you
| increase MobArraySize
/varset LootTotal 2
/varset KSRadius 10
/varset HasTarget 0
/varset ObstCount 0
/varset MobArraySize 1
/varset AnchorX $char(x)
/varset AnchorY $char(y)
:Start
/call GetTarget
/if @HasTarget=="1" /call MoveToMob
/if @HasTarget=="1" /call CombatSub
/if @HasTarget=="1" /call MoveToMob
/if @HasTarget=="1" /call LootMob
/call ResetSub
/goto :Start
/return



sub GetTarget
:Aquire
/target nopcnear @KSRadius npc "@MainArray(2,$rand(@MobArraySize))"
/varset MyTarget $target(id)
/varset TargetDead 0
/if n $target(id)==0 /goto :Aquire
/if $target()=="False" /goto :Aquire
/varset HasTarget 1
/varset MobToHunt $target(name)
/return




Sub MoveToMob
/face fast
/if n $target(distance)>=@FastRange /call Fastmove
/if n $target(distance)>@RangeMax {
/press up
}
/if n $target(distance)<@RangeMin {
/press down
}
/return

Sub Fastmove
/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/varset ObstCount 0
:fastmoveloop
/if $target()=="FALSE" {
/sendkey up up
/if $combat=="TRUE" {
/attack off
/return
}
}
/face fast
/if n $target(distance)>@FastRange {
/sendkey down up
}
/if n $target(distance)<=@FastRange {
/sendkey up up
/return
}
/varadd ObstCount 1
/if n @ObstCount>=3 {
/call CheckObst
}
/goto :fastmoveloop
/return

sub CombatSub
/if $target()=="FALSE" {
/varset HasTarget 0
/return
}
/attack on
:combatloop
/face fast
/call MoveToMob
/face fast
/if n $target(id)==0 /varset TargetDead 1
/if n @TargetDead!=1 /goto :combatloop
/sendkey up up
/delay 1s
/target corpse
/lootn never
/delay 2s
/return

sub LootMob
/loot
/delay 2s
:lootloop
/if n @LootSlot>=9 /goto :doneloot
/click left corpse @LootSlot
/delay 1s
/if "$cursor()"!="TRUE" /goto :doneloot
:lootChecker
/if "$cursor(name)"~~"@MainArray(1,@CheckLoot)" {
/delay 1s
/click left auto
/delay 1s
/varadd LootSlot 1
/goto :lootloop
}
/varadd CheckLoot 1
/if "$cursor()"=="TRUE" {
/if n @CheckLoot<@LootTotal /goto :lootchecker
}
/if "$cursor()"=="TRUE" {
/delay 1s
/click left destroy
/delay 1s
}
/varadd LootSlot 1
/varset CheckLoot 0
/goto :lootloop
:doneloot
/lootn always
/varset LootSlot 0
/return

sub ResetSub
/sendkey up up
/press esc
/press esc
/press esc
/press esc
/press alt
/press shift
/press ctrl
/varset CheckLoot 0
/varset HasTarget 0
/varset ObstCount 0
/delay 1s
/return

Sub MoveToLoc
/if "$defined(Param0)"=="FALSE" /return
/if "$defined(Param1)"=="FALSE" /return
:LocMoveLoop
/if "$char(state)"=="SIT" /stand
/face nolook loc @Param0,@Param1
/if n $distance(@AnchorX,@AnchorY)>5 /sendkey down up
/if n $distance(@AnchorX,@AnchorY)<=5 {
/sendkey up up
/if "$char(state)"=="SIT" /stand
/return
}
/goto :LocMoveLoop
/return


sub CheckObst
/if n @MyXLOC==$char(x) /if n @MyYLOC==$char(y) /call HitObst
/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/varset ObstCount 0
/return

sub HitObst
/sendkey up up
/sendkey down down
/if n $rand(99)>50 {
/delay 3s
/sendkey up down
/sendkey down Right
/delay @Param0
/sendkey up Right
/sendkey down up
/delay 3s
/sendkey up up
} else {
/delay 3s
/sendkey up down
/sendkey down left
/delay @Param0
/sendkey up left
/sendkey down up
/delay 3s
/sendkey up up
}
/sendkey up down
/sendkey up Right
/sendkey up Left
/sendkey down up
/return


IF u got a fix to this or can show me the path so I can fix it plzz PM me
thx again.

Villager
decaying skeleton
decaying skeleton
Posts: 2
Joined: Sat Jan 24, 2004 10:26 am

Post by Villager » Sun Jan 25, 2004 9:52 am

Ok messed with it a little more and tried to do a anchor point which is camp for him so after every kill it goes back to that anchor point but for some reason that part dont work but he does kill the mob in a loop thou any help on the code would be great.

Sub Main
/declare MobToHunt global
/declare MainArray array2
/declare MyXLOC global
/declare MyYLOC global
/declare KSRadius global
/declare NotSee global
/declare TooFar global
/declare MyTarget global
/declare TargetDead global
/declare HasTarget global
/declare ObstCount global
/declare LootSlot global
/declare CheckLoot global
/declare LootTotal global
/declare MobArraySize global
/declare RangeMax global
/declare RangeMin global
/declare FastRange global
/declare AnchorX global
/declare AnchorY global
/press esc
/press esc
/press esc
/press esc
/press alt
/press shift
/press ctrl
/varset RangeMax 10
/varset RangeMin 8
/varset FastRange 14
/varset LootSlot 0
/varset CheckLoot 0
/varset MainArray(1,0) "loot"
/varset MainArray(1,1) "loot"
| Add as many of these as you want but make sure you
| increase LootTotal
| Add as many of these as you want but make sure you
| increase MobArraySize
/varset LootTotal 2
/varset KSRadius 10
/varset HasTarget 0
/varset ObstCount 0
/varset MobArraySize 1
/varset AnchorX $char(x)
/varset AnchorY $char(y)
:Start
/call GetTarget
/if @HasTarget=="1" /call MoveToMob
/if @HasTarget=="1" /call CombatSub
/if @HasTarget=="1" /call MoveToMob
/if @HasTarget=="1" /call LootMob
/call ResetSub
/goto :Start
/return



sub GetTarget
:Aquire
/target nopcnear @KSRadius npc "@MainArray(2,$rand(@MobArraySize))"
/varset MyTarget $target(id)
/varset TargetDead 0
/if n $target(id)==0 /goto :Aquire
/if $target()=="False" /goto :Aquire
/varset HasTarget 1
/varset MobToHunt $target(name)
/return




Sub MoveToMob
/face fast
/if n $target(distance)>=@FastRange /call Fastmove
/if n $target(distance)>@RangeMax {
/press up
}
/if n $target(distance)<@RangeMin {
/press down
}
/return

Sub Fastmove
/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/varset ObstCount 0
:fastmoveloop
/if $target()=="FALSE" {
/sendkey up up
/if $combat=="TRUE" {
/attack off
/return
}
}
/face fast
/if n $target(distance)>@FastRange {
/sendkey down up
}
/if n $target(distance)<=@FastRange {
/sendkey up up
/return
}
/varadd ObstCount 1
/if n @ObstCount>=3 {
/call CheckObst
}
/goto :fastmoveloop
/return

sub CombatSub
/if $target()=="FALSE" {
/varset HasTarget 0
/return
}
/attack on
:combatloop
/face fast
/call MoveToMob
/face fast
/if n $target(id)==0 /varset TargetDead 1
/if n @TargetDead!=1 /goto :combatloop
/sendkey up up
/delay 1s
/target corpse
/lootn never
/delay 2s
/return

sub LootMob
/loot
/delay 2s
:lootloop
/if n @LootSlot>=9 /goto :doneloot
/click left corpse @LootSlot
/delay 1s
/if "$cursor()"!="TRUE" /goto :doneloot
:lootChecker
/if "$cursor(name)"~~"@MainArray(1,@CheckLoot)" {
/delay 1s
/click left auto
/delay 1s
/varadd LootSlot 1
/goto :lootloop
}
/varadd CheckLoot 1
/if "$cursor()"=="TRUE" {
/if n @CheckLoot<@LootTotal /goto :lootchecker
}
/if "$cursor()"=="TRUE" {
/delay 1s
/click left destroy
/delay 1s
}
/varadd LootSlot 1
/varset CheckLoot 0
/goto :lootloop
:doneloot
/lootn always
/varset LootSlot 0
/return

/call MoveToAnchor

/delay 4s
/return

Sub MoveToAnchor
:AnchorMoveLoop
/doevents
/if "$char(state)"=="SIT" /stand
/face loc @AnchorX,@AnchorY
/if n $distance(@AnchorX,@AnchorY)>1 /sendkey down up
/if n $distance(@AnchorX,@AnchorY)<=1 /sendkey up up
}
/goto :AnchorMoveLoop
/return


sub ResetSub
/sendkey up up
/press esc
/press esc
/press esc
/press esc
/press alt
/press shift
/press ctrl
/varset CheckLoot 0
/varset HasTarget 0
/varset ObstCount 0
/delay 1s
/return

sub CheckObst
/if n @MyXLOC==$char(x) /if n @MyYLOC==$char(y) /call HitObst 5
/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/varset ObstCount 0
/return

sub HitObst
/sendkey up up
/sendkey down down
/if n $rand(99)>50 {

/delay 3s
/sendkey up down
/sendkey down Right
/delay @Param0
/sendkey up Right
/sendkey down up
/delay 3s
/sendkey up up
} else {
/delay 3s
/sendkey up down
/sendkey down left
/delay @Param0
/sendkey up left
/sendkey down up
/delay 3s
/sendkey up up
}
/sendkey up down
/sendkey up Right
/sendkey up Left
/sendkey down up

/return

Onezero
a ghoul
a ghoul
Posts: 95
Joined: Thu Jan 01, 2004 1:19 pm
Location: Normal, IL
Contact:

Post by Onezero » Sun Jan 25, 2004 10:02 am

Use. Code. Blocks.... or die.
.[b].[/b]:[b]:[/b] Onezero
"[i]Health is merely the slowest rate at which you can die.[/i]"

cronic
a grimling bloodguard
a grimling bloodguard
Posts: 536
Joined: Wed Nov 26, 2003 11:01 pm

Post by cronic » Mon Jan 26, 2004 3:57 am

That hurt me.

User avatar
Bad Karma
a snow griffon
a snow griffon
Posts: 346
Joined: Sat Nov 22, 2003 9:34 pm
Contact:

Post by Bad Karma » Thu Jan 29, 2004 3:57 am

still waiting for him to post the

Code: Select all

 he's having trouble with. 

/smartass turbo
[b]- Bad Karma
________________________________________[/b]

In our own quest for excellence, we should strive to take the time to help those who help themselves.

All others should [b]RTFM[/b]!!!!!!!!!