Jump to content
  • 0

The "On" command


iFoxkun

Question


  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  189
  • Reputation:   16
  • Joined:  11/20/11
  • Last Seen:  

I'm making a event for someone, but then, the event needs to have a command where it checks if the player is moving, sitting, or standing still. Is there an "On" command like OnTouch, OnClock command for this?

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

yes, you can use the OnTouch and specify the x1,y1 for the OnTouch after the NPC's id...

eg: prontera,158,173 script mynpc -1,10,10,{

}

would make it so if anyone was within +10x or -10x and +10y and -10y of the npc, it would trigger the OnTouch: label...

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  189
  • Reputation:   16
  • Joined:  11/20/11
  • Last Seen:  

for OnTouch I was giving an example, I want to know if it possible to have a command that notifies the NPC that the player is sitting, stand or staying still.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  392
  • Reputation:   47
  • Joined:  11/18/11
  • Last Seen:  

I don't think there's any.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

still and moving yes, but would require you to check every second... (crazy checks)

sitting... sadly no... although I think Brian was going to look into an is_sitting function lol

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  189
  • Reputation:   16
  • Joined:  11/20/11
  • Last Seen:  

Thats fine, can you give me the commands for the still and moving. Thanks c;

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  392
  • Reputation:   47
  • Joined:  11/18/11
  • Last Seen:  

*getmapxy("<variable for map name>",<variable for x>,<variable for y>,<type>{,"<search string>"})

This function will locate a character object, NPC object or pet's coordinates
and place their coordinates into the variables specified when calling it. It
will return 0 if the search was successful, and -1 if the parameters given were
not variables or the search was not successful.

Type is the type of object to search for:

 0 - Character object
 1 - NPC object
 2 - Pet object
 3 - Monster object.

While 3 is meant to look for a monster object, no searching will be done if you
specify type 3, and the function will always return -1.

Just check the character's position every second, if it doesn't change, he's still, if it does, then he moved. This is also not accurate.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

Here's the diff to add an is_sitting() script command:

http://eathena.kpaste.net/7f8c76eb4

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  189
  • Reputation:   16
  • Joined:  11/20/11
  • Last Seen:  

*getmapxy("<variable for map name>",<variable for x>,<variable for y>,<type>{,"<search string>"})

This function will locate a character object, NPC object or pet's coordinates
and place their coordinates into the variables specified when calling it. It
will return 0 if the search was successful, and -1 if the parameters given were
not variables or the search was not successful.

Type is the type of object to search for:

 0 - Character object
 1 - NPC object
 2 - Pet object
 3 - Monster object.

While 3 is meant to look for a monster object, no searching will be done if you
specify type 3, and the function will always return -1.

Just check the character's position every second, if it doesn't change, he's still, if it does, then he moved. This is also not accurate.

Alright, one more question, how would I make it do this.

If Still, stay in event.

if Still, but then Move, kick out of event.

If Move, kick out of event.

Here's the diff to add an is_sitting() script command:

http://eathena.kpaste.net/7f8c76eb4

Hmm. After look at the diff it says save map point, will this mean that the user's save place will be saved that the place the command is used? How do i diff a client, with TurtoiseSVN correct?

Edited by iFoxkun
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

That is_sitting() diff is in the unified diff format.

The + lines in green are the ones you add.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  24
  • Topics Per Day:  0.01
  • Content Count:  189
  • Reputation:   16
  • Joined:  11/20/11
  • Last Seen:  

That is_sitting() diff is in the unified diff format.

The + lines in green are the ones you add.

Alright thanks !

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...