ScriptUO

Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Ultima on September 23, 2011, 06:24:42 PM

Title: Blackrock in the trash.
Post by: Ultima on September 23, 2011, 06:24:42 PM
Trying to code a script to pick Blackrock off the ground into a trash barrel but it will only pick it up not toss in the trashcan. As you can tell by the looks of it this is a very complicated script:

Code: [Select]
set %trashcan BKF
finditem UVF_GWF_FWF_EWF G_2
if #FINDCNT > 0
{
  event Drag #FINDID
  wait 15
  exevent dropc %trashcan
  wait 15

What am I missing? Something very simple I imagine. ???
Title: Re: Blackrock in the trash.
Post by: NObama on September 23, 2011, 06:46:38 PM
set %trashcan XXXXXXX
finditem UVF_GWF_FWF_EWF_ G_2
    if #findkind <> -1
      {
      exevent drag #findid #findstack
      wait 13
      exevent dropc %trashcan
      wait 13
      }

You don't want to be using event and exevent together.

If you want to vacuum up everything in range, perhaps:

finditem UVF_GWF_FWF_EWF_ G_2
if #findkind <> -1
set %blackrockcount #findcnt
for !u 1 %blackrockcount
  {
  exevent drag #findid #findstack
  wait 13
  exevent dropc %trashcan
  wait 13
  }  


Title: Re: Blackrock in the trash.
Post by: Dixie Wrecked on September 23, 2011, 06:52:37 PM
Trying to code a script to pick Blackrock off the ground into a trash barrel but it will only pick it up not toss in the trashcan. As you can tell by the looks of it this is a very complicated script:

Code: [Select]
set %trashcan BKF
finditem UVF_GWF_FWF_EWF G_2
if #FINDCNT > 0
{
  event Drag #FINDID
  wait 15
  exevent dropc %trashcan
  wait 15

What am I missing? Something very simple I imagine. ???

It looks like %trashcan is only set to the itemtype, not the actual ID of the trashcan that you want the blackrock thrown into?
Title: Re: Blackrock in the trash.
Post by: gimlet on September 23, 2011, 06:58:50 PM
Have you ever used Whisp's Master of Loot

really a great program to do this and any moving!
Title: Re: Blackrock in the trash.
Post by: camotbik on September 24, 2011, 01:35:22 AM
if you want to do this with a trash type, you could do this following
Code: [Select]
set %trash BKF
set %blackrock UVF_GWF_FWF_EWF

finditem %blackrock G_2 ; looking for some blackrock
if #findcnt > 0         ; if found more than 0 %blackrock
{                       ; open statement found more than 0 %blackrock
  set %current_blackrock #findid ; set found item id as %current_blackrock
  finditem %trash G_2   ; looking for trash
  if #findcnt > 0       ; if found more than 0 %trash
  {                     ; open statement found more than 0 trash
    exevent drag %current_blackrock #findstack ; drag found blackrock
    exevent dropc #findid ; drop in to found trash id
    wait 20              
  }                     ; close statement found more than 0 %trash
}                       ; close statement found more than 0 blackrock
Title: Re: Blackrock in the trash.
Post by: Endless Night on September 24, 2011, 05:58:36 AM
id recommend you do it this way round less finditems,  2 vs #blackrock+1 finditems. but otherwise good code  camotbik

Code: [Select]
set %trash BKF
set %blackrock UVF_GWF_FWF_EWF

finditem %trash G_2   ; looking for trash
if #findcnt > 0       ; if found more than 0 %trash
  {                     ; open statement found more than 0 trash
  set %trashid #findid
  finditem %blackrock G_2 ; looking for some blackrock
  if #findcnt > 0         ; if found more than 0 %blackrock    
    {                       ; open statement found more than 0 %blackrock
    for #findindex 1 #findcnt
       {
       exevent drag  #findid #findstack ; drag found blackrock
       exevent dropc %trashid ; drop in to found trash id
       wait 20        
       }      
    }                   ; close statement found more than 0 blackrock
  }                     ; close statement found more than 0 %trash

Title: Re: Blackrock in the trash.
Post by: Ultima on September 24, 2011, 09:58:57 AM
Thanks guys for the feedback!

This little script will help me in as a learning experience understanding the code functions a bit more. I know I'll be looking it over and referring to it again in the future.

Good little lesson for me here.

Now hopefully my accounts won't free up  for 5 seconds at a time when I recall into my Keep that has BR stored. God only knows how much is there....time to turn it in.

@Gimlet I've never heard of Whispers I'll have to check it out. I'm not sure if you can edit that to loot from the ground or not. Usually I use Jake's Mass Item mover for moving items from A to B. I'll check out Whispers though thanks.

Thanks to all who provided feedback here on the code. I do appreciate it and learned something along the way. :)
Title: Re: Blackrock in the trash.
Post by: Ultima on September 24, 2011, 09:38:42 PM
Final thanks guys!

There was a huge difference when logging or recalling into my Keep where all the blackrock was stored since tossing all the blackrock in the trash.  My UO screen used to freeze for 5-6 seconds before it was able to load the contents of my keep when it was littered with blackrock.

With all the BR in the trash no more locking up or freezing when getting near the keep. Much better this way and some clean up points to boot.
Title: Re: Blackrock in the trash.
Post by: _C2_ on September 25, 2011, 08:16:06 AM
That's why I kept all my blackrock stored in bugged secures
Title: Re: Blackrock in the trash.
Post by: NObama on September 25, 2011, 09:42:30 AM
That's why I kept all my blackrock stored in bugged secures

And you do this, how?  Details, man!
Title: Re: Blackrock in the trash.
Post by: D on September 25, 2011, 12:35:04 PM
This script worked great, cleaned up my house nicely :) it was just what i was after
Title: Re: Blackrock in the trash.
Post by: freddy on September 29, 2011, 03:54:50 PM
this is what i use:

