Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Toxic
Adept


Joined: 27 May 2008
Posts: 299

PostPosted: Fri Aug 01, 2008 8:19 pm   

Allowing Telnet Negotiations.
 
CMUD seems to not allow 102 telnet negotiations when I connect to my MUD. Is this a setting I can fix to allow them?
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Fri Aug 01, 2008 11:46 pm   
 
Do you mean VT102?
Reply with quote
Toxic
Adept


Joined: 27 May 2008
Posts: 299

PostPosted: Fri Aug 01, 2008 11:52 pm   
 
No... I figured it out... My next question is... Im using a telnet trigger to match...
Code:

<IAC><SB><102>d<3><IAC><SE><LF><CR>


The problem is if you use (*) for your pattern it matches to d<3> But on the debugger window it says
Code:

f     Davos |  Telnet: (*) : (%1="d")


I just need to match the d and the 3... cant figure it out... any help?

EDIT: Dunno why thats doing that in the second code... It should be "d & # 3 ;" without the spaces
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Aug 02, 2008 10:03 am   
 
It is matching the it properly. There just is no symbol to display the break control character. If you want it to only match that code you use a regex and either octal or hex notation, \003 and \x03 respectively.

I guess the reall question is what do you want to do with it?
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Toxic
Adept


Joined: 27 May 2008
Posts: 299

PostPosted: Sat Aug 02, 2008 3:00 pm   
 
I need something that will match the d to %1 and the 3 to %2 using the above telopt. I just can't figure it out.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Aug 02, 2008 8:36 pm   
 
Ok, so once again what do you want to do with it once you have it captured? How about posting what you have so far as well to save me the time of creating it from scratch.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Toxic
Adept


Joined: 27 May 2008
Posts: 299

PostPosted: Sat Aug 02, 2008 11:49 pm   
 
No offense, but I don't really see what it matters what I want to do with the info if I can't even capture the correct info heh. Hell I dont even know for sure what I'm gonna do with it... doesnt really matter much if I can't isolate the d and the 3. The d is easy to isolate obviously... (%w) does the trick. But the control code parsing is a pita. So hopefully you can help me build a pattern or a script to isolate the 3, or help me match the <3> for testing in an #IF statement.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Aug 03, 2008 1:08 am   
 
I very rarely take offense. I have never taken offense at any persons inability to understand my way of thinking. I do tend to take offense at stupidity; which I define as a refusal to learn. Stupidity is completely different from ignorance, at least to my way of thinking.

Knowing what you want to do with the information helps to make it available to you in a usable fashion.
I already told you how to detect it separately in a previous post.
You don't care to answer my questions, or acknowledge my request in furtherance of aiding you.
You don't want to help me to help you, well the contrapositive becomes logically true. I should leave it at that and just ignore your posts for a while, but I am not that kind of a person.

I will present my thinking in a simple geographic analogy. You want a course plotted from point A to point B. First you must know where point A is, that is my request for your current triggers. Geographically speaking if you don't know where you are then you lost. Second is where to go, point B. Without a proper destination, all the maps in world can't help you figure a course. Simply my thinking is where am I, where do I want to be, then how do I get there.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Sun Aug 03, 2008 2:03 am   
 
Can't you just put in (.?)<(.?)> (regex) or something similar in for the pattern to get them separated into %1 and %2?
Reply with quote
Toxic
Adept


Joined: 27 May 2008
Posts: 299

PostPosted: Sun Aug 03, 2008 2:23 am   
 
No seb.. doesnt work. I've tried everything I know to do.

Viji... Want I want to do is simple.

#IF (%1 = "d") {#IF (%2 = 3) {Do Something}}

All that telopt does is tell the client that the player is free and available. (For a variety of tasks). %2 could be anything from 1 to 13. For now, I only need to worry about it if its 3. But I want to add the ability to later test %2 for other values.

