Page 1 of 1

Python Moving Items

Posted: 11.08.2016 0:39
by arul
Hello,

I'm experiencing the following problem while trying to move items via Python:

Code: Select all

for ore in [0x19B7, 0x19B8, 0x19B9, 0x19BA]:
    MoveItems(Backpack(), ore, -1, 0x4015AC5D, 0, 0, 0, 1000)
The problem is that no matter what delay I set via the last argument (tried even 10000), only half of the items are actually moved and this is printed in the journal:

Code: Select all

[21:39:45:540] System: System You must wait to perform another action.
[21:39:45:540] System: Some inspecific error when moving item! Code 5
[21:39:46:266] System: System You must wait to perform another action.
[21:39:46:266] System: Some inspecific error when moving item! Code 5
I've tried to do the move manually:

Code: Select all

def find_ore_items():
    found = []
    for ore in [0x19B7, 0x19B8, 0x19B9, 0x19BA]:
        FindType(ore, Backpack())
        found += GetFindedList()
    return found

for ore in find_ore_items():
    DragItem(ore, 0)
    Wait(2000)
    DropItem(0x4015AC5D, 0, 0, 0)
    Wait(2000)
Again, even if I set both Waits to something crazy high like 20000, this still appears in journal and only half of the items is moved:

Code: Select all

[21:42:24:703] System: System You must wait to perform another action.
[21:42:24:703] System: Some inspecific error when moving item! Code 5
[21:42:25:447] System: System You must wait to perform another action.
[21:42:25:447] System: Some inspecific error when moving item! Code 5
Conversely, if I try to execute this Pascal program:

Code: Select all

Program New;
  var ore: Array of Cardinal;
  var i: Integer;
begin
  ore := [$19B7, $19B8, $19B9, $19BA];
  for i := 0 to Length(ore) - 1 do
  begin             
    MoveItems(Backpack, ore[i], -1, $4015AC5D, 0, 0, 0, 800);   
  end;
end.
It executes just fine moving all the items from backpack to the target container.

I find this really weird, the Python API doesn't really do anything beyond invoking the native function via ctypes.

Any ideas? :)

Re: Python Moving Items

Posted: 16.08.2016 19:56
by Vizit0r
will check it soon

Re: Python Moving Items

Posted: 16.08.2016 23:17
by innominee
There is strange problems with delay in Python, including Wait() function. You can use time module :

Code: Select all

import time

time.sleep(5) ## In Seconds

Re: Python Moving Items

Posted: 17.08.2016 18:12
by Vizit0r
innominee wrote:There is strange problems with delay in Python, including Wait() function. You can use time module :

Code: Select all

import time

time.sleep(5) ## In Seconds
bad recomendation. In this version of Stealth no need to use Sleep instead of Wait - events will not works in this case.