Sunday, April 5, 2009

Another Darkfall Macro for AutoIT - The Darkfall Quickloot macro

This is a simple quick-loot AutoIT macro for Darkfall, that can help speed up your looting. With all the competitive looting going on, this might give you an edge.

(You might also be interested in the AutoClicker Macro)

You will need AutoIT to run this script, you can download it from here: http://www.autoitscript.com/autoit3/

After you have installed AutoIT, copy the script below into a text editor and save it as "quickloot.au3". If you chose to bind au3 files to AutoIT when you installed it, you can then just doubleclick this file to start the macro.

Instructions

You will need to set the position of your bag (you should always keep your bag open). This is done with the CTRL+F5-F8 keys.

CTRL+F5: Increase X position
CTRL+F6: Decrease X position
CTRL+F7: Increase Y position
CTRL+F8: Decrease Y position

To find the ideal position just start Darkfall, exit mouselook mode and press CTRL+G. Look for where the mouse ends up. You don't have to have a loot window open for this. Then adjust until you see the mouse end up inside your bag.

You should try to aim for the center of your bag. The script adds some randomnes to where it puts the items in the bag, so everything doesn't end on top of each other.

If you are playing in windowed-mode (recommended) you will see a pop-up from the script in your systray telling you the current X and Y positions it is using for your bag.

When you have found your ideal position, you can change the script so you don't have to click around every time. The lines to change are:

Global $x = 1500
Global $y = 950

The next time you come over some phat l00t, all you have to do is mouse over the item you want to loot and press CTRL+G. The macro will then drag the item to your bag.

And here is what you came for - the script:

;
; Darkfall QuickLooter script for AutoIT
; 
; The script below is released into the public domain
; by me, the author 
;
; http://lostontheintarweb.blogspot.com/
;
; AutoIT can be found at http://www.autoitscript.com/autoit3/
;

; Position of the bag
; Change to reflect the position of YOUR bag
Global $x = 1500
Global $y = 950


; Bind to CTRL+G
HotKeySet("^{g}", "Loot")

; CTRL+F5-F8 changes bag position
HotKeySet("^{F5}", "DecreaseX")
HotKeySet("^{F7}", "DecreaseY")
HotKeySet("^{F6}", "IncreaseX")
HotKeySet("^{F8}", "IncreaseY")

; --- User configurable variables end here ---
; --- Do not edit below unless you know what you are doing ---
Global $fade = False
Global $fadetime

; Displays tray bubble
Func Bubble($text)
 TrayTip("Darkfall AutoClicker", $text, 5)
 $fade = True
 $fadetime = TimerInit()
EndFunc

Func IncreaseX()
 If $x < 5000 Then
  $x = $x + 50;
 EndIf
 Bubble(StringFormat("Bag position: x = %d, y = %d", $x, $y))
EndFunc

Func IncreaseY()
 If $y < 5000 Then
  $y = $y + 50;
 EndIf
 Bubble(StringFormat("Bag position: x = %d, y = %d", $x, $y))
EndFunc

Func DecreaseX()
 $x = $x - 50;
 If $x < 0 Then
  $x = 0
 EndIf
 Bubble(StringFormat("Bag position: x = %d, y = %d", $x, $y))
EndFunc

Func DecreaseY()
 $y = $y - 50;
 If $y < 0 Then
  $y = 0
 EndIf
 Bubble(StringFormat("Bag position: x = %d, y = %d", $x, $y))
EndFunc


; Does the quick-loot
Func Loot()
 $x1 = MouseGetPos(0)
 $y1 = MouseGetPos(1)
 $x2 = $x + Random(0, 75)
 $y2 = $y + Random(0, 75)
 MouseClickDrag("left", $x1, $y1, $x2, $y2, 1)
 MouseMove($x1, $y1, 1)
EndFunc

; --- Start of main routine ---
TraySetIcon("explorer.exe",110)
Bubble("Darkfall QuickLoot Started")
WinActivate ( "Darkfall Online" ) 

While 1
 ; Fade out bubble now?
 If $fade Then
  If TimerDiff($fadetime) > 1000 Then
   $fade = False
   Bubble("")
  EndIf
 EndIf 
 Sleep(25)
WEnd

2 comments:

Anonymous said...

the macro doesn't work at all :)

Anonymous said...

the macro works PERFECTLY maybe u are who doesnt work >.<