Page 1 of 1

AFK Loot + FD help

Posted: Wed Oct 20, 2004 4:31 am
by k0ger
I have been looking at "AFK Looting Macro" by scewju. And it works great so fare.

The only thing i would like to add is that after he run to anchor he FD's and redo if fail. I cant seem to get it to work. And tbh his macro is more advanced then the once i have tryed to modify before

Code: Select all


#Event zone "#*#You have entered #*#" 

Sub main 
   /declare MyXLOCA int outer 0 
   /declare MyYLOCA int outer 0 
   /declare BreakLoop int outer 0 
   /declare AnchorX int outer ${Me.X} 
   /declare AnchorY int outer ${Me.Y} 
   /declare LootSlot int outer 0 
   /declare LootCheck int outer 0 
   /declare LootTotal int outer 0 
   /declare locv1 int outer 0 
   /declare xDistance int outer 0  
:Loopa 
/call Loot 
/call CheckAnchor 
/delay 1m 
/goto :Loopa 
/endmacro 


Sub Loot 


   :LtLoop 
   /varcalc locv1 ${locv1}+1 
   /target corpse radius 400 
   /if (!${Target.ID} || ${Target.Type.NotEqual[Corpse]}) /return 
   /varset xDistance 5 
   /call GotoBody ${Target.ID} 
   /if (${Target.ID}) /face nolook fast 
   /loot 
   /delay 40 ${Window[LootWnd].Open} 
   /if (!${Corpse.Items}) { 
      /goto :ExitSWLt 
   } 
   /varset LootTotal ${Corpse.Items} 
   /for LootSlot 1 to ${LootTotal} 
      /itemnotify loot${LootSlot} rightmouseup 
      /delay 10 ${Cursor.ID} 
      /notify InventoryWindow IW_CharacterView rightmouseup 
      /delay 10 
      :NextSWLt 
   /next LootSlot 
   :ExitSWLt 
   /cleanup 
   /delay 10 
   /if (${locv1}<4) /goto :LtLoop 
/return 

Sub GotoBody(BodyID) 
   /varset BreakLoop 0 
   /if (${Me.Mount.ID}) { 
      /dismount 
      /delay 10 
   } 
   /if (${Me.Sitting}) /stand 
   /if (${Target.ID}!=${BodyID}) { 
      /keypress clear_target 
      /delay 3 
      /target id ${BodyID} 
      /delay 3 
   } 
    
   :KeepGoingBody 
   /doevents 
   /delay 0 
   /if (${BreakLoop}==1) /return 
   /if (${Target.Distance}>=10) { 
      /face nolook fast 
      /keypress forward hold 
   } 
   /if (${Target.Distance}<10) { 
      /varset BreakLoop 1 
      /keypress forward 
      /return 
   } 
   /call CheckObstacle 
   /if (${BreakLoop}!=1) /goto :KeepGoingBody 
/return 

|# Checks to see if we may have bumped into something that is stopping us 
sub CheckObstacle 
   |# Record our current position, wait a moment and then check if its the same 
   /varset MyXLOCA ${Me.X} 
   /varset MyYLOCA ${Me.Y} 
   /delay 2 
   /if (${MyXLOCA}==${Me.X} && ${MyYLOCA}==${Me.Y}) /call Obstacle 
/return 

|# Uses strafe and randomness to try and get around things 
sub Obstacle 
   /keypress forward 
   /keypress back hold 
   /delay 5 
   /keypress back 
   /if (${Math.Rand[2]}) { 
      /keypress strafe_right hold 
      /delay 3 
      /keypress strafe_right 
   } else { 
      /keypress strafe_left hold 
      /delay 3 
      /keypress strafe_left 
   } 
   /keypress forward hold 
/return 

Sub CheckAnchor    
  /if (${Math.Distance[${AnchorY},${AnchorX}]}>12) /call MoveToAnchor    
/return 

Sub MoveToAnchor 
    /declare iCount int local 
    /varset iCount 0 

    /echo Moving to Anchor at Loc: ${AnchorY}, ${AnchorX}. 

:AnchorMoveLoop  
    /delay 1 
    /doevents 
    /face nolook loc ${AnchorY},${AnchorX} 
    
    /if (${Math.Distance[${AnchorY},${AnchorX}]}>12) { 
       /keypress forward hold 
   } else { 
       /keypress forward 
       /face away loc ${AnchorY},${AnchorX} 
        /return 
    } 

    /if (${iCount}>2) { 
        /call Detectobst 
        /face nolook loc ${AnchorY},${AnchorX} 
        /varset iCount 0 
    } 
    
    /varcalc iCount ${iCount}+1 
    /goto :AnchorMoveLoop 
/return 

Sub Detectobst 
/return 
  
/endmacro 

Sub Event_zone 
  /echo ZONE! Ending macro! 
  /endmacro 
/return

This is his and don't even wanna show what i tryed haha. I have never seen so many error msg at one place before.. Well one time i tryed working on a mac com. But thats something else.

Hope ya can help me out or give me a few hit / pointers

Posted: Wed Oct 20, 2004 6:13 am
by blueninja
Take a look at this. This is completely untested but it should give you an idea of what to do. Who knows, it might even work right away :) .. Change the top part of the macro to this:

Code: Select all

#Event zone "#*#You have entered #*#"
#event FDFail "#1# has fallen to the ground."

Sub Event_FDFail(string Line, string Fallee)
| See if I was the one failing
	/if (${Fallee.NotEqual[${Me.Name}]}) /return

| Yep, it was me, get up
	/stand

/return

Sub main
   /declare MyXLOCA int outer 0
   /declare MyYLOCA int outer 0
   /declare BreakLoop int outer 0
   /declare AnchorX int outer ${Me.X}
   /declare AnchorY int outer ${Me.Y}
   /declare LootSlot int outer 0
   /declare LootCheck int outer 0
   /declare LootTotal int outer 0
   /declare locv1 int outer 0
   /declare xDistance int outer 0 
:Loopa
/call Loot
/call CheckAnchor

| Shorter delay so it can check fail events more often
/delay 1s
/doevents

| If not fd and if fd ability is ready, fd
/if (${Me.State.NotEqual[FEIGN]} && ${Me.AbilityReady[Feign Death]}) /doability "Feign Death"

/goto :Loopa
/endmacro

Apart from this you need to make sure you're not FD before you move somewhere. The way it is now it doesn't have a check like this at all when going to the anchor and it has a bad one in GotoBody (checks to see if you're sitting when it should really check if you are *not* standing).

Posted: Wed Oct 20, 2004 9:40 am
by k0ger
Thanks alot blue, it allmost worked at first try .. had to add an /stand and that was it... now i just need to work abit more on it ..but thanks alot...

I really enjoy how fast ppl post here.

/cheers to ya all