Author Topic: exevent dropPD Work Around  (Read 5029 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: +304
  • Referrals: 1
    • View Profile
exevent dropPD Work Around
« on: June 27, 2010, 10:59:21 AM »
0

I have been working on a script that uses exevent dropPD for a while now and looking at an alternative as a work around because of the inconsistency with dropPD. 

After looking at some other scripts and doing some experimenting, I think that the snippet below has a lot of potential.  I am using a drag, opening the paperdoll, and then using a click with move cursor.  It seems to be working a lot of the time. However, I am coming up short with a test for when it fails.  When it doesn't work, it typically picks up the item and holds it on the cursor, but doesn't drop it.  If I could check the cursor to see if the thing is still there, then I could try the click again as a failsafe.  The best way I see of doing that is from the #Cursorname variable, that says drag_gump when it is holding something.  It doesn't have an ID though. Is there a way to confirm whether or not the cursor is carrying something? I will play with this some more and report back, but figured I would put it out there to see what folks think.   


Code: [Select]
  Event Drag %ItemToEquip
  Wait 15
  event macro 8 1  ; paperdoll
  wait 20
  Gosub OffsetClickMC 100 120
  Wait 15
If #Contname = drag_gump
     {
     Gosub OffsetClickMC 100 120
     Wait 15     
     }
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

Scrripty

  • Guest
Re: exevent dropPD Work Around
« Reply #1 on: June 27, 2010, 11:55:30 AM »
0
http://wiki.easyuo.com/index.php/LLiftedKind

Then you have the #lliftedtype and #lliftedid to use to help you out. :)

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: +304
  • Referrals: 1
    • View Profile
Re: exevent dropPD Work Around
« Reply #2 on: June 27, 2010, 12:38:33 PM »
0
Thanks Twinkle McNugget, that is helpful.  May be the same as the #CONTNAME check I was using, but I like it better.

Okay, so here are the subs I am testing.  The first is one where I really need the item equipped because its a weapon.  The second is one for items that I want equipped, but it would be alright if it missed once or twice in the cycle of other things.  These are running in the midst of another script that is healing with aids constantly and has the potential to interfere with the drag/click-drop.  

I will update after I test it a bunch.

Really want to get it equipped (weapon):

Code: [Select]
;==========================================================
Sub EquipWeapon
Set %Equipped No
Set %EquipType %1
Set %EquipFromSecure No
Set %EquipItemFound No
Set %EquipTimeout1 #Scnt2 + 250
Set %EquipTimeout2 #Scnt2 + 500
Finditem %EquipType C_ , #BackpackID
If #findcnt < 1
   {
   Set %EquipFromSecure Yes
   Finditem %EquipType C_ , %Secure
   }
Else
    {
    Set %ItemToEquip #findid
    Set %EquipItemFound Yes
    }
If #findcnt > 0 && %EquipFromSecure = Yes
   {
   Set %EquipItemFound Yes
   Set %ItemToEquip #findid
   exevent drag #findid
   Wait 15
   exevent dropc #BackpackID
   Wait 15
   }
If %EquipItemFound = No
   Return #False
Set !HealPause On
Wait 15
Repeat
   {
   If #lLiftedKind = 0
      {
      event drag %ItemToEquip
      wait 15
      }
   event macro 8 1
   Wait 20
   Gosub OffsetClickMC 100 120
   wait 10
   finditem %EquipType C_ , #CHARID
   If #FindCnt > 0
      Set %Equipped Yes
   If %EquipWeaponTimeout1 >= #Scnt2 && %Equipped = No
      {
      gosub TM_CheckBackpack  610 610
      gosub TM_CheckPaperdoll 810 510
      }
   }
Until %Equipped = Yes || %EquipWeaponTimeout2 >= #Scnt2
If #lLiftedKind = 1
   {
   event macro 8 1
   Wait 20
   Gosub OffsetClickMC 100 120
   wait 10
   }
Set !HealPause OFF
If %Equipped = Yes
   Return #True
Return #False


Want it equipped, but its not urgent:

Code: [Select]
;==========================================================
Sub EquipArmor
  Set %EquipType %1
  Finditem %EquipType C_ , #BackpackID
  If #findcnt < 1
     {
     Finditem %EquipType C_ , %Secure
     If #findcnt < 1
        {
        Event exmsg #charid 3 4 You are out of Armor Item Type %1
        Return #False
        }
     }
  Set %ItemToEquip #findid
  Set !HealPause ON
  Wait 15
  Event Drag %ItemToEquip
  Wait 15
  event macro 8 1  ; paperdoll
  wait 20
  Gosub OffsetClickMC 100 120
  Wait 10
  If #lLiftedKind = 1
   {
   Gosub OffsetClickMC 100 120
   wait 10
   }
  Set !HealPause OFF
Return




« Last Edit: June 27, 2010, 12:42:09 PM 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

Scrripty

  • Guest
Re: exevent dropPD Work Around
« Reply #3 on: June 27, 2010, 12:49:41 PM »
0
This is a great time for you to learn namespaces Paul.  Copying variables between namespaces is easy, and you can basically set the state of the equipping sub to "on" and while it's on you can have the healing pause.  I have a looting/healing/attacking sub that is in 2 scripts, and while the looting is drag/dropping to pack, the healing pauses, so while I'm healing/attacking, I'm looting in between... it works pretty great if you can time things right.  Normally doing other things while looting is a bad idea, but if you get everything right, and make sure you DONT move while doing it, you can do some pretty amazing stuff. :)

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13314
  • Activity:
    0%
  • 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: +3090
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: exevent dropPD Work Around
« Reply #4 on: June 27, 2010, 06:08:30 PM »
0
Namespaces make me all warm an tingley!  ;)
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: exevent dropPD Work Around
« Reply #5 on: June 27, 2010, 06:35:49 PM »
0
So many people just don't get them because they don't think they're needed but you don't really start doing powerfull stuff till you learn namespaces. :)  And they aren't hard at all, just a lot of people don't take the time to learn them so they're perceived as being difficult.  They're not. :)  Think of them like seperate ziplock baggies for variables.  Each ziplock bag can hold an infinite amount of variables that don't affect any other ziplock bag of variables.  And you can copy variables between any ziplock bag... :)  I especially like using unique namespace names that allow you to use the same namespace but keep it seperate from other tabs.  Example:

