MARVEL script, ratting at a new level

Error	897	11	CS0136	A local or parameter named 'probeScannerWindow' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter

It gives me this error

move them before

var probeScannerWindow = Measurement?.WindowProbeScanner?.FirstOrDefault();
var scanActuallyAnomaly = probeScannerWindow?.ScanResultView?.Entry?.FirstOrDefault(ActuallyAnomaly);

        if (  ListCelestialToAvoid?.Length > 0)
1 Like

il put it before the “if”-s. and it seems now no more errors. i try it tha give you a report :slight_smile:
Thanks for the help :slight_smile:

1 Like

var InventoryListItem = WindowInventory?.SelectedRightInventory?.ListView?.Entry?.ToArray();
var MtuItem = WindowInventory?.SelectedRightInventory?.ListView?.Entry?.FirstOrDefault()?.LabelText?.FirstOrDefault(entry => entry?.Text?.RegexMatchSuccessIgnoreCase(MTUName) ?? false);
var probeScannerWindow = Measurement?.WindowProbeScanner?.FirstOrDefault();
var scanActuallyAnomaly = probeScannerWindow?.ScanResultView?.Entry?.FirstOrDefault(ActuallyAnomaly);
if (probeScannerWindow == null)
FlashWindowProbes();
EnsureWindowInventoryOpen();
EnsureWindowInventoryOpenActiveShip();

