Author Topic: Clearing a pack  (Read 4592 times)

0 Members and 1 Guest are viewing this topic.

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 3028
  • Activity:
    2.4%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +206
  • Referrals: 2
    • View Profile
Clearing a pack
« on: December 27, 2013, 07:20:43 PM »
0
I am trying to clear a pack of bows to the trash barrel in a fletching script.

This is in the set up

Code: [Select]
set %garbage SLK_WOH_SGP_JSF_QPO_LMH_PPO ;crafted bows
This is before the sub

Code: [Select]
sub ScriptBegin
  set %lastitemindex 0
  gosub setup
  gosub ClearPackBoards %Boards
  gosub ClearPackGarbage %Garbage
return

Here is the ClearGarbage sub

Code: [Select]
sub ClearPackGarbage
  menu delete scriptstatus
  Menu Font BGColor Black
  menu Font Color Lime
  menu text scriptstatus 95 100 Clearing Pack of Garbage
  finditem %1 C_ , #backpackid
  if #findcnt < 1
    return
  for #findindex 1 #findcnt
  {
    exevent drag %Garbage
    exevent dropc %Trashbarrel
  }
return

I believe my error is in this line but I am not sure how to fix it.

Code: [Select]
exevent drag %Garbage
How do I fix this?

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Clearing a pack
« Reply #1 on: December 27, 2013, 07:51:46 PM »
0
I'm no genius, but

Code: [Select]

sub ClearPackGarbage
finditem SLK_WOH_SGP_JSF_QPO_LMH_PPO C_ , #backpackid   
wait 5
if #findcnt > 0
{
for %i 1 #findcnt
{
finditem SLK_WOH_SGP_JSF_QPO_LMH_PPO C_ , #backpackid
wait 5
Exevent Drag #findid
Exevent Dropc %Trashbarrel  
wait 20
}
}
return

that should work.  now that I change the top finditem
« Last Edit: December 27, 2013, 09:12:22 PM by The Ghost »

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 3028
  • Activity:
    2.4%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +206
  • Referrals: 2
    • View Profile
Re: Clearing a pack
« Reply #2 on: December 27, 2013, 07:55:40 PM »
0
I tried this after posting

