Corp Bookmarking Miners (0 viewing)
 | | |
|
TOPIC: Corp Bookmarking Miners
|
|
Re: Corp Bookmarking Miners 8 Years, 7 Months ago
|
Karma: 33
|
|
Abbadon has some good points.
1. The amount of m3 in 0.0 roids means they can all mine the same roid for hours. One lost cycle shouldn't matter. The Orca would need to go to the next roid and the miners just follow.
2. I made a post on how to do the ore calculations in the algorithm somewhere. I think if you search GetLasersData under my name it'll be right there.
I recommend following his advice on allowing windows to be moved. It gives a lot more freedom.
|
|
|
|
|
|
|
Re: Corp Bookmarking Miners 8 Years, 7 Months ago
|
Karma: 10
|
|
Innominate, I just looked at your AHK script. OH HELL NO! I am not going to be ANYWHERE near that complicated. I want simple and functional. It would be nice if someone else can use it, but my main goal is to get something usable by Me, and I don't need that much.
Abbadon, I agree I am rewriting it to use an anchor point and go from there, because I do have all of my miners on slightly different set ups. Dont want to make it easy on CCP BanHammer.
Question on Class objects though. Are classes like functions in visual basic? I can write a function/class and call it when needed? And if so are they seperate .ahk files with the class name as its name? and the function inside it?
|
|
|
|
|
|
|
Re: Corp Bookmarking Miners 8 Years, 7 Months ago
|
Karma: 33
|
Hehe, OOP is not for everyone.
AHK is a prototyping language. Its classes mirror how classes work in Java and .Net. It can all be in one file if you want.
Don't think of them as classes. The better perception is that they are objects with attributes (Height/Width) and actions (Functions to interact with the object) that you define so that things work together in a in a predictable way simply by thinking about what attribute and job belongs to what object. It also makes picking the code back up at a later point way easier. I have over 5k lines of code, but only a handful of class methods to remember.
autohotkey.com/board/topic/68877-practic...-needed/#entry436107
Here's what Abbadon was talking about:
Warning: Spoiler!| Code: |
maxDrones := 5 ; Defined for each bot
droneName := "Warrior"
DCW := new DroneControlWindow()
If(DCW.GetNumInSpace() < maxDrones){
DCW.Deploy(droneName)
}
Class Window{
;; This class is a prototype that will contain all of the attributes and functions common to all windows
;; so that you can maintain all of the basic elements of window definition/interaction in one place.
; Attributes
AnchorImage :=
AnchorColorVariation :=
;; (Contains the very basics of what is needed to instantiate a window)
__New(image){
this.AnchorImage := image
}
;; Functions of the object go here
Find(){
WinGetPos, eveWinStartX, eveWinStartY, eveWinWidth, eveWinHeight
ImageSearch, anchorX, anchorY, 1, 1, eveWinWidth, eveWinHeight, % "*" . this.AnchorColorVariation . " " . this.AnchorImage
If(anchorX = ""){
Return False
}
Return this.FindPosition()
}
;; Internal Window class use only. Use Find
FindPosition(){
;; Code to find the window's position within the Eve client window
this.StartX := ; result of finding startX
this.StartY := ; result of finding startY
this.EndX := ; result of finding endX
this.EndY := ; result of finding endY
Return result ; T/F
}
}
Class DroneControlWindow Extends Window{
;; Extends means that this class can use all of the attributes and methods of the base window class
;; Things that are unique to the DroneControlWindow go in here
;; Anything in this class that has the same variable/method name overrides what is in the base window class
LocalSpaceNumImages := ["Zero.bmp","One.bmp","Two.bmp","Three.bmp","Four.bmp","Five.bmp"]
DronesInLocalSpaceImage := "DronesInLocalSpaceImage.bmp"
__New(){
}
; Internal method
FindDronesInLocalSpaceImage(){
;; Find is defined in the base Window class
If(this.Find() = False){
Return False
}
ImageSearch, numX, numY, this.StartX, this.StartY, this.EndX, this.EndY, % "*30 " . this.DronesInLocalSpaceImage
If(numX = ""){
this.DronesInLocalSpaceImageX := numX
this.DronesInLocalSpaceImageY := numY
}
Else{
Return False
}
}
GetNumInSpace(){
If(this.FindDronesInLocalSpaceImage() = False){
Return False
}
For i, numImg, in this.LocalSpaceNumImages
{
ImageSearch, numX, numY, this.StartX, this.StartY, this.EndX, this.EndY, % "*30 " . numImg
If(numX != ""){
this.NumInSpace := i
}
}
}
Deploy(droneType){
;; Code to deploy drone with name equal to droneType
}
}
|
|
|
|
|
Last Edit: 2017/05/19 17:33 By innominate.
|
|
|
Re: Corp Bookmarking Miners 8 Years, 7 Months ago
|
Karma: 845
|
It took just 3 days to teach AHK and write first miner 8 years ago! AHK became quite complicated now or is it just innominate who is reading too many of manuals? 
|
|
|
|
Last Edit: 2017/05/19 17:58 By Slav2.
|
|
|
Re: Corp Bookmarking Miners 8 Years, 7 Months ago
|
Karma: 33
|
Hehe, AHK can be as simple or complicated as you want! If all that structure is unnecessary, then why did you switch over to .NET OOP code?  (I even remember finding your name on a group project converting some AHK stuff into a .NET compatible language.)
It is all about how easy you want it to be to maintain and reuse your code. In the almost 2 years I've had my code running, now up over 5k lines of code, there's been only 3 patches that required me to update my code, where all but one took less than an hour. When they changed to the new probe scanner, that took me about an hour and a half to redefine the the ProbeWindow class attributes and validate that it works. It only took that long because there is a top and bottom part, and my code works regardless of where the separator is. From scratch it just took me 15 minutes to make a fully working DirectionalScanner window class because it just uses the other classes.
|
|
|
|
Last Edit: 2017/05/20 03:13 By innominate.
|
|
|
Re: Corp Bookmarking Miners 8 Years, 6 Months ago
|
Karma: 10
|
I have edited and am using CorpBMv1 script for the mining drones, figured you already knew this.
At the moment I am using this snipit of code to limit the number of bookmars that are dropped.
Warning: Spoiler!
IniRead, CanCount, EPVars.ini, Bookmarks, CanInSpaceCount
If(CanCount <3){ ;Number of cans in space before BM'ing -1 so 4 cans = 3, 5 cans = 4.
CanCount++
IniWrite, %CanCount%, EPVars.ini, Bookmarks, CanInSpaceCount
IniWrite, True, EPVars.ini, Bookmarks, CanInSpace
Sleep 25
ExitApp
}
What I am watching happen is...
Ship logs in, warps to a belt, drops a BM. starts mining, jets a can, renames a can HH:MM, next time it is ready to jet, it might reuse a can or it might jet another can.
Any ideas on how we can go about just pooping out 4 cans then dropping a BM?
Edit:
Just thought about it. That is risky leaving that may cans out. With thieves and disconnects, may lose more than i think.
With my remove duplicates coding, it will be best i think to BM every can.
|
|
|
|
Last Edit: 2017/05/22 03:20 By Minesalot.
|
|
|
 | | |
|
|
© Macro Laboratory 2025
All rights reserved!
|