if (activeshipnameRatting && !SpeedWarping)
{
    if (combatTab != OverviewTabActive)
    {
        Sanderling.MouseClickLeft(combatTab);
            Host.Delay(1111);
    }
    Messages("ratting mode? :   " +WindowInventory?.ActiveShipEntry?.Text+  "  " );
if (BackOnMainStep)
    {
    Host.Log("               tethering zone, not on site!");
    return null;
    }
    if ( (0 < listOverviewEntryFriends?.Length || ListCelestialToAvoid?.Length > 0 ) 
    && ReadyToBattle)
    {
        if (  ListCelestialToAvoid?.Length > 0)
        {

deleteBookmark ();
ClickMenuEntryOnMenuRoot(scanActuallyAnomaly, “Ignore Result”);
Host.Log(" Gas Haven, better run!!");
WarpInstant();
}
if (Measurement?.ShipUi?.Indication?.ManeuverType != ShipManeuverTypeEnum.Orbit )
{
Messages(" Friends on site!");
ActivateArmorExecute();
if (listOverviewMtu?.Length >0 )
RecoverMtu ();
if (OldSiteExist)
deleteBookmark ();
return TakeAnomaly;
}

I put here. But its not working. it goes in again and again, and not ignoring the site :S

and this is really strange, because on original script you have also

while (SpeedWarping)
{
    while(K>0)
    {
        CheckLocation();
        K--;
    }

    if ( KmIndication)
    {
        var probeScannerWindow = Measurement?.WindowProbeScanner?.FirstOrDefault();
        var scanActuallyAnomaly = probeScannerWindow?.ScanResultView?.Entry?.FirstOrDefault(ActuallyAnomaly);
        if ((null != scanActuallyAnomaly) && 0 < listOverviewEntryFriends?.Length && ListCelestialObjects?.Length > 0)
            ClickMenuEntryOnMenuRoot(scanActuallyAnomaly, "Ignore Result");
        if (OldSiteExist && !Tethering && ( 0 < listOverviewEntryFriends?.Length || ListRatOverviewEntry?.Length > MaxRatsOnGrid || ListCelestialToAvoid?.Length > 0))
        { Host.Log("               deleting my bookmark"); deleteBookmark();}
    }

}

and you say it doesnt delete ( any anomaly )right before stoping in anomaly ( since you have the anomaly there).
also, even if you put the line like I said, it doesnt delete the anomaly.

Honestly I dont know why this is hapening in your case, because in my case is working flawless.
I cannot help you , sorry

It deletes al off the anomalys and just let haven-s active.
But if gas haven is the first one then he jumps in, then back to the station, and he start it again, jump to the site then home.

But the biger problem is this morning the bot stucks at this point and i try-d to start it but i dont gets what is the problem. he only clicks to the system info and thats it. and i dont get what i modify to get this result :S

07-29-20 353 retreat On Tethering Zone
07-29-20 2064 # Checking for bookmarks
07-29-22 1434 OldSiteExist : False
07-29-22 674 ready for rats
07-29-23 177 > — Started in ---- script: MARBEL-1v3 ; Logout in: 05:19:36 ; Sites 0 ; Rats : 0 ; killed 0 ; Local Count / Visibles : 4 / 21 ; ☾⊙☽ Shield: 100% ; Armor: 100%
$$$ At begining : 342 622 481 $$$ Current wallet : 342 622 481
⊙ ISK in this session : 0 ; ⊙ MAx Time for hostiles : 15 min.
⊙ OldSiteExist : False ; ⊙ Use Drones for Salvage : False ; ⊙ Site Finished : False
>> Hostiles: 0 ignored: 0 Drones: (All/heavy): 8( 8 ) space:0 ; Targets: ; Cargo: 21% ; Salvagers (inactive): 0(0 ; Wrecks: 0
<<<<<☾⊙☽>> Retreat Msg : Retreat!! Dread on Grid!!
<<☾⊙☽>> Last or Current Msg: OldSiteExist : False

                          <<☾⊙☽>>>>>>>> My Ship EWAR  II :    tethering
                         <<☾⊙☽>>          Ship Indication:  
                         <<☾⊙☽>>          NextAct:  <<☾⊙☽>>  MainStep

07-29-24 353 retreat On Tethering Zone
07-29-24 2064 # Checking for bookmarks
07-29-25 2064 status transition from Running to Pausing.

you see this? at the line 231

 if ((null != scanActuallyAnomaly) && 0 < listOverviewEntryFriends?.Length && ListCelestialObjects?.Length > 0)
         

let only

if ((null != scanActuallyAnomaly)
            ClickMenuEntryOnMenuRoot(scanActuallyAnomaly, "Ignore Result");

it seems there you have some rats considered like dread

string runFromRats = "♦|Titan|Dreadnought|Autothysian";

if the rats with “:diamonds:” in their name(/type) are at 500000 km , but “visibles” in overview, then you will be start the retreat , because this rats are really bad .
but sometimes ( at 30-150 sites done) there are false allarms you cannot do nothing about that, I try for a year to triple check this and still is there.
because actually is true
Now I say someting from my experience for a long year of botting:
So the Sanderling read the memory of game.
and from a point of view of memory there are entities in your system even if in you interface are not visibles. And Sanderling read that, sometimes even if you dont have a clear reading( so they are not visibles in your measurements).
And is not regular, because the game “think” you are there and show the things near you.
to explain better, ( if you read the entire forum you read that)
there are times when a red coming in system, but he is not visible on local chat.( he is in jump from system to system) . Well the game , in memory, it has him in your system, and this is detected silently by Sanderling. => sometimes, you retreat and warp home even if there is no read. You see there is no read , But when you warp back, you see the red is coming. And I tested and is always the name indicated by sanderling. But since the red delay is too big, then it disapears from memory, Sanderling take that and warp you back on site.

After couple hundreds times of tests I adjusted the code, so you stay a litle more near station to see if a red is comming or not ( so you are not warping back in site and when you are in warp , the red is in your system
For the dreads is the same:
in your system near you, there is a dread in memory.
In this case, change the station , chose a station where are no dreads ar change the system.
If not, restart the game and Sanderling to clean memory

1 Like

For the life of me, I still can’t figure out why the sansha NPC’s still target my drones. I’m orbiting a large collidable object at 30km. It happens when I warp in and initially target the NPC’s, I have a target painter and everything. Do I set the drones on passive? Yes focus fire? No focus fire? Do I need to add a host.delay before launching drones so they focus me first? Do I need to lower the lock target amount to say 3 or 4? Idk guys I’m all out of ideas! Imperial drones are expensive :stuck_out_tongue:

Could you explain this?
if it happens for you, you could add

Sanderling.KeyboardPress(attackDrones);

on activate painter void

So keyboardpress(attackdrones) goes inside of

void ActivatePainterExecute()
{

    var SubsetModulePainter = Sanderling.MemoryMeasurementAccu?.Value?.ShipUiModule
        ?.Where(module => (module?.TooltipLast?.Value?.IsTargetPainter ?? false) || (module?.TooltipLast?.Value?.IsTargetPainter?? false));
    var SubsetModuleToToggle =
        SubsetModulePainter
        ?.Where(module => !(module?.RampActive ?? false));
    foreach (var Module in SubsetModuleToToggle.EmptyIfNull())
        ModuleToggle(Module);
}

On top of the first var SubsetModulePainter? What would that line of code do?

this is the mechanic of game man; did you search over internet why it aggro your drones?
your aggro is smaller than drones aggro, and honestly I dunno the mechanic on sansha rats.
YEs, like I stated in my wiki and over all forum, you have to set your drones on passive; otherwise why you think I put there attack drones command?

you could try, but aggro mechanic it doesnt have anything with aggro on drones because YOUR ship aggro is smaller than Drones aggro
and in the end one question: I already told EVEN ON THIS TOPIC how to solve the drones aggro by leaving the ship and boarding after 1 min. and on forum are like 20 topics with same problem.
Now, you wanna I come at your computer, read the forum and search over the internet and play the game? Be serious man! I wont do that even if you pay me with 5000£/min.

learn to play the game and learn to read the code, TRY AND TEST! You have an entire Internet for that.

Thanks its working again.
I have to restart 2 times to get that memory erase.

If i want to do some ratting in Drones regain like “The kalevala expanse”
what you suggest for me? :slight_smile:
Sorry for the lot of problem what i generate :slight_smile:

what is “The kalevala expanse” ?
I have no idea so I cannot suggest something

its the region name, like Gemainate or Delve.
I try to modify the faction name at the drones line.
But it not indentify it :S
I read the forums all over but not see the solution. thats why i ask you :slight_smile:

well, is simple:
if you are not sure what region name it take the script, then after

var CurrentRegion = InfoPannelRegion.Substring(InfoPannelRegion.LastIndexOf(' ')).TrimStart();
 Host.Log( "region :" +CurrentRegion );  //add this

I already told that on diverses topics
and even my wiki enlighten you , if you know how to adapt yourself

if you do not know in what region you are, then you ask yourself:
ok, what region it take the script?
lets ask him, i see

Host.Log(CharName);

and looking on script I see region, so what if i change Charname with region?


In the end … sorry man, you have to learn to do things by yourself, i have no intention to keep the pants of each user because he wanna change a string value and he want somebody else tell him ( like in 1degree at school) what to do , before he made any change.
More than that myself I learn, tested, experimented etc. all by myself and with almost 0 help. and All from zero knowledge when there was only 2-3 samples of script. i dedicated time and energy to learn, I watched at each line in samples and developed this scripts . and it took 1 year to make almost good scripts. And i keep learn, watch over internet and ask only about the essential stuffs or if there is another way, better to do the same stuff.

1 Like

17:24:58.950 [916] : status transition from None to Failed.
17:24:58.930 [915] : RuntimeException: System.AggregateException: One or more errors occurred. —> System.AggregateException: One or more errors occurred. —> System.InvalidOperationException: Nullable object must have a value. at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at System.Nullable1.get_Value() at Submission#0.<DefenseStep>b__148_6(IShipUiTarget target) at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func2 predicate) at Submission#0.DefenseStep() at Submission#0.<<Initialize>>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.<RunSubmissionsAsync>d__91.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Scripting.Script1.<RunSubmissionsAsync>d__21.MoveNext() --- End of inner exception stack trace --- at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at BotSharp.ScriptRun.ScriptRun.<>c__DisplayClass75_1.b__3() at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.Wait() at BotSharp.ScriptRun.ScriptRun.<>c__DisplayClass75_0.<Start>b__4() ---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Nullable object must have a value. at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at System.Nullable1.get_Value() at Submission#0.b__148_6(IShipUiTarget target) at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func2 predicate) at Submission#0.DefenseStep() at Submission#0.<>d__0.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.d__91.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Scripting.Script1.d__21.MoveNext() — End of inner exception stack trace — at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at BotSharp.ScriptRun.ScriptRun.<>c__DisplayClass75_1.<Start>b__3() at System.Threading.Tasks.Task1.InnerInvoke() at System.Threading.Tasks.Task.Execute() —> (Inner Exception #0) System.InvalidOperationException: Nullable object must have a value. at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at System.Nullable1.get_Value() at Submission#0.<DefenseStep>b__148_6(IShipUiTarget target) at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func2 predicate) at Submission#0.DefenseStep() at Submission#0.<<Initialize>>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.<RunSubmissionsAsync>d__91.MoveNext() — End of stack trace from previous location where exception was thrown — at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Scripting.Script`1.d__21.MoveNext()<— <—
17:24:58.825 [914] : Defense step

Sorry for being a bad coder, but what does this error code mean? I haven’t been able to reproduce it thus so far so im not sure what w as going on in the eve client but it was in the middle of a site.

I can see you was in defensestep and since it talks about

it have to be about trying to target or click or something else ( mostly a n click on targeted list ) who wasnt actualized. so the object was null, without a value.
its a first when it happening this one and we ( i mean I) cannot solve them because is about .
if this one it trouble you, you can take an older commmit, before i had divised the list in frigates and bigger ships.

this is happens even on overview, but there it take the item in place. here, since i dont have an remplacement, there is nothing to do ( except an protection, right in the midle of click, because the item become null exactly then)
**maybe i will find another solution later, for now I’m real bussy in RL , 2-3 weeks )

2 Likes

Ah okay. It was my first error message of the type so no worries. It’s pretty rare to happen I think. Thanks.

1 Like

is something conjunctural, when he wanna click on uelement, right then it dissapear and become null

Could I add a snippet where after you launch your drones for the first time and they engage, 10 seconds later you force recall them to drop NPC aggro? Where would I put this nested var? It just needs to happen once at the beginning of the site.

sure you can, but you have to think how you monitor the time and check often without any damage to bot flow

Managed to get something to work. If someone wants that snippet of code to deaggro drones, I’d be happy to share. I also got this error code today:

23-35-26.673: RuntimeException: System.AggregateException: One or more errors occurred. —> System.AggregateException: One or more errors occurred. —> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.Collections.Generic.List1.get_Item(Int32 index) at Submission#0.ReturnToOldSite() at Submission#0.MainStep() at Submission#0.<<Initialize>>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.<RunSubmissionsAsync>d__91.MoveNext()
— End of stack trace from previous location where exception was thrown —