Page 1 of 1

auto looter discussion

Posted: July 15th, 2009, 5:51 am
by ac251404
Finally got on Darkfall for the first time yesterday. Been waiting for NA-1 launch. Needless to say I have found most of what I needed to get a good start here, swimming, gathering, MM macros, etc. The biggest problem I've been having is looting. Right now I'm just beatin on goblin so its not too big a deal, but I'm lazy and all the click dragging is going to give me carpal tunnel.

I make my living as a software developer (mostly in web-based apps tho), and my interest in the field was actually sparked by macroing for UO back in the day. So now here I am come full circle and want to apply some of my l33t skillz (/sarcasm) to making an auto looter.

I would just like to get input on and discuss how we might approach making a good solid auto looter. What should it be written in? How should it be configured? How fast should it be?

My first thoughts:

I understand wyvernx is working with data taken directly from game memory for his teleporter/speed hack/etc. I have no experience in locating such memory values or anything like that, and I am unsure to what degree something like a loot window (and contained objects) would be exposed. I am thinking that any information we could access would be fairly unusable since any action we take needs to be in regard to A) the open loot window, B) the looters backpack. I doubt there is any way to take values from memory and convert them into screen coordinates which we could use for click dragging.

My first idea is basically a brute force method. I have not done much work with AutoIt so I have no idea what the speed implications would be of this approach. Basically, you would exhaustively check pixel colors of the loot window, looking for any that differ from the background of the window. I doubt you would need to check every pixel, possibly just 1 in 5, or 1 in 10 to still get good results (due to the size and orientation of most items i've seen in backpacks).

So if there is no real way to use a custom type app to make use of memory values, I think AutoIt is probably the next best approach. I believe its faster than AHK and seems like a more powerful platform in general.

I would like to hear others thoughts on this. I am open to other ideas because this is something I'd really like to put some time into and I want it to be useful for everyone.


EDIT:

okay a bit of preliminary testing makes think that this is feasible. I put together a little script to pixel scan an area and count all white pixels and count all other colored pixels. I ran it over ~500x500 pixel area, roughly 250k pixels. I ran the loop such that it scanned every other row and and every other column. It came out to about 66k pixels that were scanned and on my 2.0Ghz Core2 ran in 745ms. Next I'm gonna test dragging. Right now im testing just using windows explorer windows since I dont have access to DF right now. When I get something close to working I'll post it up.

Posted: July 15th, 2009, 7:18 am
by ac251404
Okay here is something basic I banged out just to get the form and layout of what I wanted to do. This is not meant for DF yet, no checking for client open, active window, etc. I am not at home right now so like I said, I'm just testing it with Explorer windows and moving files from one folder to another. I made the window sizes roughly that of the bags in DF and it seems to be going pretty quick. Moved 4 items all the way across the screen in 3.2 seconds.

Am I on the right track with this? It seems fairly trivial and I'm surprised I haven't seen something similar around here yet, unless its buried somewhere.

Code: Register to unlock hidden link

; CONSTANTS

HotKeySet("{F2}", "DoLoot")
HotKeySet("{DEL}", "Terminate")
$BGCOLOR = 16777215

; CONFIG

; loot top left
MsgBox( 0, "Alert", "Click OK and then hover over your the top left of loot bag." )
Sleep( 3000 )
$MousePos = MouseGetPos( )
$top = $MousePos[1]
$left = $MousePos[0]

; loot bottom right
MsgBox( 0, "Alert", "Click OK and then hover over your the bottom right of loot bag." )
Sleep( 3000 )
$MousePos = MouseGetPos( )
$bottom = $MousePos[1]
$right = $MousePos[0]

; drop location
MsgBox( 0, "Alert", "Click OK and then hover over your drop spot." )
Sleep( 3000 )
$MousePos = MouseGetPos( )
$dropy = $MousePos[1]
$dropx = $MousePos[0]

MsgBox( 0, "Alert", "Okay coordinates configured. Press F2 to loot, DEL to end script." )

; IDLE LOOP
While 1
	Sleep(300)
WEnd
	
; FUNCTIONS

; kill script
Func Terminate()
	MsgBox( 0, "Alert", "Ending Script." )
	Exit
EndFunc
	
; scan area and move loot items
Func DoLoot( )
	$moved = 0
	$start = TimerInit()
	
	For $y = $top To $bottom Step +2
		For $x = $left To $right Step +2
			$col = PixelGetColor($x, $y)
			If $col <> $BGCOLOR Then
				MoveItem($x, $y, $dropx, $dropy)
				$moved += 1
				Sleep(50)
			EndIf
		Next
	Next
	
	$time = TimerDiff($start)
	MsgBox(0, "Msg", "Moved " & $moved & " items in " & $time & " ms")
EndFunc

; simple wrapper for MouseClickDrag
Func MoveItem($fromx, $fromy, $tox, $toy)
	MouseClickDrag("left", $fromx, $fromy, $tox, $toy, 1)
EndFunc

Posted: July 15th, 2009, 11:10 am
by dabladest
The main question is .. How safe is it ?

There have been temporary Bans for people who used some Autolooters

Posted: July 15th, 2009, 11:26 am
by ac251404
Any more info about how they could be detected? The only way I could see it is if they can track how long it takes for an item to get into your bag from a corpse. In this case you would have to slow the drag-time down and add some randomization to it. If you did that I don't really see how they could tell, but then you start approaching the point of diminishing returns.

I do know that some poker sites track actual mouse movements on players computers to detect poker bots. Adding random movement is not the correct fix. Adding a Gaussian distribution over the distance of the mouse movement is what's called for. I can probably dig up the code for this somewhere, but I highly doubt AV is devoting CPU cycles to analyzing players mouse movements.

I have worked a bit more on this and it has 2 modes now. One auto loots everything from a bag, the other is a hover-loot option where you just mouse over an item and hit a key to move it to your pack. It also has an always-on-top gui which can be hidden/shown and configurable key bindings.

Going to do some testing with them tonight and see how effective they are. Any more input is appreciated. If all goes well I'll post up a version tomorrow.

Posted: July 15th, 2009, 12:08 pm
by devestator
A few things to note,

First off using pixel detection as your attempting to do would require you to run the game in windowed mode for it to work, just make sure to note that.

Another thing, there are lots of working auto looters out there already using this method, you just have to specify the coordinates of your backpack and the loot bag for it to work correctly.

And last on the note of detection and banning, every time you loot an item it sends a message to the server to make sure the item is still there and available and then moves it to your backpack. I'm fairly certian they track auto loot scripts by these requests coming in faster than normal. Althoguh I can't be certian about that. To track mouse movements would require to much resources IMO for this kind of game. The client could track your movements and be coded to send a flag back to the server if it met certian conditions, but I honestly don't believe that is used because it's not a full proof solution. The request times seems much more likely.

With that said, this means you would have to slow down the autoloot to the point that it looks humanish in the timefrain it takes to do it. And if you just don't feel like dragging the stuff yourself this is fine by all means go for it. But it's not going to be able to loot any faster and still look human.

Posted: July 15th, 2009, 12:17 pm
by ac251404
right i see what you are saying. i added in randomization to the drag speeds and mouse movements. the windowed mode thing does suck and i hadn't realized that before. also, i hear about these other auto looters... but I've only seen one halfway decent looking one here, using AHK. If I'm mistaken please point me to them. I was just trying to create something solid, reliable and configurable for others to try out that visit here. I really don't venture to other sites and there seems to be a lack of "updated" stuff like this. And I also don't believe the other auto-looter i refer too does entire bags, just Ctrl+Left click to loot. Again, correct me if I'm mistaken and thanks for the input.

Posted: July 15th, 2009, 6:30 pm
by Tault_admin
Yea when doing auto looters i would just set it to be somewhat slower because then you have no worries about being detected. Make it faster than normal players but just not to fast and your safe.