Market Bot Implementation

Has anyone done a market bot implementation using Sanderling?  Also, how the heck to I create a new file in the tool?  I can edit the existing two (autopilot and mining), but I can’t seem to figure out how to start a new file.

Also, how the heck to I create a new file in the tool?  I can edit the existing two (autopilot and mining), but I can’t seem to figure out how to start a new file.

To save the current script from the editor into a file or load a script from a file, switch to the “save / load”->“save to / load from file” tab. To save to a file, drag it from windows explorer on the “write to file” button. To load from a file, drag it from windows explorer on the “read from file” button.

You can also load from a file when the editor is visible by dragging it into the editor. It will then be inserted at the current location of the caret.

You can also use the keyboard shortcut CTRL+S to save the current script to the path “scriptdefault.cs”. When the app starts, it loads the contents of this file into the editor.

Has anyone done a market bot implementation using Sanderling?

I have not worked on a market bot yet but I already included everything into the API I already know is required for a market bot.

In case there is something missing, let me know.

Thanks for the responses so far!

I’m partway through a very simple order update script and have a few questions:

  1. In my orders window : I can only get the list of table entries that are visible.  Is there any way to get the whole list, or to “know” that there is a scrollbar and that it should be scrolled? (this actually counts for the list of orders in the Market window itself too…).

  2. Is it possible to figure out which entries are “my orders” in the market window itself?  Currently I right click every entry and check for the “modify order” menu entry.  But this seems a bit of a silly way.  Can you maybe somehow “see” the blue colour using the API?

A last question is - will there be costs involved in the future using this framework?  I don’t want to spend a lot of time developing a script and then have a monthly recurring cost.  I don’t mind a once-off, but having to pay for a bot monthly negates why I want to bot in the first place - to not pay a monthly fee to play EVE!

Thanks for a great framework so far!

1 Like

Thanks for the responses so far!

I’m partway through a very simple order update script and have a few questions:

  1. In my orders window : I can only get the list of table entries that are visible.  Is there any way to get the whole list, or to “know” that there is a scrollbar and that it should be scrolled? (this actually counts for the list of orders in the Market window itself too…).

The scrollbars in the “my orders” window are not available because I oversaw them. I will add them soon. They will then work the same way as the other scrollbars.

It is not possible to get items which are outside the scroll viewport, but scrolling is very simple. You can use arrow keys or page up/down keys for example:

Sanderling.KeyboardPress(VirtualKeyCode.DOWN);Sanderling.KeyboardPress(VirtualKeyCode.UP);Sanderling.KeyboardPress(VirtualKeyCode.NEXT); // page downSanderling.KeyboardPress(VirtualKeyCode.PRIOR); // page up
  1. Is it possible to figure out which entries are “my orders” in the market window itself?  Currently I right click every entry and check for the “modify order” menu entry.  But this seems a bit of a silly way.  Can you maybe somehow “see” the blue colour using the API?

Yes, it actually way simpler since you can directly get all the background colors of each entry. You find them in the

ListBackgroundColor

property of the entry. The screenshot below shows the whole path from root to the background color in an list entry:

background color of listview entry.

The following code sample

  • defines a function which returns whether a given entry contains a blue background,
  • uses this function to get a reference to the first order with blue background in the sellers section of the regional market window
  • and writes the info of that entry to log.
using Parse = Sanderling.Parse;using MemoryStruct = Sanderling.Interface.MemoryStruct;  bool ContainsBlueBackground(MemoryStruct.IListEntry Entry) =>     Entry?.ListBackgroundColor?.Any(BackgroundColor => 111 < BackgroundColor?.OMilli && 777 < BackgroundColor?.BMilli && BackgroundColor?.RMilli < 111 && BackgroundColor?.GMilli < 111) ?? false;  var    FirstBlue    =     Sanderling.MemoryMeasurementParsed?.Value?.WindowRegionalMarket?[0]?.SelectedItemTypeDetails?.MarketData?.SellerView?.Entry?.FirstOrDefault(ContainsBlueBackground);  Host.Log("FirstBlue: " + string.Join(", ", FirstBlue?.ListColumnCellLabel?.Select(ColumnCellLabel => ColumnCellLabel.Key?.Text + " : " + ColumnCellLabel.Value)?.ToArray() ?? new string[0])); 

A last question is - will there be costs involved in the future using this framework?

Probably yes.

I don’t want to spend a lot of time developing a script and then have a monthly recurring cost.  I don’t mind a once-off, but having to pay for a bot monthly negates why I want to bot in the first place - to not pay a monthly fee to play EVE!

Thanks for a great framework so far!

If you spend a lot of time on developing a script, maybe I can help make development more efficient. So far I don’t know how your workflow looks like and where this time goes.

Also keep in mind that a bot can make you more than just one plex a month. For example my mission running bot which is also based on sanderling makes two plex per month just running level 3 security missions.

Thanks for the awesome detailed feedback so far - I will work on it tonight!

I have a problem with “Sanderling.TextEntry”. When I use it to enter text into the Change Order text box it does not type the dot in a number with a decimal value.  So, a value like 13.21 end up being typed as 1321 (which will bakrupt me quickly!).

marketAction = measurement?.WindowMarketAction?.FirstOrDefault();

var priceBox = marketAction.InputText.FirstOrDefault();

// make sure the text box is clear