Code: [Select]
exevent drag #findid %Garbage
and it will drag one item from pack to garbage but no more than that one :(

I will try it without the %garbage on it and see what happens.

EDit: I tried it and it did the same thing, moved just one but it also had a bunch of "you must wait to perform another action" afterwards. Sad
« Last Edit: December 27, 2013, 08:00:32 PM by Crisis »

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13305
  • Activity:
    0.6%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Clearing a pack
« Reply #3 on: December 27, 2013, 08:23:26 PM »
0
So is

UVF_EWF_FWF_GWF
and
SLK_WOH_SGP_JSF_QPO_LMH_PPO

both considered garbage?

if so, then perhaps this?

Code: [Select]
gosub ClearPackGarbage UVF_EWF_FWF_GWF
gosub ClearPackGarbage SLK_WOH_SGP_JSF_QPO_LMH_PPO
stop
;--------------------------------
sub ClearPackGarbage
  finditem %1 C_ , #backpackid
  if #findcnt > 0
  {
    for #FINDINDEX 1 #FINDCNT
    {
      Exevent Drag #findid
      Exevent Dropc %Trashbarrel
      wait 20
    }
  }
return
« Last Edit: December 27, 2013, 08:27:33 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 3028
  • Activity:
    2.4%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +206
  • Referrals: 2
    • View Profile
Re: Clearing a pack
« Reply #4 on: December 27, 2013, 08:59:49 PM »
0
I have changed the sub to this

Code: [Select]
sub ClearPackGarbage
  menu delete scriptstatus
  Menu Font BGColor Black
  menu Font Color Lime
  menu text scriptstatus 95 100 Clearing Pack of Garbage
  finditem %Garbage C_ , #backpackid
  if #findcnt < 1
    return
  for #findindex 1 #findcnt
  {
    exevent drag %findid #findstack
    exevent dropc %Trashbarrel
  }
return

Garbage is identified in the setup as

Code: [Select]
set %garbage SLK_WOH_SGP_JSF_QPO_LMH_PPO ;crafted bows
I am not sure where ghost got that one line of garbage. I am still having the same problem with it dumping one item but not the rest.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13305
  • Activity:
    0.6%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Clearing a pack
« Reply #5 on: December 27, 2013, 09:08:42 PM »
0
You should keep some wait after the dropc.  Otherwise you'll be ghosting items like a mofo.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Clearing a pack
« Reply #6 on: December 27, 2013, 09:16:25 PM »
0
Sorry,  I was working of other stuff and paste the wrong item :( 

Code: [Select]
sub ClearPackGarbage
finditem SLK_WOH_SGP_JSF_QPO_LMH_PPO C_ , #backpackid   
wait 5
if #findcnt > 0
{
for %1 1 #findcnt
{
finditem SLK_WOH_SGP_JSF_QPO_LMH_PPO C_ , #backpackid
wait 5
Exevent Drag #findid
waiut 10
Exevent Dropc %Trashbarrel 
wait 10
}
}
return

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 3028
  • Activity:
    2.4%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +206
  • Referrals: 2
    • View Profile
Re: Clearing a pack
« Reply #7 on: December 27, 2013, 10:04:38 PM »
0
I tried this route and still same results, should I put a loop in there?

Code: [Select]
sub ClearPackGarbage
  menu delete scriptstatus
  Menu Font BGColor Black
  menu Font Color Lime
  menu text scriptstatus 95 100 Clearing Pack of Garbage
  finditem %Garbage C_ , #backpackid
  if #findcnt < 1
    return
  for %IitemToDump 1 #findcnt
  {
    Set #FindIndex %ItemToDump
    exevent drag #findid #findstack
    wait 10
    exevent dropc %Trashbarrel
    wait 10
  }
return

I tried a loop like this

Code: [Select]
sub ClearPackGarbage
  menu delete scriptstatus
  Menu Font BGColor Black
  menu Font Color Lime
  menu text scriptstatus 95 100 Clearing Pack of Garbage
  finditem %Garbage C_ , #backpackid
  if #findcnt < 1
    return
  DumpGarbage_Loop1:
  finditem %Garbage C_ , #backpackid
  if #findcnt > 0
  for %IitemToDump 1 #findcnt
  {
    Set #FindIndex %ItemToDump
    exevent drag #findid #findstack
    wait 10
    exevent dropc %Trashbarrel
    wait 10
    goto DumpGarbage_Loop1
  }
return

but it stops after the last item and I don't see a way to direct it to the return after the last item is dumped so I guess this way is out too.
« Last Edit: December 27, 2013, 10:09:15 PM by Crisis »

Offline Grandewd

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +24
  • Referrals: 0
    • View Profile
Re: Clearing a pack
« Reply #8 on: December 28, 2013, 12:31:34 AM »
0
You should keep some wait after the dropc.  Otherwise you'll be ghosting items like a mofo.

".....ghosting items like a  mofo"   

Love it when you talk like that! 
  ::)

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Clearing a pack
« Reply #9 on: December 28, 2013, 08:47:42 AM »
0
Crisis ,  the way it flow, it will scan and kept a count. so no loop is required.    Are you sure you are the right ID for the trash can.

Have a look at this.

Code: [Select]
sub ClearPackGarbage
  menu delete scriptstatus
  Menu Font BGColor Black
  menu Font Color Lime
  menu text scriptstatus 95 100 Clearing Pack of Garbage
  finditem %Garbage C_ , #backpackid
  if #findcnt > 0
{
  for %i 1 #findcnt
  {
     finditem %Garbage C_ , #backpackid
    exevent drag #findid #findstack
    wait 10
    exevent dropc %Trashbarrel
    wait 10
  }
}
return


or maybe this if all the bows are the same colour

Code: [Select]

sub ClearPackGarbage
  menu delete scriptstatus
  Menu Font BGColor Black
  menu Font Color Lime
  menu text scriptstatus 95 100 Clearing Pack of Garbage
  finditem %Garbage C_ , #backpackid
 for #findindex 1 #findcnt
{
if #findcol <> 0
   {
    exevent drag #findid #findstack
    wait 10
    exevent dropc %Trashbarrel
    wait 10
   }
}
return

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 3028
  • Activity:
    2.4%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +206
  • Referrals: 2
    • View Profile
Re: Clearing a pack
« Reply #10 on: December 28, 2013, 09:25:41 AM »
0
The bows are all regular wood and the script targets the trash barrel at the beginning of the script. I know one makes it in because I get a message about cleanup points. Unfortunately it only throws away one, no more unless I have it loop but then it stalls at clearing the pack of garbage. I do appreciate the suggestions and will try that out when I get a chance.

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Clearing a pack
« Reply #11 on: December 29, 2013, 07:24:32 AM »
0
All that is needed is a very simple change from your original post 1 code  (when draggin and dropping you must have waits or get ghost items). 


Code: [Select]
sub ClearPackGarbage
  menu delete scriptstatus
  Menu Font BGColor Black
  menu Font Color Lime
  menu text scriptstatus 95 100 Clearing Pack of Garbage
  finditem %1 C_ , #backpackid
  if #findcnt < 1
    return
  for #findindex 1 #findcnt
  {
    exevent drag #findid #findstack 
    wait 10
    exevent dropc %Trashbarrel
    wait 10
  }
return
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 3028
  • Activity:
    2.4%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +206
  • Referrals: 2
    • View Profile
Re: Clearing a pack
« Reply #12 on: January 01, 2014, 01:09:22 PM »
0
It was the wait the entire time, lol. Simple mistakes will get you every time. Thanks for the assistance everyone!

TM I think that you need to trade mark this phrase, "ghosting items like a mofo" LMAO

All that is needed is a very simple change from your original post 1 code  (when draggin and dropping you must have waits or get ghost items). 


Code: [Select]
sub ClearPackGarbage
  menu delete scriptstatus
  Menu Font BGColor Black
  menu Font Color Lime
  menu text scriptstatus 95 100 Clearing Pack of Garbage
  finditem %1 C_ , #backpackid
  if #findcnt < 1
    return
  for #findindex 1 #findcnt
  {
    exevent drag #findid #findstack 
    wait 10
    exevent dropc %Trashbarrel
    wait 10
  }
return

I made it a wait 20 and it worked perfectly!
« Last Edit: January 01, 2014, 01:12:11 PM by Crisis »

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Clearing a pack
« Reply #13 on: January 02, 2014, 05:42:02 AM »
0
The ghosting was the waits.... but also note the change on the drag line

for #findindex 1 #findcnt
  {
    exevent drag #findid #findstack 

When looping, ie setting  #findindex 1 then 2 then 3....#findcnt  what you are doing is changing a pointer and when #findindex =1 .. #findid, #findstack and all the other #find??? variable are set to the FIRST item found details... When you then set #findindex = 2 .. it resets all the #find??? vars to the second item found.... set #findindex 10 all #find??? vars are set to the 10th item in the found list from the last finditem command etc etc

That was an important change from the way you originally  had it.




Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Tags: