Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7

how move something from BoxA to BoxB?

Ask for help
Post Reply
verbin
Neophyte
Neophyte
Posts: 18
Joined: 20.01.2015 23:46

how move something from BoxA to BoxB?

Post by verbin »

function mvitem():integer;
var
BoxA,BoxB,Temp:word;
begin
if FindType($9aa,Ground) > 0 then
//there FindQuantity is 2
BoxA := FimdItem;
//now, how do find other Box?
UseObject(BoxA); //But System Tell Me Object Not Found?
FindItem($1bf2,BoxA) //I Have some $1bf2 in this box,but can't find
Temp := Finditem;
MoveItem(Temp,10,BoxB,0,0,0);//this not source?only destination? how affirm source box?
end;
i understand Delphi , don't tell me about syntax error,this only draft
drabadan
Expert
Expert
Posts: 730
Joined: 13.12.2012 17:35
Contact:

Re: how move something from BoxA to BoxB?

Post by drabadan »

Code: Select all

function mvitem() :integer;
var
 BoxA, BoxB, Temp : Cardinal; //Mistake! BoxA and BoxB must be Cardinal, word is for types of items, Cardinals for IDs;
begin 
 if FindType($9aa, Ground) > 0 then
 //there FindQuantity is 2
  BoxA := FindItem;
 //now, how do find other Box?
 UseObject(BoxA); //But System Tell Me Object Not Found?
 FindType($1bf2, BoxA) //To find smth you need FindType(Object Type : Word; Container where to look : Cardinal);
 Temp := Finditem;
 BoxB := Backpack; //initializing BoxB with Id of self's backpack;
 MoveItem(Temp, 10, BoxB,0,0,0); //Source box is'nt needed for affirming becouse of using ID of Item;
end;
drabadan
Expert
Expert
Posts: 730
Joined: 13.12.2012 17:35
Contact:

Re: how move something from BoxA to BoxB?

Post by drabadan »

drabadan wrote:

Code: Select all

function mvitem() :integer;
var
 BoxA, BoxB, Temp : Cardinal; //Mistake! BoxA and BoxB must be Cardinal, word is for types of items, Cardinals for IDs;
begin 
 if FindType($9aa, Ground) > 0 then
 //there FindQuantity is 2
  BoxA := FindItem;
 //now, how do find other Box?
 UseObject(BoxA); //But System Tell Me Object Not Found?
 FindType($1bf2, BoxA) //To find smth you need FindType(Object Type : Word; Container where to look : Cardinal);
 Temp := Finditem;
 BoxB := Backpack; //initializing BoxB with Id of self's backpack;
 MoveItem(Temp, 10, BoxB,0,0,0); //Source box is'nt needed for affirming becouse of using ID of Item;
 Result := 1;
end;
How would i do that:

Code: Select all

function mvitem() : Integer;
var
 BoxA : Cardinal;
begin
 BoxA := 0;
 if FindType($9aa, Ground) > 0 then
  BoxA := FindItem;
 if BoxA <> 0 then 
  if FindType($1bf2, BoxA) > 0 then
   if MoveItem(FindItem, 10, Backpack, 0,0,0) then
    Wait(600)
   else
    Wait(50);
end;
drabadan
Expert
Expert
Posts: 730
Joined: 13.12.2012 17:35
Contact:

Re: how move something from BoxA to BoxB?

Post by drabadan »

drabadan wrote:
drabadan wrote:

Code: Select all

function mvitem() :integer;
var
 BoxA, BoxB, Temp : Cardinal; //Mistake! BoxA and BoxB must be Cardinal, word is for types of items, Cardinals for IDs;
begin 
 if FindType($9aa, Ground) > 0 then
 //there FindQuantity is 2
  BoxA := FindItem;
 //now, how do find other Box?
 UseObject(BoxA); //But System Tell Me Object Not Found?
 FindType($1bf2, BoxA) //To find smth you need FindType(Object Type : Word; Container where to look : Cardinal);
 Temp := Finditem;
 BoxB := Backpack; //initializing BoxB with Id of self's backpack;
 MoveItem(Temp, 10, BoxB,0,0,0); //Source box is'nt needed for affirming becouse of using ID of Item;
 Result := 1;
end;
How would i do that:

Code: Select all

function mvitem() : Integer;
var
 BoxA : Cardinal;
begin
 BoxA := 0;
 if FindType($9aa, Ground) > 0 then
  BoxA := FindItem;
 if BoxA <> 0 then 
  if FindType($1bf2, BoxA) > 0 then
   if MoveItem(FindItem, 10, Backpack, 0,0,0) then
    Wait(600)
   else
    Wait(50);
end;
But this is a very bad coding example. Maybe you should try to explaine what you want to see with the words, and we will try to interpritate that in code. In more or less propper way...
verbin
Neophyte
Neophyte
Posts: 18
Joined: 20.01.2015 23:46

Re: how move something from BoxA to BoxB?

Post by verbin »

thank for response me
but i don't move item to my backpack
i want move item from BoxA to BoxB
findtype only find BoxA,how find BoxB?
verbin
Neophyte
Neophyte
Posts: 18
Joined: 20.01.2015 23:46

Re: how move something from BoxA to BoxB?

Post by verbin »

and how debug scripts?
i check "Enable Debug Mode"
and press F7 or F8 or F9
scripts not run or not stop in breakpoint
verbin
Neophyte
Neophyte
Posts: 18
Joined: 20.01.2015 23:46

Re: how move something from BoxA to BoxB?

Post by verbin »

drabadan wrote:
drabadan wrote:
drabadan wrote:

Code: Select all

function mvitem() :integer;
var
 BoxA, BoxB, Temp : Cardinal; //Mistake! BoxA and BoxB must be Cardinal, word is for types of items, Cardinals for IDs;
begin 
 if FindType($9aa, Ground) > 0 then
 //there FindQuantity is 2
  BoxA := FindItem;
 //now, how do find other Box?
 UseObject(BoxA); //But System Tell Me Object Not Found?
 FindType($1bf2, BoxA) //To find smth you need FindType(Object Type : Word; Container where to look : Cardinal);
 Temp := Finditem;
 BoxB := Backpack; //initializing BoxB with Id of self's backpack;
 MoveItem(Temp, 10, BoxB,0,0,0); //Source box is'nt needed for affirming becouse of using ID of Item;
 Result := 1;
end;
How would i do that:

Code: Select all

function mvitem() : Integer;
var
 BoxA : Cardinal;
begin
 BoxA := 0;
 if FindType($9aa, Ground) > 0 then
  BoxA := FindItem;
 if BoxA <> 0 then 
  if FindType($1bf2, BoxA) > 0 then
   if MoveItem(FindItem, 10, Backpack, 0,0,0) then
    Wait(600)
   else
    Wait(50);
end;
But this is a very bad coding example. Maybe you should try to explaine what you want to see with the words, and we will try to interpritate that in code. In more or less propper way...
this just draft,Express the meaning of probably
Post Reply