Finditem %Whitepearls C , #backpackID
;Find Items of Type\ID %Whitepearls in Container "BackpackID"
if #findkind <> -1
;If Searched ID\Types exist
{
;Open if Command and only will execute Code when the if is true
Exevent drag #findid #findstack
;Grab the foundet Result ID and the Amount of its Stack
wait 5
;This Command has a small Timeout given from Server
Exevent dropc %Cargo_Hold
;Let it fall down into a Container with name %Cargo_Hold
wait 5
;This Command has a small Timeout given from Server
}
;Close If Command
Under Each Line is outcommented Comments what the Line above do.About the waits: it doesnt matter if you wait after Drag & Drop or Drag wait Drop wait.But the Server has a timeout,if you interact faster it will block your action.
You must think about Easyuo interact as a Queue and a stupid robot.
when you making Code it will run from first until last line and will only do what u show him to.
If you want to let your robot grab something you must him show how he can find to get it,because when u say "Give me this" he dont know what is this and you must specific it.What he need to grab and how many\much of it and where to go to drop
Now about the Queue:
Some Commands have a specific "How to do Rule" to work succesfully.
Example:
- You can only Drop something if you dragged before
- Using specific ID as LastObject via define it and then use the Event
- Using specific ID as LastTarget via define it and then use the Event
- To use and Target an ID you need first let your char use LastObject and then Target on a Target
- The world using 3 Layers: Ground, Normal and Air so you must change the #LTargetkind depending on the Action you want with LObject and LTarget
Now we will analyze your Code:
FindItem %White_Pearl C_, #backpackID
;Trying to Scan for %White_Pearl in Container "BackpackID"
set #lobjectID #findID
;Sets a Lobject as #FindID, if your Scan find nothing you will have nothing in
if #FINDCNT > 0
;Oh cool an if Command
exevent drag #lobjectid
;Where is your Stack? with that he will drag and drop 1 item part by part. If you would have 200 Whitepearls it would loot only 1
wait 20
;Long wait but how you wait after drop?
exevent dropc %Cargo_Hold
;This is fine...
Halt
Hope it helps..
Crome