Code: [Select]
set %secure BTTKRTD ; #backpackid ;BTTKRTD
set %trash  RNNAZMD

while #true
{
finditem UVF_FWF_EWF_GWF C_ , %secure
wait 5
for #findindex 1 #findcnt
{
exevent drag #findid
wait 15
exevent dropc %trash
wait 15
}
break
}
halt

I hate blackrock
Title: Re: Blackrock in the trash.
Post by: Ultima on September 29, 2011, 09:20:22 PM
Freddy where were you when I needed you? You disappeared on us!

I'm all out of blackrock for the time being.

Your code looks the most of what I was trying to accomplish. I wouldn't take that as a compliment! :-\ :P

This was a good learning lesson for me. Albeit very basic...baby steps. It will help next time I try and edit something or trying and create a small sub of some kind.
Title: Re: Blackrock in the trash.
Post by: freddy on September 29, 2011, 09:37:40 PM
haha yea i was kind of late to the party


I've been moving for the last week and a half, just got internet yesterday :P
Title: Re: Blackrock in the trash.
Post by: Endless Night on September 30, 2011, 05:13:06 AM
Freddy where were you when I needed you? You disappeared on us!

I'm all out of blackrock for the time being.

Your code looks the most of what I was trying to accomplish. I wouldn't take that as a compliment! :-\ :P

This was a good learning lesson for me. Albeit very basic...baby steps. It will help next time I try and edit something or trying and create a small sub of some kind.

For pure learning experience  I would have to say that Freddy code is not as good as camotbik or my modified camotbik.   Why because ?
(1) camotbik code auto detects the trash can for you
(2) camotbik pulls the blackrock off the floor as was requested not a secure
(3) Freddys code has a redundant  while loop and break.

Who new some much could be discuseed on such a simple task :)

But probably what you really needed was something that pulled from floor to backpack walked to trash then dumped ;)

Title: Re: Blackrock in the trash.
Post by: Crome969 on October 01, 2011, 01:31:11 AM
Title: Re: Blackrock in the trash.
Post by: freddy on October 01, 2011, 08:59:43 AM
With this sub you have 2 goals: Find blackrock and then move blackrock to trash. You really don't need compartmentalize such a basic task.
Title: Re: Blackrock in the trash.
Post by: Endless Night on October 01, 2011, 09:10:55 AM
this is the snippet i want and takers...

Code: [Select]
Gosub PickupBlackRockFromFloor
gosub FindTrashCanAndMoveToIt
gosub SweepFloorsAndVacummCarpets
gosub WashWindowsAndCutTheGrass
gosub PerformBasicCarMaintaince
gosub CleanTheACUnit
gosub RepaintTheHouseItsLookingShabby
gosub PlaceBlackRockInTheTrashCan
halt
Title: Re: Blackrock in the trash.
Post by: Crome969 on October 01, 2011, 12:58:00 PM
this is the snippet i want and takers...

Code: [Select]
Gosub PickupBlackRockFromFloor
gosub FindTrashCanAndMoveToIt
gosub SweepFloorsAndVacummCarpets
gosub WashWindowsAndCutTheGrass
gosub PerformBasicCarMaintaince
gosub CleanTheACUnit
gosub RepaintTheHouseItsLookingShabby
gosub PlaceBlackRockInTheTrashCan
halt
Now i feel like you are joking about my Comment:P
Well i bymyself have following Rules in Learning\Constructing Code:
I do a lot of Business Process Modeling in my Company and using a similar system to develop bigger Code.
Advantages:

Disadvantages:
Crome
Title: Re: Blackrock in the trash.
Post by: Endless Night on October 01, 2011, 01:17:13 PM
yea chrome was jesting.  I also follow a simular method.

For the past few weeks ive been compiling library's often of simple things... finding trashcan.. making generic and putting in my library. So far ive compliled these  (but thier will be more as i strip out code from my vairous scripts)

Code: [Select]
  set %ENs_Subs_RuneSpell %EN_SubScriptPath , \ENs-Subs-SpellsAndRuneBook.txt
  set %ENs_Subs_Standard  %EN_SubScriptPath , \ENs-Subs-Standard.txt
  set %ENs_Subs_Bods      %EN_SubScriptPath , \ENs-Subs-BodsAndNPCs.txt
  set %ENs_Subs_NPCs      %EN_SubScriptPath , \ENs-Subs-BodsAndNPCs.txt
  set %ENs_Subs_Menus     %EN_SubScriptPath , \ENs-Subs-Menus.txt
  set %ENs_Subs_Banking   %EN_SubScriptPath , \ENs-Subs-BanksAndHome.txt
  set %ENs_Subs_Home      %EN_SubScriptPath , \ENs-Subs-BanksAndHome.txt
  set %ENs_Subs_Pets      %EN_SubScriptPath , \ENs-Subs-Pets.txt


example of usage - Below Initializes all runebooks in your backpack named bank, Sets next rune/book to a random selection.   Next line recalls to bank .. heals char / and or pets if needed, opens bank and any resource boxes needed.  Not bad for 2 lines of code.

Code: [Select]
  call %ENs_Subs_RuneSpell BookLoopSetup Bank         %RuneBooks_Bank         #TRUE
  call %ENs_Subs_Banking  BankRun