SphereCommunity
Open Door Macro - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: Open Door Macro (/Thread-Open-Door-Macro)



Open Door Macro - Avatar - 02-23-2014 03:06 AM

As you know all, there is opendoor makro in client-option section. The problem is ,for instance, open door macro can open the door ; however, from 2 tiles range cant close the door. So, I cant get the problem behind this. If someone can help about this, I'l be very pleased. This is only happening in houses. I'm using house system (like mordaunt's, from CloudBr)
Thanks in advance.


RE: Open Door Macro - Extreme - 02-23-2014 01:45 PM

Foritems 2
If strmatch(*t_door*, <type>)
Use // or dclick
Endif
Endfor


RE: Open Door Macro - pinku - 02-23-2014 03:40 PM

I can relate to this problem too, I remember doing some testing based on this thread:

http://forum.spherecommunity.net/Thread-The-UO-Project

but I had no luck.. tested what Extreme said now too, still "can't reach that".

Code:
ON=@UserExtCmd
IF (<ARGN1> == 058)
FORITEMS 5
IF STRMATCH(*T_DOOR_LOCKED*, <TYPE>)
USEITEM //DCLICK // USE //whatever else xD
ENDIF
ENDFOR

Oh, and I'm sorry for hijacking the thread a bit, Avatar. Just trying to add some more information!


RE: Open Door Macro - XuN - 02-23-2014 07:32 PM

I know in 55r402 the UserExtCmd trigger passed some values like act (or argo, can't remember now) and I had a custom trigger called @OpenDoor and @Open called on chars and doors respectively, but somehow and somewhere.... it's not giving act anymore... maybe client side or code break, i'll take a look on it ASAP, i'm some busy right now.


RE: Open Door Macro - Avatar - 02-24-2014 07:49 AM

The script below works actually. I have right now around 140 online player in my shard. However, i dunno whether it is gonna lag the server or not. I'll look for it. It seems nice right now. Before this post, i thought usage of userextcmd but as packet filtering, i assumed that it could lag the server. If there wont be any problem, i use this as it is. Or if you advise me some thing more efficient, i can correct it.

PHP Code:
if <argn1> == 88
  
IF (<SRC.UID.<SRC.REGION.UID>.TYPE>==t_multi) || (<SRC.UID.<SRC.REGION.UID>.TYPE>==t_multi_custom)
    
FORITEMS 3
        
IF STRMATCH("T_DOOR_LOCKED""<TYPE>")
            
USEITEM 
        
ENDIF
    ENDFOR
endif 

This works only if you are in house. ( because the problem actually only happening in house )


RE: Open Door Macro - Mordaunt - 02-24-2014 09:42 AM

A door will close when it's timer hits zero. So either set the timer to zero, or set the timer to a lower number that's closer to zero when it is opened by the player.


RE: Open Door Macro - Avatar - 02-24-2014 12:31 PM

(02-24-2014 07:49 AM)Avatar Wrote:  The script below works actually. I have right now around 140 online player in my shard. However, i dunno whether it is gonna lag the server or not. I'll look for it. It seems nice right now. Before this post, i thought usage of userextcmd but as packet filtering, i assumed that it could lag the server. If there wont be any problem, i use this as it is. Or if you advise me some thing more efficient, i can correct it.

PHP Code:
if <argn1> == 88
  
IF (<SRC.UID.<SRC.REGION.UID>.TYPE>==t_multi) || (<SRC.UID.<SRC.REGION.UID>.TYPE>==t_multi_custom)
    
FORITEMS 3
        
IF STRMATCH("T_DOOR_LOCKED""<TYPE>")
            
USEITEM 
        
ENDIF
    ENDFOR
endif 

This works only if you are in house. ( because the problem actually only happening in house )

I know how it is working. "useitem" works fine. What i'm looking for is more efficient than userextcmd. If there exists of course. There is no problem right now. Thanks


RE: Open Door Macro - Staff_Stanic - 03-13-2014 10:57 AM

Use 'ISNEARTYPE', before the FORITEMS.
Code:
IF (<SRC.UID.<SRC.REGION.UID>.TYPE>==t_multi) || (<SRC.UID.<SRC.REGION.UID>.TYPE>==t_multi_custom)
  IF (<SRC.ISNEARTYPE t_door_locked 3>)
    FORITEMS 3
     [...]
    ENDFOR
  ENDIF
ENDIF



RE: Open Door Macro - XuN - 03-13-2014 07:25 PM

That will resolve problems you posted in another posts, however if you are going to use a foritems loop I would place the check for the type inside (as the isneartype function is a loop itself).
Also, avoid the usage of STR*functions as much as you can, they are slower than a simple comparison with ==.
Code:
IF (<SRC.UID.<SRC.REGION.UID>.TYPE>==t_multi) || (<SRC.UID.<SRC.REGION.UID>.TYPE>==t_multi_custom)
    FORITEMS 3
      if (<Type>==t_door) || (<Type>==t_door_locked)
       UseItem
      endif
    ENDFOR
ENDIF



RE: Open Door Macro - Avatar - 03-14-2014 09:07 AM

Thanks.