I dunno what else I can tall you about what I want to do. I've done all the research and testing I know how to do to find a pattern to do what I need... Just don't know how to do it. Your help building the pattern would be appreciated since its obvious to me now, that you know how. And Im sorry Im a regex newbie... saying oh you just need to make it regex and use octal \003 means as bout as much as saying nothing does to me.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Aug 03, 2008 2:58 am   
 
As a wise man once said, "With great power comes great responsibility." Since all of humanity recognizes that knowledge=power, and it would seem that I create knowledge. It logically follows (about 7 steps later) that your use of this knowledge is your repsonsibility.
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <trigger type="Telnet" param="102" priority="10" regex="true" copy="yes">
    <pattern>d(.)</pattern>
    <value>#IF (%ascii(%1)=3) {do something}</value>
  </trigger>
</cmud>
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Toxic
Adept


Joined: 27 May 2008
Posts: 299

PostPosted: Sun Aug 03, 2008 3:07 am   
 
Code:

<trigger type="Telnet" param="102" priority="65461" regex="true" id="6546">
  <pattern>d(.)</pattern>
  <value>#IF (%ascii(%1) = 3) {#SHOW YES}</value>
</trigger>


Code:

0.0023 | i     Davos >afk<CR><LF>
0.0004 | d     Davos |  [1] Davos Comline : stopped
0.0262 | i     Davos *<ESC>[1;33mAFK mode removed. There are no tells waiting for you.<ESC>[0;37m<LF><CR>
0.0001 | <IAC><SB><102>d<3><IAC><SE><LF><CR>
0.0001 | <ESC>[1;37m[<ESC>[1;33m6999/6999hp <ESC>[1;36m3752/5110mn <ESC>[0;32m(5821)mv 911tnl (9571278)G 28qt T:0<ESC>[1;37m]<ESC>[1;32m Inside the Imperial Halls <ESC>[1;37m[<ESC>[1;32m[N]EUD<ESC>[1;37m]<ESC>[0;37m ><LF><CR>
0.0001 | <ESC>[0;37m
0.0002 | a     Davos #Telnet 102: d<3>
0.0018 | f     Davos |  Telnet: d(.) : (%1="")
0.0008 | c     Davos |  exec : Telnet "d(.)" : #IF (%ascii(%1) = 3) {#SHOW YES}
0.0002 | n     Davos |  Exec Trigger "d(.)"
0.0007 | a     Davos |*[AFK]* AFK mode removed. There are no tells waiting for you.
0.0060 | a     Davos |
0.0033 | a     Davos |[6999/6999hp 3752/5110mn (5821)mv 911tnl (9571278)G 28qt T:0] Inside the Imperial Halls [[N]EUD] >


Thats not matching.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Sun Aug 03, 2008 3:18 am   
 
Explain to me why that would work, Vij? Surely %1 would equal "<"?! Or are the <> not interpreted literally by the trigger parser and simply signify that what is inside is an ASCII character with this number? Confused
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Sun Aug 03, 2008 3:22 am   
 
Toxic, the trigger fired, even if the #IF failed, so can you try #PRINTing %1? Or setting a variable with it? So we can see what it matched... (if it's a printable character) You can also try printing %ascii(%1) and seeing what that is.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Aug 03, 2008 3:31 am   
 
Code:
0.0018 | f     Davos |  Telnet: d(.) : (%1="")
0.0008 | c     Davos |  exec : Telnet "d(.)" : #IF (%ascii(%1) = 3) {#SHOW YES}
0.0002 | n     Davos |  Exec Trigger "d(.)"
Says it matched and executed the trigger. It doesn't get much more explicit then the statement "EXec Trigger".

I checked what you posted and 3 is properly matched. I also checked that %ascii would be able to handle the character and it does. #SHOW isn't really recommended inside of Telnet trigger, I would suggest testing with #DEBUG, #WINDOW, or #INPUT.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Toxic
Adept


Joined: 27 May 2008
Posts: 299

PostPosted: Sun Aug 03, 2008 3:56 am   
 
I know the pattern works... I've already stated that that pattern works... Your pattern is simple. But its not firing the #IF statement. If it was, it would show it in the debug... REGARDLESS of whether #SHOW is good to use in a telnet trigger it would show it trying to fire. So simply put... %ascii(%1) does NOT equal 3.

If you use this pattern and then just put #SHOW YES in the trigger. The #SHOW fires correctly. So the issue isnt the #SHOW. Its the %ascii(%1) matching to 3.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Aug 03, 2008 12:54 pm   
 
I added a #PRINT to the trigger for debugging and tested it by simulating the telnet negotiations.
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <trigger type="Telnet" param="102" priority="10" regex="true" copy="yes">
    <pattern>d(.)</pattern>
    <value>#IF (%ascii(%1)=3) {#PRINT YES} {#PRINT %ascii(%1)}</value>
  </trigger>
</cmud>

#SHOWP %char(255)%char(250)%char(102)d%char(4)%char(255)%char(240)
#SHOWP %char(255)%char(250)%char(102)d%char(3)%char(255)%char(240)

Everything seems to be working exactly as it should. The display was:
4
YES

I don't know what else to tell you.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Sun Aug 03, 2008 2:14 pm   
 
Hello? Anyone can hear me? Confused Vij doesn't reply to my message and Toxic doesn't do what I suggest. I suggested a method of seeing what %1 was. I'll be more explicit:
Code:
<trigger type="Telnet" param="102" priority="65461" regex="true" id="6546">
  <pattern>d(.)</pattern>
  <value>#PRINT Fired
#VAR TelnetFirstParam %ascii(%1)
#IF (%ascii(%1) = 3) {#SHOW YES}
#PRINT TelnetFirstParam is @TelnetFirstParam</value>
</trigger>
Reply with quote
Toxic
Adept


Joined: 27 May 2008
Posts: 299

PostPosted: Sun Aug 03, 2008 2:16 pm   
 
Thats because you havn't been paying attention Seb. First of all I've already done that and posted the results. Second of all, its a non printable control code. All you get is a box. I've gotten it to work anyways.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Sun Aug 03, 2008 2:21 pm   
 
I was paying attention: you did not post the results of my test! Please check above if you don't believe me!

How did you get it to work?
Reply with quote
Toxic
Adept


Joined: 27 May 2008
Posts: 299

PostPosted: Sun Aug 03, 2008 2:24 pm   
 
Viji's trigger worked. And I'm not here to run your tests for you. You run them heh. I had already stated what %1 equaled. There was no sense it trying to figure it out again.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Sun Aug 03, 2008 2:40 pm   
 
Toxic wrote:
So simply put... %ascii(%1) does NOT equal 3.
...
Its the %ascii(%1) matching to 3.

Jeez, that's the last time I try and help you Toxic. They were tests I was suggesting for you! They are not for my benefit. I have no interest in telnet triggers for my own use!

And you did not state what %1 equaled. You simply stated that %1 did _not_ equal 3 (see above quote) and now you are saying that Viji's trigger did work. *confused*
Reply with quote
Toxic
Adept


Joined: 27 May 2008
Posts: 299

PostPosted: Sun Aug 03, 2008 6:23 pm   
 
Toxic wrote:
No... I figured it out... My next question is... Im using a telnet trigger to match...
Code:

<IAC><SB><102>d<3><IAC><SE><LF><CR>


The problem is if you use (*) for your pattern it matches to d<3> But on the debugger window it says
Code:

f     Davos |  Telnet: (*) : (%1="d")


I just need to match the d and the 3... cant figure it out... any help?

EDIT: Dunno why thats doing that in the second code... It should be "d & # 3 ;" without the spaces


Right here I tell you what %1 equals... Its kind of a given that if (*) equals "d & # 3 ;" (without the spaces) that d(*) would make %1 =& # 3 ; And as I stated... the raw captured text is unprintable. And I wasn't discounting your help. But everything you had mentioned I had already tried...
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Mon Aug 04, 2008 3:28 am   
 
Well, (a) that was a different trigger, and (b) I did suggest printing %ascii(%1), which you never stated that you had tried. If you had tried it, I had no way of knowing...
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net