Connection Lost

sanderling
eve-online

#1

Hello Guys,

i am Using Sanderling now for sametime and i try to ehance the code to my needs.

My biggest Problem in the moment is that my Internetconnection is pretty unstable. 5 to 10 Times a day it lost.
So i Try to program the Mining bot to Stop.
I figure out that Eve-online bring a big “Connection Lost” Window and sanderling can mesure it:
MemoryMeasurement?.Value?.WindowOther …

So i want to make a if-statemant when the “Connection Lost” Popup comes. but i have problems to build the boolean.

Can someone write for me the right syntax for the boolean?

Thanks in advance!
Toni


#2

here you have what you need:

and even

another way was posted here

but you have to ask the ower how it solve entire thing ( kill eve process + sanderling and restart the game+sanderling)


#3

Very Nice!

i think i was near :wink:
So i put it now in my script and will test it!

Thank You!


#4

i use them both, in close modal element and close windowother because sometimes modal one doesn’t react


#5

hello kaboonus,

so i have try something like this:

if (ConnectionLost != null){
        Host.Log(" ***              Lost connection at : " + DateTime.Now.ToString(" HH:mm")+ " ***   " );
        Console.Beep(1047,150);
        Host.Delay(150);
        
} else {
	Host.Log(" ***              Online: " + DateTime.Now.ToString(" HH:mm")+ " ***   " );
}

so far so good, but i have no command to stop the bot.
When i try to use “break;” then i get the message “no loop”

i use the block inside a function.

so have you a hint for me?

Thanks!


#6

if is inside a void, use


with
Sanderling.KillEveProcess();
or like in the script
( and in this case you have to auto ok ingame) => the bot will stop automaticaly

If is in a function like Func<object> DefenseStep()
then you use


and
where you need you use return botstopactivity
like here


#7

hmm… my bot did not stop when the bot lost the eve prozess
image

it only stop when i use break in a loop and the script run to the end. in the travel script it runs without problems


#8

Better copy your script in pastebin ( make an accoun) in private mode and send me the link, too see all. From your picrure i dont understand


#9

https://pastebin.com/tCrYbG7D

here it is :slight_smile:

i am not firm in C Sorry!


#10

ok, wait to finish a site and I take a look ( 10 min from now)


#11

your line 160 it is:

    if(BotStopActivity == NextActivity){
        Host.Log("BotStop, no Next Activity?");
        break;

than means :
only if BotStopActivity == NextActivity
then he execute
Host.Log(“BotStop, no Next Activity?”);

and a new command,
break;

in other words, only if ( etc) then he show a log.
after that, the script break, even if ( ) is not true.
it should execute like that:
if ()
then execute ( hostlog and after that break)
in other words:

 
    if(BotStopActivity == NextActivity){
    { 
        Host.Log("BotStop, no Next Activity?");
        break;
    }

that means:
if (a=true) then execute(like a block) { first command+second+third+…+n} all only because if is true.
if you use
if (a=true)
execute first command (a)
then after that ; even if is not true, then B , C , D , etc.


#12

ok, i understand that , but it never happens. it only stops some times after unloading in the dock. maybe this cod epart is the reason. i have copy this from the old code.

but i think this is not the reason why the script dont stop when the eve-client lost the connection. or not?


#13

Your script it stop thz bot only when the ship is in station and his shield is small
Connectionlost window os an modal window.
At lines 340,where you detect connection lost you should add sanderling. Killeve . Use the dev interface from sanderlig, i tape on phone
later:

if (ConnectionLost != null){
	        Host.Log(" ***              Lost connection at : " + DateTime.Now.ToString(" HH:mm")+ " ***   " );
	        Console.Beep(1047,150);
	        Host.Delay(150);
	        return BotStopActivity; // or kill eve, normally sanderling should stop taking your credit
	        
 	}

#14

very nice! thank you for the command. it look like the peace i have missed.
i will test i now.


#15

The End!

This works now well for me:

var ConnectionLost = Measurement?.WindowOther?.FirstOrDefault()?.LabelText?.FirstOrDefault(text => (text?.Text.RegexMatchSuccessIgnoreCase("Connection") ?? false));
if (ConnectionLost != null){
        Host.Log(" ***              Lost connection at : " + DateTime.Now.ToString(" HH:mm")+ " ***   " );
        Console.Beep(1047,150);
        Host.Delay(150);
    	return BotStopActivity;
} else {
	Host.Log(" ***              Online: " + DateTime.Now.ToString(" HH:mm")+ " ***   " );
}