ScriptUO

Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Hollywood_Shono on February 26, 2009, 06:08:23 PM

Title: other quest script debug
Post by: Hollywood_Shono on February 26, 2009, 06:08:23 PM
Can anyone take apart the looting script of this... I will pay for your help lol please... I really need it for my other heartwood script :(
Title: other quest script debug
Post by: Cerveza on February 26, 2009, 07:04:01 PM
What exactly do you mean "take apart"?
Title: other quest script debug
Post by: Hollywood_Shono on February 26, 2009, 07:17:24 PM
What exactly do you mean "take apart"?

Trailmyx said i could get it if i can take out of this script so thats what i meant by apart.... I just  need the loot script out of it so i can click a container and it goes through all the bags...
Title: other quest script debug
Post by: Hollywood_Shono on February 26, 2009, 07:25:58 PM
I really would love to learn all of it I am just so busy in real life with work, my wife and new born its hard to take the time to learn everything. I wish i could cause I use the scripts so much. Like i said I just need the BM Eval or Claw script to basically be able to target a container and loot through it determine whats good I mainly just need it to take the runic saws out of the secures. I could really care less about any of the other loot.
Title: other quest script debug
Post by: TrailMyx on February 26, 2009, 07:46:09 PM
So all you want is the saws?  If so, you don't need any looter.  There's just a few lines in the 1.16 quester that'll handle that. 

Really, you don't need to learn much about it.  You just need two routines from the 1.16 quester.

sub loot
and
sub checkloot

That's at least a start for you.  You need to start looking for the loot bags in your bank container, and be able to drag the kits to your loot container.

So you need to determine what the #FINDID of the bank box is and the #FINDID of your loot bag.

But at least those are the routines you need.  Don't just cut/paste these and expect it to work; you'll have to do a bit of script integration....
Title: other quest script debug
Post by: Hollywood_Shono on February 26, 2009, 08:11:14 PM
So all you want is the saws?  If so, you don't need any looter.  There's just a few lines in the 1.16 quester that'll handle that. 

Really, you don't need to learn much about it.  You just need two routines from the 1.16 quester.

sub loot
and
sub checkloot

That's at least a start for you.  You need to start looking for the loot bags in your bank container, and be able to drag the kits to your loot container.

So you need to determine what the #FINDID of the bank box is and the #FINDID of your loot bag.

But at least those are the routines you need.  Don't just cut/paste these and expect it to work; you'll have to do a bit of script integration....

Okay i'll get some id #'s see what i can do Im sure ill be asking for more help but yeah... i have 20 Bags set up.... when Im done with my heartwood script all 20 of these bags are full with heartwood packs usally 30-40 bags and the rest are items inside them.. I just need it to Open each bag which i assume i just need the ID number for each one... Then have it go through each bag it could event take out each heartwood bag look inside it andtoss it on the ground like the heartwood script does.... and put the runics into a bag in my pack.

It's just driving me bonkers looking through 2,000 items every time i let the script run.
Title: other quest script debug
Post by: TrailMyx on February 26, 2009, 10:00:45 PM
You know, we really don't mind helping those who want to help themselves, so as long as you're willing to do the legwork to try and learn how to do it..
Title: other quest script debug
Post by: Hollywood_Shono on February 27, 2009, 12:53:04 AM
Code: [Select]
Loop:
gosub setup
;-------------------------------------------------------
;------------------- VARIABLES SETUP -------------------
;-------------------------------------------------------
sub SETUP
  ; Open backpack
  event Macro 8 7
  wait 1s
  set %backpack #contID
 
  ; menu HideEUO

  set %lootbag1 JKLUUND
  set %lootbag2 HKLUUND
  set %lootbag3 XKLUUND
  set %lootbag4 PKLUUND
  set %lootbag5 BOUZKND
 
  set %lootbag6 XMUZKND
  set %lootbag7 XMUZKND
  set %lootbag8 HPUZKND
  set %lootbag9 IPUZKND
 
  set %lootbag10 ALLUUND
  set %lootbag11 XOUZKND
  set %lootbag12 YUUZKND
  set %lootbag13 HNUZKND
  set %lootbag14 OUUZKND
  set %lootbag15 VUUZKND
 
  set %lootbag16 SUUZKND
  set %lootbag17 TUUZKND
  set %lootbag18 QUUZKND
  set %lootbag19 ANUZKND
  set %lootbag20 CLLUUND
return

Let me know if thats right.


Now my script has it set drop each heartwood bag like this. Can you help me figure out how to do the complete opposite I am assuming that whats I need to do?
Code: [Select]
;------------------------------------------------------
;---------------------Drop Loot Bags--------------------
;------------------------------------------------------
sub droploot
set %dragTypes ZJF
for %droploot 1 1
{
findItem %dragTypes c_ , %backpack
exevent drag #findid
wait 20
exevent dropc %lootbag1
}
for %droploot 1 1
{
findItem %dragTypes c_ , %backpack
exevent drag #findid
wait 20
exevent dropc %lootbag2
}
for %droploot 1 1
{
findItem %dragTypes c_ , %backpack
exevent drag #findid
wait 20
exevent dropc %lootbag3
}
for %droploot 1 1
{
findItem %dragTypes c_ , %backpack
exevent drag #findid
wait 20
exevent dropc %lootbag4
}
for %droploot 1 1
{
findItem %dragTypes c_ , %backpack
exevent drag #findid
wait 20
exevent dropc %lootbag5
}
for %droploot 1 1
{
findItem %dragTypes c_ , %backpack
exevent drag #findid
wait 20
exevent dropc %lootbag6
}
for %droploot 1 1
{
findItem %dragTypes c_ , %backpack
exevent drag #findid
wait 20
exevent dropc %lootbag7
}
for %droploot 1 1
{
findItem %dragTypes c_ , %backpack
exevent drag #findid
wait 20
exevent dropc %lootbag8
}
for %droploot 1 1
{
findItem %dragTypes c_ , %backpack
exevent drag #findid
wait 20
exevent dropc %lootbag9
}
for %droploot 1 1
{
findItem %dragTypes c_ , %backpack
exevent drag #findid
wait 20
exevent dropc %lootbag10
}
for %droploot 1 1
{
findItem %dragTypes c_ , %backpack
exevent drag #findid
wait 20
exevent dropc %lootbag11
}
for %droploot 1 1
{
findItem %dragTypes c_ , %backpack
exevent drag #findid
wait 20
exevent dropc %lootbag12
}
for %droploot 1 1
{
findItem %dragTypes c_ , %backpack
exevent drag #findid
wait 20
exevent dropc %lootbag13
}
for %droploot 1 1
{
findItem %dragTypes c_ , %backpack
exevent drag #findid
wait 20
exevent dropc %lootbag14
}
for %droploot 1 1
{
findItem %dragTypes c_ , %backpack
exevent drag #findid
wait 20
exevent dropc %lootbag15
}
for %droploot 1 1
{
findItem %dragTypes c_ , %backpack
exevent drag #findid
wait 20
exevent dropc %lootbag16
}
for %droploot 1 1
{
findItem %dragTypes c_ , %backpack
exevent drag #findid
wait 20
exevent dropc %lootbag17
}
for %droploot 1 1
{
findItem %dragTypes c_ , %backpack
exevent drag #findid
wait 20
exevent dropc %lootbag18
}
for %droploot 1 1
{
findItem %dragTypes c_ , %backpack
exevent drag #findid
wait 20
exevent dropc %lootbag19
}
for %droploot 1 1
{
findItem %dragTypes c_ , %backpack
exevent drag #findid
wait 20
exevent dropc %lootbag20
}
return
Title: other quest script debug
Post by: Hollywood_Shono on February 27, 2009, 01:09:10 AM
My friend found me this script just now. Not sure if he made it or what but it brings up a cursor i can click my secure full of bags and it opens everyone... How do i go about make it take the runic saws out of each one and dragging them into my main pack? and or after it opens one bag it throws that bag inside a differnt container.

Code: [Select]
; Setup
set %bagstoopentype ZJF_CKF

; Do not edit after here unless you know what you do
gosub getBagwithBags

display yesno Do you need to sort the bags into the dumpbag?
if #dispRes = yes
  gosub sortintoBag

gosub openBags
if #dispRes = yes
    display ok %i Bags sorted and opened
else
    display ok %i Bags opened

stop

sub getBagwithBags
    event SysMessage Please target the bag to open bags in
    set #TARGCURS 1
    wait 5
    waiting:
    if #TARGCURS = 1
       goto waiting

    findItem #LTARGETID
    set %searchbagid #FINDID
    set %searchbagx #FINDX + 8
    set %searchbagy #FINDY + 8
return

sub sortintoBag
    ignoreItem %searchbagid
    sortloop:
    findItem %bagstoopentype C_ , #BACKPACKID
    if #FINDCNT > 0
    {
        exEvent Drag #FINDID
        wait 15

        exEvent Dropc %searchbagid
        wait 15
       
        goto sortloop
    }
return

sub openBags
    set #nextCPosX #cliXRes
    set #nextCPosY 0
    set #LOBJECTID %searchbagid
    event Macro 17 0
    wait 20

    ignoreItem reset
    openloop:
    findItem %bagstoopentype C_ , %searchbagid
    if #FINDCNT > 0
    {
        ignoreItem #FINDID

        set %bagx #cliXRes - 230
        set #nextCPosX %bagx
        set #nextCPosY 0
        set #LOBJECTID #FINDID
        event Macro 17 0
        wait 20
       
        set %i %i + 1
        goto openloop:
    }
return
Title: Re: other quest script debug
Post by: crameep on February 27, 2009, 02:28:48 PM
You will just need to make a new sub that searches all open containers ( This would end up searching your pack) or search each container as its being opened. Then drag said item over to your destination container. When I get home I'll see if i can mash it all together for you. If someone doesn't get to it before me.
Title: Re: other quest script debug
Post by: Hollywood_Shono on February 27, 2009, 04:33:46 PM
You will just need to make a new sub that searches all open containers ( This would end up searching your pack) or search each container as its being opened. Then drag said item over to your destination container. When I get home I'll see if i can mash it all together for you. If someone doesn't get to it before me.

Thank you sir i'd appreciate any help you can give me
Title: Re: other quest script debug
Post by: crameep on February 27, 2009, 11:35:58 PM
Ok, i borrowed this sub from someone on EUO site, and modified it for my own uses quite a bit a while back. heres the code.
Code: [Select]
; Setup
set %bagstoopentype ZJF_CKF
set %grabtype KTL ; You need to change this to the item your looking for.

; Do not edit after here unless you know what you do
gosub getBagwithBags

display yesno Do you need to sort the bags into the dumpbag?
if #dispRes = yes
  gosub sortintoBag

gosub openBags
if #dispRes = yes
    display ok %i Bags sorted and opened
else
    display ok %i Bags opened

stop

sub getBagwithBags
    event SysMessage Please target the bag to open bags in
    set #TARGCURS 1
    wait 5
    waiting:
    if #TARGCURS = 1
       goto waiting

    findItem #LTARGETID
    set %searchbagid #FINDID
    set %searchbagx #FINDX + 8
    set %searchbagy #FINDY + 8
return

sub sortintoBag
    ignoreItem %searchbagid
    sortloop:
    findItem %bagstoopentype C_ , #BACKPACKID
    if #FINDCNT > 0
    {
        exEvent Drag #FINDID
        wait 15

        exEvent Dropc %searchbagid
        wait 15

        goto sortloop
    }
return

sub openBags
    set #nextCPosX #cliXRes
    set #nextCPosY 0
    set #LOBJECTID %searchbagid
    event Macro 17 0
    wait 20

    ignoreItem reset
    openloop:
    findItem %bagstoopentype C_ , %searchbagid
    if #FINDCNT > 0
    {
        ignoreItem #FINDID

        set %bagx #cliXRes - 230
        set #nextCPosX %bagx
        set #nextCPosY 0
        set #LOBJECTID #FINDID
        event Macro 17 0
        wait 20
        gosub moveitems #findid #charid %grabtype 0 ;Put the sub here so you can search each bag individualy as they are being opend, this avoids the problem of searching your pack i believe.
        set %i %i + 1
        goto openloop:
    }
return
;Added sub to move stuff
sub moveItems ns
{
  namespace push
  namespace local moveItems
  set !dragTimeout 4 ;1/10 s
  set !dragTimer #scnt2
  set !items %3
  set !stackdrag %4
  if %0 < 3
    set !items *
  set !from %1
  set !to %2
  finditem !items C_ , !from
  for #findindex 1 %grabamount
  {
    if #findkind = 0
    {
      set !amt 1
      if #findstack > 1
      {
        if !stackdrag = 0
        {
        set !amt #findstack
        }
        else
        {
        set !amt !stackdrag
        }
      }
      while #scnt2 < !dragTimer
        wait 0
      exevent drag #findid !amt
      exevent dropc !to
      set !dragTimer #scnt2 + !dragTimeout
    }
  }
  namespace clear
  namespace pop
  return
}

This should work for what you want it to, I've tested it quickly on my FS, it works not sure on the item type of what you want to grab you will have set that in the setup section at the top, I've left a place for it. One drawback of this is that it will grab only the first item from the bag, so if there is more than one of the same type of item (NOT STACKED), And if you list multiple items it will only find the first one of that type in the bag. I can change that around later if you need , I was just trying to be quick about it. Hopefully you can make it through this my add sometimes runs in when I'm typing :) Hope it helps.
Title: Re: other quest script debug
Post by: Hollywood_Shono on February 28, 2009, 05:18:18 AM
When the menu pops up asking:

"Do you need to sort the bags into the dumbag"  Yes? or No?


What do I put cause it doesnt allow me to create a dumpbag? Is that some where in the script i have to add the bag in there or something?
Title: Re: other quest script debug
Post by: crameep on February 28, 2009, 08:03:08 AM
Well that was in the script you posted, all i did was add a sub to move items and implement it, but from the looks of it it searches your backpack for bags with  %searchbagid id's and moves them to the secure you picked. So, if the bags you are looking in are in your pack and need to be moved choose yes, if not choose no, if you want to avoid this part all together just comment out these 3 lines

Code: [Select]
display yesno Do you need to sort the bags into the dumpbag?
if #dispRes = yes
  gosub sortintoBag
Title: Re: other quest script debug
Post by: Hollywood_Shono on February 28, 2009, 02:12:35 PM
Alright is there away you can help me do this....


It says click the container with the bags in it to bascially be scanned through.....

When I click that container it starts to open the bags.... Can you help make it so after it done scanning 1 bag it is put into another bag thats outside the container... So I dont have to do it afterwards....

Basically i have 20 bags set up.... each of the 20 bags get filled with about 39-45 bags from the heartwood quests... I want it to open the bag scan for runics which it does then take the bag out of the secure container.
Title: Re: other quest script debug
Post by: Hollywood_Shono on February 28, 2009, 02:21:38 PM
What you did works great and loots the runics once it sees them. So thank you very much
Title: Re: other quest script debug
Post by: crameep on March 02, 2009, 01:33:20 PM
Thanks! Before I help you with sorting the bags, can you clarify something for me?

Are you wanting this script to open each of these 20 bags and then open the bags inside these bags and check for runics then move one of the 20 bags to another secure? or one of the bags that have been sorted to another secure?
Title: Re: other quest script debug
Post by: Hollywood_Shono on March 03, 2009, 10:32:20 AM
Thanks! Before I help you with sorting the bags, can you clarify something for me?

Are you wanting this script to open each of these 20 bags and then open the bags inside these bags and check for runics then move one of the 20 bags to another secure? or one of the bags that have been sorted to another secure?


This is pretty much all I need it to do

I click Play
It asks what bag to go through
I click the Bag
It Opens that bag to go through the bags inside it like it does.........


The only change i need is after it open each bag and scans for the runic, I'd like it to throw it on the ground outside of the secure...


To give you an example the heartwood script that they made here...
It opens the bag in ur pack... scans the items... put it on the tile next to you then continues to scan through bags but Throws them in the same bag untill its full. If you can do that it'd be perfect...
Title: Re: other quest script debug
Post by: crameep on March 03, 2009, 02:21:56 PM
I see well it shouldn't bee too hard for you. i would use the exevent Drag and exevent Dropg commands, around this point in the script.

Code: [Select]
sub openBags
    set #nextCPosX #cliXRes
    set #nextCPosY 0
    set #LOBJECTID %searchbagid
    event Macro 17 0
    wait 20

    ignoreItem reset
    openloop:
    findItem %bagstoopentype C_ , %searchbagid
    if #FINDCNT > 0
    {
        ignoreItem #FINDID

        set %bagx #cliXRes - 230
        set #nextCPosX %bagx
        set #nextCPosY 0
        set #LOBJECTID #FINDID
        event Macro 17 0
        wait 20
        gosub moveitems #findid #charid %grabtype 0 ;Put the sub here so you can search each bag individualy as they are being opend, this avoids the problem of searching your pack i believe.
        set %i %i + 1
        goto openloop:
    }
return

You will want to the code  after
Code: [Select]
set %i %i + 1
here are the links to the EUO wiki with infor for each command.
http://wiki.easyuo.com/index.php/Exevent_Drag (http://wiki.easyuo.com/index.php/Exevent_Drag) - exevent drag

http://wiki.easyuo.com/index.php/Exevent_Dropg (http://wiki.easyuo.com/index.php/Exevent_Dropg) - exevent dropg.

See if you can figure it out, if your still having troubles. Just let me know, ill try to respond a little faster next time.