Sanderling.MouseClickLeft(priceBox);
Sanderling.KeyboardPressCombined(new{ VirtualKeyCode.LCONTROL, VirtualKeyCode.VK_A});
Sanderling.KeyboardPress(VirtualKeyCode.DELETE);

// format the double as string with two decimals
String newValueString = String.Format(“{0:0.##}”, newValue);

// type the value into the price box
Sanderling.TextEntry(newValueString);

In the code above I have also tried newValue.ToString() with the same problem.

Regarding my comment on pricing:

My biggest problem is with other (good) bots asking a monthly subscription.  I will gladly pay once off.  If the bot costs me every month what an EVE subscription is - I’d rather pay the EVE subscription and not bot at all.  I’m not trying to be cheap - it’s just that my country’s currency have devaluated so much that an EVE subscription costs 2x what it used to cost and it’s getting too expensive to play.  I can PLEX playing the market and want to write a simple bot to do the tedious bits.

Thanks again for your time!

1 Like

Another quick question - can I send my script to you if I have questions or just for general comment?

Thanks for the awesome detailed feedback so far - I will work on it tonight!

I have a problem with “Sanderling.TextEntry”. When I use it to enter text into the Change Order text box it does not type the dot in a number with a decimal value.  So, a value like 13.21 end up being typed as 1321 (which will bakrupt me quickly!).

I suggest you try to enter the price using this function:

void EnterPrice(double price){     var portionInteger = (int)price;     var cent    = ((int)(price * 100)) % 100;     Sanderling.TextEntry(portionInteger.ToString());     if(0 < cent)     {         Sanderling.KeyboardPress(VirtualKeyCode.DECIMAL); // use OEM_COMMA if your locale setting has comma as decimal separator.         Sanderling.TextEntry(cent.ToString("D2"));     }        }

Regarding my comment on pricing:

My biggest problem is with other (good) bots asking a monthly subscription.  I will gladly pay once off.  If the bot costs me every month what an EVE subscription is - I’d rather pay the EVE subscription and not bot at all.  I’m not trying to be cheap - it’s just that my country’s currency have devaluated so much that an EVE subscription costs 2x what it used to cost and it’s getting too expensive to play.  I can PLEX playing the market and want to write a simple bot to do the tedious bits.

Thanks again for your time!

I will sleep over this a night or two before making a promise. Which country is that?

Another quick question - can I send my script to you if I have questions or just for general comment?

Sure, you can do that. Scripts posted on the forum will have priority though.

Thanks - clever idea with the money entry!

I’m from South-Africa.  Just look at that graph!  Every time our president opens his mouth our currency takes a beating again :frowning:

https://www.google.co.za/search?q=1+us+dollar+in+rand&rlz=1C1CHMO_enZA528ZA528&oq=1+us+dollar+in+rand&aqs=chrome…69i57j0l2.3568j0j7&sourceid=chrome&es_sm=122&ie=UTF-8

I have a question about clicking a UI element.  It seems as if the bot clicks randomly within the rectangle of the item.  Is there a way to constrain this somewhat?

Some elements has a small “i” information icon to the right, and sometimes it will click on that, opening the info of an item.

In text boxes the cursor changes to a caret and it’s a bit sensitive if the cursor is placed too high, or too far left or right.

I like the random behaviour, I just want to shring the box in which it can click randomly.

I have a question about clicking a UI element.  It seems as if the bot clicks randomly within the rectangle of the item.  Is there a way to constrain this somewhat?

Some elements has a small “i” information icon to the right, and sometimes it will click on that, opening the info of an item.

In text boxes the cursor changes to a caret and it’s a bit sensitive if the cursor is placed too high, or too far left or right.

I like the random behaviour, I just want to shring the box in which it can click randomly.

I found a quick solution that works without any changes to the Sanderling binary. Yet another custom input function which allows you to specify the size of the region the bot should click in. The center of that region is on the center of the UIElement:

MotionResult MouseClickWithRegionSubstituted(     IUIElement destination,     Vektor2DInt regionSize,     MouseButtonIdEnum mouseButton)    =>     Sanderling.MotionExecute(new MotionParam()     {         MouseListWaypoint = new[]{ new MotionParamMouseRegion()         {             UIElement = destination,             RegionReplacement = new RectInt(-regionSize.A / 2, -regionSize.B / 2, regionSize.A / 2, regionSize.B / 2),         }},         MouseButton = new[]{mouseButton},     });  MotionResult MouseClickLeftWithRegionSubstituted(     IUIElement destination,     Vektor2DInt regionSize) =>     MouseClickWithRegionSubstituted(destination, regionSize, MouseButtonIdEnum.Left);

Medium-term I will address the information button issue by including the button into the Measurement so that the framework will recognize it as occluding UI element.

1 Like

Thanks a lot - I will try that.  I was thinking along the lines of creating an object and setting the region myself. It looks as if you are doing the same thing here.

I am nearly done with a very basic order updater thanks to all your help!

  1. In my orders window : I can only get the list of table entries that are visible.  Is there any way to get the whole list, or to “know” that there is a scrollbar and that it should be scrolled? (this actually counts for the list of orders in the Market window itself too…).

I just published a version which contains the reading of the scrollbars: http://forum.botlab.org/thread/sanderling-preview-16-00-18/

Let me know if you progress. i,m very interested in this type of bot. i have been using stealhbot but it does not implement a market bot.

This is not a working link?

Wrong thread, sorry :slight_smile:

Hi there, is that bot working right now?