Author Topic: Trouble with Exevent DropPD Command  (Read 4859 times)

0 Members and 1 Guest are viewing this topic.

Offline PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Trouble with Exevent DropPD Command
« on: January 26, 2010, 01:43:24 PM »
0
So I built a melee trainer that re-equips your weapon, among other things.  Everything else seems to be working as intended, but I am having problems getting the weapon to equip once it breaks.  Here is the code I am using.  Anyone have a suggestion?

Code: [Select]
Event Macro 8 1
Wait 5
Finditem %WeaponType C_ , #CharID
If #FindCnt = 0
   Gosub Equip %WeaponType



Code: [Select]
Sub Equip
Finditem %1 C_ , %Secure
ExEvent Drag #Findid
Wait 10
ExEvent DropPD #CharID
Wait 20
Return
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

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: Trouble with Exevent DropPD Command
« Reply #1 on: January 26, 2010, 01:45:19 PM »
0
make sure your paperdoll is open.   it can be minimized but if must be open.

Also in the equip sub i note you dont have a check to make sure if actually found something to equip.
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 PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: Trouble with Exevent DropPD Command
« Reply #2 on: January 26, 2010, 01:47:52 PM »
0
Pretty sure it is open. The "Event Macro 8 1" I dropped in front of the FindItem should open it before it does that check.  I put that in because it wasn't working consistently, but it didn't seem to help.
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: Trouble with Exevent DropPD Command
« Reply #3 on: January 26, 2010, 01:50:15 PM »
0
I thought about putting that check in, but it seemed to run fine without it.  Might be a good spot to trouble shoot though...

I have the same script equipping armor and the weapon, but only the weapon seems to be giving me trouble.
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: Trouble with Exevent DropPD Command
« Reply #4 on: January 26, 2010, 01:53:23 PM »
0
I am going to see how it runs if I drop the #CharID after the DropPD.  Looks from the documentation like it doesn't need it.
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline Khameleon

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: Trouble with Exevent DropPD Command
« Reply #5 on: January 26, 2010, 01:53:58 PM »
0
hrm.. I was unaware that any of the other ExEvent Drop's worked except for DropC...

Offline PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: Trouble with Exevent DropPD Command
« Reply #6 on: January 26, 2010, 01:59:05 PM »
0
It definitely works and is smmoooth -- when it doesn't just stop working for me.  I can't tell if its something buggy about doing a finditem in a paperdoll or if its the DropPD command.  When the script starts it chucks a suit of armor and a weapon onto the paperdoll in about four seconds.
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

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: Trouble with Exevent DropPD Command
« Reply #7 on: January 26, 2010, 02:07:16 PM »
0
yes a patch about 4/5months back fixed the drop paperdoll... not that they actually realized they fixed 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."

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: Trouble with Exevent DropPD Command
« Reply #8 on: January 26, 2010, 02:58:34 PM »
0
That Deserves a LOL
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: Trouble with Exevent DropPD Command
« Reply #9 on: January 26, 2010, 03:06:35 PM »
0
Now of course the script is working perfectly and I can't reproduce the problem...
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: Trouble with Exevent DropPD Command
« Reply #10 on: January 27, 2010, 09:01:11 AM »
0
I believe I have fixed the DropPD problem. I tested it a bunch and it works maybe 50% of the time. I made it more consistent by putting it into a REPEAT. 


Code: [Select]
;==========================================================
Sub EquipWeapon
;event exmsg #charid 3 4 TEST MESSAGE In EquipWeaponSub looking for WeaponType %1
Finditem %1 C_ , #CharID
If #FindCnt = 1
   Return
Finditem %1 C_ , #BackpackID
If #FindCnt >= 1
   {
   ;event exmsg #charid 3 4 TEST MESSAGE Found weapon in backpack, attempting to equip %1
   REPEAT
   ExEvent Drag #Findid
   Wait 20
   ExEvent DropPD
   Wait 20
   Finditem %1 C_ , #CharID
   UNTIL #FindCnt = 1
   Return
   }
Finditem %1 C_ , %Secure
If #FindCnt >= 1
   {
   ;event exmsg #charid 3 4 TEST MESSAGE Found weapon in secure, attempting to equip
   REPEAT
   ExEvent Drag #Findid
   Wait 20
   ExEvent DropPD
   Wait 20
   Finditem %1 C_ , #CharID
   UNTIL #FindCnt = 1
   Return
   }
