ScriptUO

Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Coragin on December 28, 2009, 05:31:09 AM

Title: Set item to move?
Post by: Coragin on December 28, 2009, 05:31:09 AM
Okay this is setting multiple items of the same type to move from a chest to backpack.  I know its not supposed to be #ltargetID, whats it supposed to be?

Code: [Select]
Display Ok Target the item you want to move.
  set #targcurs 1
      while #targcurs = 1
         wait 1
         set %ItemToMove #ltargetID ; <-----Morter and Pastel for example
      set #lobjectID #ltargetID
      wait 10

The way its set up now it move only one item then says its done, so its taking the item ID not the item type.  What do I put in place of #ltargetID?
Title: Re: Set item to move?
Post by: Masscre on December 28, 2009, 06:04:10 AM
I can help with this Coragin but need to know a little more about what you are trying to do.  For example if you want to move all the mortar and pestles from a chest to your back pack.  I would suggest a repeat ... until statement and then have it find the item type and exevent drag and drop the items until it does not find anymore.  If you will put up what you want to do.  I can prolly drop a small script here to do it for you.  I just need more explanation.
Title: Re: Set item to move?
Post by: Coragin on December 28, 2009, 06:14:24 AM
Code: [Select]
Display Ok Select the Resource Container.
  set #targcurs 1
      while #targcurs = 1
         wait 1
         set %ResourceChest #ltargetID
      set #lobjectID #ltargetID
      set #nextcposx 200
      set #nextcposy 0
      event macro 17
      wait 10

Display Ok Target the item you want to move.
  set #targcurs 1
      while #targcurs = 1
         wait 1
         set %ItemToMove #ltargetID
      set #lobjectID #ltargetID
      wait 10

mainloop:
finditem %ItemToMove C_ , %ResourceChest
if #findkind = -1
   {
   display Ok moved all items.
   halt
   }
exevent drag #findid 1
wait 10
exevent dropc #backpackid
wait 20
}
goto mainloop
Title: Re: Set item to move?
Post by: camotbik on December 28, 2009, 08:06:59 AM
dont get me wrong, but arent while/until more friendly to Euo?
Title: Re: Set item to move?
Post by: Khameleon on December 28, 2009, 08:15:42 AM
Tomato? Or tamoto?
Title: Re: Set item to move?
Post by: Khameleon on December 28, 2009, 08:31:34 AM
I'd probbally do somerging like this

finditem morter c_ bagid
if findkind = -1
    Halt
exevent drag findid
wait 20
exevent dropc dropcontainer

sorry for no symbols on my itouch device
Title: Re: Set item to move?
Post by: camotbik on December 28, 2009, 08:37:22 AM
i ment something like this
Code: [Select]
finditem %ItemToMove C_ , %ResourceChest
while #findcnt > 0
 {
Exevent Drag #findid 1
wait 10
 Exevent Dropc #backpackid
  wait 20
          finditem  %ItemToMove C_ , %ResourceChest
 }
halt
Title: Re: Set item to move?
Post by: Coragin on December 28, 2009, 09:17:10 AM
The moving isint the problem guys that is working fine.  Its the fact that it is getting the item ID and not thewy TYPE.  So its movin just the one I target then stopping.
Title: Re: Set item to move?
Post by: camotbik on December 28, 2009, 09:25:25 AM
The moving isint the problem guys that is working fine.  Its the fact that it is getting the item ID and not thewy TYPE.  So its movin just the one I target then stopping.
Code: [Select]
Display Ok Select the Resource Container.
set #targcurs 1
while #targcurs = 1
 wait 1
set %ResourceChest #ltargetID
set #lobjectID #ltargetID
set #nextcposx 200
set #nextcposy 0
event macro 17
wait 10

Display Ok Target the item you want to move.
set #targcurs 1
while #targcurs = 1
 wait 1
finditem #ltargetid C_ , %ResourceChest
if #findcnt > 0                                  
 set %ItemToMove #FINDTYPE              
wait 10

finditem %ItemToMove C_ , %ResourceChest
while #findcnt > 0
 {
  Exevent Drag #findid 1
   wait 10
    Exevent Dropc #backpackid
     wait 20
      finditem  %ItemToMove C_ , %ResourceChest
 }
halt
The script above would move all the targeted items in the %resourcechest one by one, till there are no items in %ResourceChest

Your problem was here
Code: [Select]
Display Ok Target the item you want to move.
  set #targcurs 1
      while #targcurs = 1
         wait 1
         set %ItemToMove #ltargetID ; <---- you are seting just the #ltargetid to move.
      set #lobjectID #ltargetID         ; what about this ? what is it for?
      wait 10


maybe this will help
Code: [Select]
;==================================
; Script Name: Simple move
; Author: CAMOTbIK
; Version: 0.1 Beta
; Client Tested with: 6.0.14.3
; EUO version tested with: 1.58
; Revision Date: 25.12.2009
; Public Release:
; Purpose: Move items from one container to another
;==================================
; usage examples
; gosub move ZLK ALL #backpackid  %ResourceChest ; Moves ALL ZLK(logs) from your backpack to %ResourceChest
; gosub move ZLK 3 %ResourceChest  #backpackid  ; Moves 3 ZLK(logs) from %ResourceChest to your backpack
; %1 Type %2 Ammount %3 from where %4 to where

sub move
finditem %1 C_ , %3
while #findcnt > 0
{
if %2 = ALL || %2 = all
exevent drag #FINDID #FINDSTACK
 else
  exevent drag #FINDID %2
   wait 10
    Exevent Dropc %4
     wait 20
     finditem %1 C_ , %3
}
return
Title: Re: Set item to move?
Post by: Coragin on December 28, 2009, 10:44:04 AM
i forgot to take that set out it was originally for a contrainer changed it to item.

#FINDTYPE was the problem, it was using findid.

Code: [Select]
Display Ok Target the item you want to move.
  set #targcurs 1
      while #targcurs = 1
         wait 1
         set %ItemToMove #FindTYPE ; <-----Morter and Pastel for example
      wait 10

that should work I will test it later.
Title: Re: Set item to move?
Post by: camotbik on December 28, 2009, 11:45:27 AM
i forgot to take that set out it was originally for a contrainer changed it to item.

#FINDTYPE was the problem, it was using findid.

Code: [Select]
Display Ok Target the item you want to move.
  set #targcurs 1
      while #targcurs = 1
         wait 1
         set %ItemToMove #FindTYPE ; <-----Morter and Pastel for example
      wait 10

that should work I will test it later.

It wouldn work, because you didnt look for the targeted item.

It should look like this
Code: [Select]
Display Ok Target the item you want to move.
set #targcurs 1
while #targcurs = 1
 wait 1
finditem #ltargetid C_ , %ResourceChest
if #findcnt > 0                                 
 set %ItemToMove #FINDTYPE               
wait 10