Code: [Select]
set %namespaceName PaulsNamespace , #clinr
namespace push
namespace global %namespaceName
namespace clear
YOUR CODE HERE
namespace pop

Say you're using this script on 3 seperate clients, all the variables on the seperate clients will be the same, but they are kept seperate by the namespace and the variable #clinr, but since it's easy to know what client you're in, it's easy to copy variables between the clients this way because you know when you're swapping between clients, exactly what client you're in with the #clinr variable.


Offline Alpha

  • Hero Member
  • *
  • Posts: 583
  • Activity:
    0%
  • Reputation Power: 10
  • Alpha barely matters.Alpha barely matters.
  • Respect: +99
  • Referrals: 0
    • View Profile
Re: exevent dropPD Work Around
« Reply #6 on: June 27, 2010, 09:41:33 PM »
0
On a Side note... are you using 

event macro 58 0

for healing yourself?   If you have the new targeting system on you can effectively bandage yourself & no Target cursor is generated using that Event macro.  It would interfere less with Cursors & might help with Drags/drops...

Just an idea (if you weren't using it already)....

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: +304
  • Referrals: 1
    • View Profile
Re: exevent dropPD Work Around
« Reply #7 on: June 28, 2010, 06:37:13 AM »
0
I am not using heal self as the script is based on cross healing. 
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

Scrripty

  • Guest
Re: exevent dropPD Work Around
« Reply #8 on: June 28, 2010, 08:21:04 AM »
0
Actually Paul you can do "select nearest party member" then bandage selected.

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: +304
  • Referrals: 1
    • View Profile
Re: exevent dropPD Work Around
« Reply #9 on: June 28, 2010, 08:29:06 AM »
0
And that doesn't pull up a target cursor either?  

Is there a macro for select that you can drop an ID into?  I like this for cross healing if it doesn't use the targetting cursor, would be powerful.

Looking at macros 58 and 59 now. I will do some testing, that looks like it would rock in a cross heal script.  The only issue I see for the script I am working on now is that I am using bandages from a secure and I think 58 and 59 require aids in your backpack.

Just tested it out, you can use bandages from any source that you used them from previously and they don't need to be in your backpack.  I am going to convert my cross heal script over to setting the target and using event macro 59.  This will really help my script function more smoothly, thanks guys.  
« Last Edit: June 28, 2010, 08:52:29 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

Tags: