Hi there, I appologize for all of the code posts about to happen, but here's my story.
I attempted, using snippets copied from these forums to get market orders using ISXEVE, and ran into a few problems.
First, I don't know how to apparently assign return values of functions to variables in my main loop with lavishscript.
The following works (copied from another post, without much modification), and seems to find the correct number of orders, but can't really be used in any well designed way; but rather only as a test.
When I started cleaning that up, by the placing the portion I wanted in a function in a function, and the analytical (albeit not very, yet) part into main, by changing it to the following I get 0 orders in main.
Then, for kicks I changed it to the following, where I attempt define the variable in main, and pass it to the myOrders function since I didn't know how to get the return back... and it also didn't work (I have to admit, I'm a noob, and didn't research this one well, so I'm not sure if I need to declare the variable type in the function definition, or how I would do that, because when I tried it the way it seemed logical "function myOrders(index:myorder OrdersObj)" it didn't work).... this one was kindof a last attempt before switching to .Net to try there since there wasn't really anyone active on IRC to ask. This one fails to run at my function call in main... also fails if I pass "call myOrders(${AllMyOrders})", but I kinda expected that since I want to pass the object itself (I think?)
So, I gave up on LavishScript, which I'm very unfamiliar with, and I feel isn't documented in a way that works well for me; I do work best off examples, and there aren't many examples on here where people are working with the market portions of ISXEVE (understandably so)... And on to C#.
So, in this last one, I was attempting to basically have a form with a button, which when clicked gets all of my market orders and populates two listboxes. Every way I tried to get my market orders (and I tried many others than the one listed), GetMyOrders always seems to return null. Can anyone help me out on either the LavishScript or .Net side (I'd love it more on the .net side, but I have no aversion to learning LavishScript, which I'm imagining there's more expertise in on this forum based on other posts I read)? If anyone has an example of either of these, I'd really appreciate you sending it to me (not looking to highjack your script and dominate the market, I just want mine to do what I do manually when I manually trigger it; instead of me taking 20min to update my orders, I'd love to spend that 20min on my other account doing faction warfare or some other such fun thing... also, I just want to be more familiar with how ISXEVE works)
Anyway, I look forward to getting to know more here, and hope my frustration and hacking away at this hasn't come off as negative toward the products or community, this looks like a fun thing to play around with
I attempted, using snippets copied from these forums to get market orders using ISXEVE, and ran into a few problems.
First, I don't know how to apparently assign return values of functions to variables in my main loop with lavishscript.
The following works (copied from another post, without much modification), and seems to find the correct number of orders, but can't really be used in any well designed way; but rather only as a test.
Code:
function myOrders()
{
EVE:ClearMarketOrderCache
variable index:myorder Orders
variable iterator it
echo "Updating/Fetching My Orders..."
Me:UpdateMyOrders
wait 10
while !${Me:GetMyOrders[Orders]}
{
wait 10
}
echo Found ${Orders.Used} Orders
echo "Finished collecting my orders."
Orders:GetIterator[it]
if ${it:First(exists)}
{
if (${it.Value.IsSellOrder})
{
echo === SELL Order ===
}
elseif (${it.Value.IsBuyOrder})
{
echo === BUY Order ===
}
echo ID: ${it.Value.ID}
echo "First Exists"
while ${it:Next(exists)}
{
echo "Another Exists"
}
}
else
{
echo "None Exist"
}
return ${Orders}
}
function main()
{
echo "Starting Market Updater"
call myOrders
}
Code:
function myOrders()
{
EVE:ClearMarketOrderCache
variable index:myorder Orders
echo "Updating/Fetching My Orders..."
Me:UpdateMyOrders
wait 10
while !${Me:GetMyOrders[Orders]}
{
wait 10
}
echo "Finished collecting my orders."
return ${Orders}
}
function main()
{
echo "Starting Market Updater"
call myOrders
variable iterator it
variable index:myorder AllMyOrders
AllMyOrders:Set[${Return}]
echo Found ${AllMyOrders.Used} Orders
AllMyOrders:GetIterator[it]
if ${it:First(exists)}
{
if (${it.Value.IsSellOrder})
{
echo === SELL Order ===
}
elseif (${it.Value.IsBuyOrder})
{
echo === BUY Order ===
}
echo ID: ${it.Value.ID}
echo "First Exists"
while ${it:Next(exists)}
{
echo "Another Exists"
}
}
else
{
echo "None Exist"
}
}
Code:
function myOrders(OrdersObj)
{
EVE:ClearMarketOrderCache
echo "Updating/Fetching My Orders..."
Me:UpdateMyOrders
wait 10
while !${Me:GetMyOrders[OrdersObj]}
{
wait 10
}
echo Found ${OrdersObj.Used} Orders
echo "Finished collecting my orders."
return
}
function main()
{
echo Starting Market Updater
variable index:myorder AllMyOrders
call myOrders(${AllMyOrders})
echo AllMyOrders.Used
variable iterator it
AllMyOrders:GetIterator[it]
if ${it:First(exists)}
{
if (${it.Value.IsSellOrder})
{
echo === SELL Order ===
}
elseif (${it.Value.IsBuyOrder})
{
echo === BUY Order ===
}
echo ID: ${it.Value.ID}
echo "First Exists"
while ${it:Next(exists)}
{
echo "Another Exists"
}
}
else
{
echo "None Exist"
}
}
Code:
private void button1_Click(object sender, EventArgs e)
{
EVE.ISXEVE.EVE eve = new EVE.ISXEVE.EVE();
Me me = new Me();
List<MyOrder> OrdersList = new List<MyOrder>();
List<String> SellOrderItemNames = new List<string>();
List<String> BuyOrderItemNames = new List<string>();
using (new FrameLock(true))
{
eve.ClearMarketOrderCache();
}
Thread.Sleep(5000);
using (new FrameLock(true))
{
me.UpdateMyOrders();
}
Thread.Sleep(5000);
using (new FrameLock(true))
{
OrdersList = me.GetMyOrders();
}
if (OrdersList != null)
{
MessageBox.Show(OrdersList.Count.ToString());
}
else
{
MessageBox.Show("OrdersList is null");
}
/*
foreach (MyOrder o in OrdersList)
{
if (o.IsBuyOrder)
{
BuyOrderItemNames.Add(o.Name);
}
else
{
if (o.IsSellOrder)
{
SellOrderItemNames.Add(o.Name);
}
}
}
SellOrdersList.DataSource = SellOrderItemNames;
BuyOrdersList.DataSource = BuyOrderItemNames;
*/
}
Anyway, I look forward to getting to know more here, and hope my frustration and hacking away at this hasn't come off as negative toward the products or community, this looks like a fun thing to play around with