Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Open Door Macro
Author Message
Avatar
Journeyman
*

Posts: 172
Likes Given: 6
Likes Received: 27 in 12 posts
Joined: Apr 2012
Reputation: 5

The North Shield

Post: #1
Open Door Macro
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.
(This post was last modified: 02-23-2014 03:08 AM by Avatar.)
02-23-2014 03:06 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,140
Likes Given: 217
Likes Received: 89 in 76 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #2
RE: Open Door Macro
Foritems 2
If strmatch(*t_door*, <type>)
Use // or dclick
Endif
Endfor

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
02-23-2014 01:45 PM
Find all posts by this user Like Post Quote this message in a reply
pinku
Journeyman
*

Posts: 118
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Apr 2013
Reputation: 4



Post: #3
RE: Open Door Macro
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!
02-23-2014 03:40 PM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #4
RE: Open Door Macro
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.
02-23-2014 07:32 PM
Find all posts by this user Like Post Quote this message in a reply
Avatar
Journeyman
*

Posts: 172
Likes Given: 6
Likes Received: 27 in 12 posts
Joined: Apr 2012
Reputation: 5

The North Shield

Post: #5
RE: Open Door Macro
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 )
(This post was last modified: 02-24-2014 07:52 AM by Avatar.)
02-24-2014 07:49 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #6
RE: Open Door Macro
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.

[Image: 2nis46r.jpg]
02-24-2014 09:42 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Avatar
Journeyman
*

Posts: 172
Likes Given: 6
Likes Received: 27 in 12 posts
Joined: Apr 2012
Reputation: 5

The North Shield

Post: #7
RE: Open Door Macro
(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
02-24-2014 12:31 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Staff_Stanic
Journeyman
*

Posts: 96
Likes Given: 25
Likes Received: 14 in 8 posts
Joined: Nov 2012
Reputation: 1

Dimension Shard

Post: #8
RE: Open Door Macro
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
(This post was last modified: 03-13-2014 10:58 AM by Staff_Stanic.)
03-13-2014 10:57 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #9
RE: Open Door Macro
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
03-13-2014 07:25 PM
Find all posts by this user Like Post Quote this message in a reply
Avatar
Journeyman
*

Posts: 172
Likes Given: 6
Likes Received: 27 in 12 posts
Joined: Apr 2012
Reputation: 5

The North Shield

Post: #10
RE: Open Door Macro
Thanks.
03-14-2014 09:07 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)