Jump to content
  • 0

Disguise Event


LOLSIF

Question


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   0
  • Joined:  02/18/12
  • Last Seen:  

Hi, I'm currently using the disguise event that comes with rAthena and the script seems to work properly, except it doesn't register when I type the correct monster... I'm running the latest version of rAthena off my home PC with windows 7 (for the moment) I've searched around and the problem seems to be with PCRE. I've implemented the MouseJstr script (in doc/sample/npc_pcre.txt) and no matter what I type, I keep getting one of these responses:

Lquote41:
switch(rand(6)) {
case 0: npctalk "Very interesting"; break;
case 1: npctalk "I am not sure I understand you fully"; break;
case 2: npctalk "What does that suggest to you?"; break;
case 3: npctalk "Please continue"; break;
case 4: npctalk "Go on"; break;
case 5: npctalk "Do you feel strongly about discussing such things?"; break;
}

Which stems from:

defpattern 1, "([^:]+) .*)", "Lquote41";

Can anyone help me please?

-Thanks

Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

Why do you copy sample PCRE script into disguise? Let me tell me what this do:

Lquote41:
switch(rand(6)) {
case 0: npctalk "Very interesting"; break;
case 1: npctalk "I am not sure I understand you fully"; break;
case 2: npctalk "What does that suggest to you?"; break;
case 3: npctalk "Please continue"; break;
case 4: npctalk "Go on"; break;
case 5: npctalk "Do you feel strongly about discussing such things?"; break;
}
......
defpattern 1, "([^:]+).*)", "Lquote41";

Which mean listen no whatever, and try random from 1 to 6 and execute the randomized case.

The disguise event should work properly without any edit.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   0
  • Joined:  02/18/12
  • Last Seen:  

I haven't copied the script into disguise.. I've just implemented it to see if PCRE was working or not... And I haven't edited the disguise event script either. I'm confused, what are you telling me?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

You are getting responses because your server does have PCRE script commands, so the SVN disguise event should work.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   0
  • Joined:  02/18/12
  • Last Seen:  

Yeah i know i'm getting those responses, but i should be getting different ones according to what i say.. like if i say hello or computer

defpattern 1, "([^:]+):.*\\shello.*", "Lquote0";

// hello

Lquote0:

npctalk "How do you do. Please state your problem.";

end;

defpattern 1, "([^:]+):.*\\scomputer.*", "Lquote1";

// computer

Lquote1:

switch(rand(4)) {

case 0: npctalk "Do computers worry you?"; break;

case 1: npctalk "What do you think about machines?"; break;

case 2: npctalk "Why do you mention computers?"; break;

case 3: npctalk "What do you think machines have to do with your problem?"; break;

}

end;

No matter what i say i just get the same responses :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

http://www.eathena.ws/board/index.php?showtopic=271175

try the script in post#10 and see you get the |00 generated from your hexed client or not

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   0
  • Joined:  02/18/12
  • Last Seen:  

Yes, I implemented that script, and the poring copies exactly what I'm saying.. However, I also get the debug in the console saying |00 before everything I say :(

Edited by LOLSIF
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

http://www.eathena.w...howtopic=271175

try the script in post#10 and see you get the |00 generated from your hexed client or not

Yeah ~ Annie save my day again ~ >.<

i know that different langtype will affect the defpattern stuff...but i didnt know it's because of the "|00" .........LOL

it took me so long to figure out how to solve this.....till today ~ xD

/me give another +1 rep to annie ^^

and damn..i alway forget to use debugmes to debug script ==''

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   0
  • Joined:  02/18/12
  • Last Seen:  

Hmm I'm still kinda confused, I'm no expert on scripting and all that ahahah, so is there any quick fix for it ?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

you can try the script write by @KeyWorld

defpattern 1, "([^:]+): (\\|\\d{2})?"+$MonsterName$+".$", "L_0";

just simple edit this to make it triggerable in the way you want.

$MonsterName$

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   0
  • Joined:  02/18/12
  • Last Seen:  

Thanks, that works prefectly :) So essentially I just need to use (\\|\\d{2})to accomodate for the |00 ?

Thanks for the help Annie and Emistry !!

Edited by LOLSIF
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...