Display You are out of weapon type %1. Stock more in your secure and restart.
Halt




I am leaving in some of my test lines for now, but the trainer script is almost finished.  http://www.scriptuo.com/index.php?topic=4080.msg33847#msg33847
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

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: Trouble with Exevent DropPD Command
« Reply #11 on: January 27, 2010, 09:12:28 AM »
0
logical errors in your code.
You use findid as the item to equip right logically after issuing a finditem that returns finditem as x ie nothing found.

logical flow .. means if fails on first drag drop will fail on all future ones as well
 executes
 Finditem %1 C_ , #CharID   ; not found #findid is x
 UNTIL #FindCnt = 1
 repeat
   exevent drag #findid    ; <-- findid is still x drags nothing.



Code: [Select]
Sub EquipWeapon
  set !EquipType %1
  Finditem !EquipType C_ , #CharID
  while #findcnt = 0
     {
     Finditem !EquipType C_ , #backpackid
     If #findcnt = 0  
        {
        Display You are out of weapon type %1. Stock more in your secure and restart.
        Halt  ; this is a sad way to end a script imho should be only ONE halt command in the entire script
        }
     set !ToEquip #findid
     ExEvent Drag !ToEquip
     ExEvent DropPD
     Wait 25
     Finditem !EquipType C_ , #CharID
     }
return  
« Last Edit: January 27, 2010, 09:16:32 AM by Endless Night »
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 PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: Trouble with Exevent DropPD Command
« Reply #12 on: January 27, 2010, 09:54:37 AM »
0
Thanks EN, I see what you mean. I think it works because the finditems are working correctly enough that they have overcome the flaw. The key seems to be to attempt the DropPD until it works correctly and I was only doing it once in my earlier version.

I am not super familiar with the "While" command. Based on your post I am guessing that it runs the following bracket until the condition is met.  Nice lesson for me. How about this modification to include the secure check as well as the backpack check?

Code: [Select]
Sub EquipWeapon
  set !EquipType %1
  Finditem !EquipType C_ , #CharID
  while #findcnt = 0
     {
     Finditem !EquipType C_ , #backpackid
     If #findcnt = 0  
        {
          Finditem !EquipType C_ , %Secure
              If #findcnt = 0
                {  
        Display You are out of weapon type %1. Stock more in your secure and restart. You made EN SAD by not making more weapons when you set up the script.
        Halt  ; this is a sad way to end a script imho should be only ONE halt command in the entire script
                 }
        }
     set !ToEquip #findid
     ExEvent Drag !ToEquip
     ExEvent DropPD
     Wait 25
     Finditem !EquipType C_ , #CharID
     }
return



Any suggestions for what I do when I hit this dead end?   maybe a pause instead? I don't want to keep my toons wrestling, chewing up resources for no gain...
« Last Edit: January 27, 2010, 09:56:16 AM by Paulonius »
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline PauloniusTopic starter

  • Elite
  • *
  • *
  • Posts: 2040
  • Activity:
    0%
  • Reputation Power: 29
  • Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.Paulonius is on the verge of being accepted.
  • Respect: +162
  • Referrals: 1
    • View Profile
Re: Trouble with Exevent DropPD Command
« Reply #13 on: January 27, 2010, 10:00:37 AM »
0
One more question from looking at your code.  The documentation on EUO suggests a wait is required after the Exevent Drag and before the Exevent DropPD.  The example has a wait 10 after each statement.  Do you generally only use the wait 25 after the drop?

 
This coin declares Caesar is "Dictator for Life." He did serve as Dictator for the remainder of his life, but his life would end only a few weeks after this issue. For Caesar to put his image on coins and essentially declare himself king was too much for Brutus and his republican allies.

"If everything seems under control, you're not going fast enough'
-Mario Andretti

"If everyone is thinking alike, someone isn't thinking."
- General George Patton Jr

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: Trouble with Exevent DropPD Command
« Reply #14 on: January 27, 2010, 10:03:32 AM »
0
I do believe everything Is Lagg Based. In my experience with all exevent drags and drops THe minimum Time requirement between dragging/Dropping and object, and being able to perform another action is 1s.


So, think you can do it.

Exevent drag #findid
wait 10
exevent droppd
wait 10

or


Exevent Drag #findid
exevent droppd
wait 20

I Wish Event drag worked with Exevent dropc, that would make life so much easier. 
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Tags: