Code:
Func TraderRequestSellByCoords($TraderCoords)
Local $ModelIdValue = GetItemBySlot(1,1)
Local $Item = GetItemBy('ModelId',$ModelIdValue)
Local $ItemQuantity = Floor(Round(GetItemProperty($Item, 'Quantity') / 10,1))
Local $Trader = GetNearestAgentToCoords($TraderCoords[0], $TraderCoords[1])
GoToNPC ($Trader)
For $i = 0 To $ItemQuantity
Sleep (GetPing()+100)
TraderRequestSell($Item)
Sleep(GetPing()+100)
TraderSell()
Next
EndFunc
I made this function quickly at work, so it might contain little errors.
Make sure you replace the value of
$ModelIdValue with i.e.
$ModelIdValue = 2903, as of now we just pass the ModelId of the first item in our Backpack.
I could not test this, but i think the problem here is that we don't need to pass the ModelId to the Trader. The
TraderRequestSell() function wants us to pass the
$aItem Value of the
GetItemBy() function.
I hope this helped.