How to press directional scanner button?

dauser

Well-Known Member
I apologize if this is a stupid question. but I have googled and checked forums plenty and am getting no where. I have resorted to using a press which works but would like to do it the "proper" way. Even if someone was to tell me it was not possibly I would probably feel better lol.

The below gets the results fine but does not press the scan button.

What I have tried.
This changes from AU to KM and back. Just to check I ended up doing a loop from 0 to 30 incase it was just a matter of changing the index. Further to this I did find something that scans the window for button elements it only returned one. I should have kept that when I found it but have lost it.
"EVEWindow[directionalScannerWindow].Button[1]"

This does not find the button.
" if ${EVEWindow[directionalScannerWindow].Button["Scan"](exists)}
{
echo "Found and pressing"
EVEWindow[directionalScannerWindow].Button["Scan"]:press

}
else
{

echo "No Dscan Button Found"

}"

This works just using press seemed to hold the button down so I have had to use a hold release and it is obviously not ideal.
" Press -hold v
wait 5
Press -release v"

Any help or just direction where to look next would be greatly appreciated. 🙏

Dscan example script below.
Code:
function main()
{
    variable index:directionalscannerresult ScanResults
    variable iterator ScanResultsIterator
    variable int Counter = 1

    if (!${EVEWindow[directionalScannerWindow](exists)})
    {
        EVE:Execute[OpenDirectionalScanner]
        do
        {
            waitframe
        }
        while !${EVEWindow[directionalScannerWindow](exists)} && ${Counter:Inc} < 1000
        wait 15
        if (!${EVEWindow[directionalScannerWindow](exists)})
        {
            echo "[DScanWindow] ERROR - Unable to Open and/or Access the DirectionalScannerWidow."
            return
        }
        Counter:Set[1]
    }
          
    echo "[DScanWindow] Range set to ${EVEWindow[directionalScannerWindow].Range}"
    echo "[DScanWindow] Angle set to ${EVEWindow[directionalScannerWindow].Angle}"

    ;;;;;;;;;;;;;;;;;
    ;; SCAN
    echo "[DScanWindow] Scanning..."
    EVEWindow[directionalScannerWindow].Button[0]:Press
    do
    {
        waitframe
    }
    while ${EVEWindow[directionalScannerWindow].IsScanning} && ${Counter:Inc} < 1000
    if (${EVEWindow[directionalScannerWindow].IsScanning})
    {
        echo "[DScanWindow] ERROR - IsScanning TRUE too long"
        return
    }
    else
        Counter:Set[1]
    ;;;;;;;;;;;;;;;;;

    EVEWindow[directionalScannerWindow]:GetScanResults[ScanResults]
    ScanResults:GetIterator[ScanResultsIterator]
    echo "[DScanWindow] Scan Finished - ${ScanResults.Used} entries:"
    
    if ${ScanResultsIterator:First(exists)}
    do
    {
        echo "[DScanWindow] ${Counter}. ${ScanResultsIterator.Value.Name}  (ID: ${ScanResultsIterator.Value.ID})"
        echo "[DScanWindow] ${Counter}. -- Type: ${ScanResultsIterator.Value.Type} (${ScanResultsIterator.Value.TypeID})"
        echo "[DScanWindow] ${Counter}. -- Group: ${ScanResultsIterator.Value.Group} (${ScanResultsIterator.Value.GroupID})"
        if (${ScanResultsIterator.Value.ToEntity.ID} > 0)
        {
            ;; If ToEntity returns a value, then you have access to "Distance" as well as ALL other members/methods of the 'entity' datatype
            echo "[DScanWindow] ${Counter}. -- Distance: ${ScanResultsIterator.Value.ToEntity.Distance}"
        }
        else
        {
            ;; If ToEntity does not return a value, then the only information available for this scan result entry is ID, Name, Group, and Type
            echo "[DScanWindow] ${Counter}. -- Distance: Unknown"
        }
        echo "==="
        Counter:Inc
    }
    while ${ScanResultsIterator:Next(exists)}
}
 

dauser

Well-Known Member
Still trying to figure this out haha. I found in the .net wrapper that there was a startscan for the directional scanner. So I installed VS and gave it a crack. I was a bit concerned about the scannerobject declaration but felt a bit more confident that I have this correct after doing a ls object scan using another script.

The startscan is returning false and not pressing the button.

Obviously if someone could straight up give me the solution for .net or lavishscript I would greatly appreaciate it. But even a little direction as to where to look to figure it out for myself or confirmation that it is even possible would be awesome.

Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using EVE.ISXEVE;
using LavishScriptAPI;
using LavishVMAPI;
using InnerSpaceAPI;

private void butDScan_Click(object sender, EventArgs e)
        {

            using (new FrameLock(true))
            {


                // Retrieve the DirectionalScanner object
                LavishScriptObject scannerObject = LavishScript.Objects.GetObject("directionalscanner");
  
                if (scannerObject == null)
                {
                    LavishScript.ExecuteCommand("echo Failed to retrieve the DirectionalScanner object. Ensure ISXEVE is running.");
                    return;
                }


                // Create a DirectionalScanner instance
                //DirectionalScanner scanner = new DirectionalScanner(scannerObject);
                EVE.ISXEVE.DirectionalScanner scanner = new EVE.ISXEVE.DirectionalScanner(scannerObject);
                
                // Start a directional scan with default angle and range
                int angle = 360; // Full-circle scan
                int range = 2147483647; // Maximum range

                bool scanStarted = scanner.StartScan(angle, range);
                LavishScript.ExecuteCommand("echo " + scanStarted);

                if (!scanStarted)
                {
                    LavishScript.ExecuteCommand("echo Scan started successfully with angle {angle} and range {range}.");

                    // Retrieve scan results
                    var results = scanner.GetScanResults(angle, range);
                    LavishScript.ExecuteCommand("echo Scan results retrieved: {results.Count} objects found.");

                    foreach (var result in results)
                    {
                        Console.WriteLine(result.ToString());
                    }
                }
                else
                {
                    LavishScript.ExecuteCommand("echo Failed to start the directional scan.");
                }
            }

        }
 
Top Bottom