Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Loot Macro (Help Need)


  • Please log in to reply
6 replies to this topic
MikBlast
  • Members
  • 19 posts
  • Last active: Jun 05 2017 08:49 PM
  • Joined: 18 Feb 2007

hi, i have some trouble getting a macro to work.

 

i want wrote a loot macro, it should do hit "F" if the loot bubble pop up.

http://tinypic.com/r/ilf23t/6

and does nothing when there is no loot bubble there.

 

i have search the Adress in Unicode, finaly i found the static.

http://i45.tinypic.com/fwhlhu.jpg

 

 

i tried this code in autohotkey:

 

Address := 0x012CB6F4
offset1 := 0x0
offset2 := 0x348
offset3 := 0x4
offset4 := 0x28
offset5 := 0x22


f12::

{
;lvl 1
Read1 := ReadMemory(Address,"Guild Wars 2")
Address1 := ( Offset1 + Read1 )
Read2 := ReadMemory(Address1,"Guild Wars 2") 
;lvl 2
Address2 := ( Offset2 + Read2 )
Read3 := ReadMemory(Address2,"Guild Wars 2")
;lvl 3
Address3 := ( Offset3 + Read3 )
Read4 := ReadMemory(Address3,"Guild Wars 2")
;lvl 4
Address4 := ( Offset4 + Read4 )
Read5 := ReadMemory(Address4,"Guild Wars 2")
;lvl 5
Address5 := ( Offset5 + Read5 )
Read6 := ReadMemory(Address5,"Guild Wars 2")


msgbox, Value = %Read6%  
}

Return

 

i dont get the right Value it should be 7667780

 

any help pls ?



JadeDragon
  • Members
  • 935 posts
  • Last active: Jun 07 2014 07:40 AM
  • Joined: 18 Jan 2013

The F key is the loot key in GW2. I did mine a bit differently. I used a timer with a 1 second interval based on if I was in combat or not. If i'm fighting, (a flag that's set when I'm in combat) then the send doesn't take place. However, there is also an AutoLoot flag that essentially allows the script to pick up any or all stuff on the ground when i'm not fighting. The NumPadDiv Hotkey turns the AutoLooting on and off at your discretion. This is the code for that. Modify it as you want so it fits your needs.

;------------------------------------------------
; GW2 Autolooter
;------------------------------------------------
NumPadDiv:: ;<-- autolooting pickup after fight
Autolooter := !Autolooter
autolootinterval = 1000
If (!Autolooter)
   Return
gosub autoloottimer
Return

autoloottimer:
If (!autolooter)
{   Return
}

; this requires that the game window id be known
; this can be determined by using the WinGet command
; before calling the autolooter. This code prevents
; the F key sends from being sent to the wrong windows
; if the game window isn't active	
IfwinNotActive, ahk_id %vWinID%
{   SetTimer, Autoloottimer, -%autolootinterval%
    Return	
}

; This requires an in-fight indicator to determine
; when to pick up loot. If in a fight you don't want
; to be stopping every second to see if there is any
; loot on the ground. The controller's fight loop
; manages this flag.	
If (fighting)
{   SetTimer, Autoloottimer, -%autolootinterval%
    Return	
}
	
; we only get here if autolooter is on...
; the game window is active...
; and we're not fighting
Send, f
settimer, autoloottimer, -%autolootinterval%
Return

Never assume evil intent when simple ignorance will suffice. Ignorance is an eventually curable condition with the right education. Evil intent, however, is another matter entirely. Scripts are much like children. Simple to conceive. Difficult, expensive, and time-consuming to raise. Often do the opposite of what you expect them to. Require frequent  "correction". And once they leave home you can't control them anymore. But you love them anyway.


MikBlast
  • Members
  • 19 posts
  • Last active: Jun 05 2017 08:49 PM
  • Joined: 18 Feb 2007

Thx Jade Dragon.

 

I Play the most time with my Guild in WvW. we move together alot around often there is no time to run back to get the loot.

So my idear was make a loot macro thats loot in fight aswell.



JadeDragon
  • Members
  • 935 posts
  • Last active: Jun 07 2014 07:40 AM
  • Joined: 18 Jan 2013

Really in that case you'd just need to remove or comment out the following lines...

If (fighting)
{   SetTimer, Autoloottimer, -%autolootinterval%
    Return	
}

like so...

;If (fighting)
;{   SetTimer, Autoloottimer, -%autolootinterval%
;    Return	
;}

Never assume evil intent when simple ignorance will suffice. Ignorance is an eventually curable condition with the right education. Evil intent, however, is another matter entirely. Scripts are much like children. Simple to conceive. Difficult, expensive, and time-consuming to raise. Often do the opposite of what you expect them to. Require frequent  "correction". And once they leave home you can't control them anymore. But you love them anyway.


MikBlast
  • Members
  • 19 posts
  • Last active: Jun 05 2017 08:49 PM
  • Joined: 18 Feb 2007

yes right, but if there death player close to me i start to rescurection.



JadeDragon
  • Members
  • 935 posts
  • Last active: Jun 07 2014 07:40 AM
  • Joined: 18 Jan 2013

So how would your script be able to detect a dead player nearby? Maybe by doing a PixelGetColor on each member of the group's health bar at the low end to see if it's blacked out and not a normal red color? If you find one you could suspend the F send very similar to what I did with the If (fighting) code. You would need a routine to scan through the individual health bars on the screen during the fight to determine if anyone :sucked sand" then you could either attempt a rez or just turn off the Autoloot feature. This is exactly why I don't loot during fights. It's way inconvenient when you're playing a healer. For any healer characters I have I make a special routine that allows me to play solo or grouped and if grouped as a healer my script constantly monitors the party's health bars and applies heals as needed. Much more challenging code to write tho cause you have to prioritize who gets what size heals and still keep up your mana. Healers that fight burn through tons more mana and then generally have less to heal with. I always tell the people i group with, "I can fight or I can heal. If i'm healing then you have to keep the mobs off my back because if I have to fight to stay alive I won't be healing you -- I'll be healing me." They generally get the message.


Never assume evil intent when simple ignorance will suffice. Ignorance is an eventually curable condition with the right education. Evil intent, however, is another matter entirely. Scripts are much like children. Simple to conceive. Difficult, expensive, and time-consuming to raise. Often do the opposite of what you expect them to. Require frequent  "correction". And once they leave home you can't control them anymore. But you love them anyway.


Keicchan
  • Members
  • 6 posts
  • Last active: Jan 23 2013 01:56 PM
  • Joined: 04 Jan 2013

this is how i solve it.. i've put a getpixel color at the exact position of the "revive" "finish him" "take all" strig is.. if the pixel it's brown/yellow (loot) than press F, if it's red or blu dont press it.. but it doesent work well with 1000 delay cause in some inc u have 5 or 6 loot bag under your feet and u will need 6s to grab them all with your script.. in 6s i've done so much things that u cannot imagine.. use a lower delay as 30ms (or something more near at your ping time) and introduce the pixelgetcolor check to repeat the F key more faster and skip it anytime he found a blue or red pixel...

 

enjoy grin.png..

 

ps. pixelgetcolor and imageget need the game to be in windowed mode.. isn't working in fullscreen mode (bye bye 10fps)

 

ps. 30days of 4 wepons set swap + off combat utility swap + autoloot and i'm still not banned...