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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
minish1
Beginner


Joined: 24 Feb 2005
Posts: 23

PostPosted: Wed Jun 08, 2005 11:43 pm   

creating a simple message coder
 
hi i was wondering if somone could help me make a simple message coder that would work if i specifially tell someone something and they tell me a message back, for example, if my friend(who also had the code/decoder) sends me a message, it is encoded over the mud but my zmud recognizes a message from him and translates it...

for example:
from bob's end, he types in tell tom hello, my name is bob.
zmud changes this to some gibberish that is sent over the mud looking something like this "tell tom asdf, av poui im wec." but then on my end, the zmud sees its a message from bob and changes the letters back to this:
Bob just flashed, "hello, my name is bob."

i would like to simply make a list like a=i, b=d etc etc... then have that list of replacements work when i send a message to a specific person, but leave messages to others unencoded... hope someone understands what i mean
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Thu Jun 09, 2005 12:34 am   
 
From your side:
#ONINPUT {tell bob (*)} {#SUBSTITUTE {tell bob %subchar(%1,"abcdefghijklmnopqrstuvwxyz","ghijklmnopqrstuvwxyzabcdef")}}

From his side:
#TRIGGER {^Jim tells you '(*)} {#PSUB "%subchar(%1,'ghijklmnopqrstuvwxyzabcdef','abcdefghijklmnopqrstuvwxyz'" %x1)}

Cool
Reply with quote
minish1
Beginner


Joined: 24 Feb 2005
Posts: 23

PostPosted: Thu Jun 09, 2005 1:29 am   
 
hrm... had to switch the order on the second part, got the coding working, but i cant change the syntax entirely...

for the trigger, i need it to recognize Jim just flashed, "(*)

with quotes and a comma... but when i add in the comma and quotes the trigs stop working...
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Thu Jun 09, 2005 2:10 am   
 
The ending quotes are going to mess it up in that case...
Change it to:
^Jim just flashed, "(*)"$

Changing its simple...
In the two quotes "abcdefghijklmnopqrstuvwxyz" and "ghijklmnopqrstuvwxyzabcdef" there is a direct mapping from one to the other. So if you had (in the original sentence an "a" it will be replaced with a "g" and so on down the line and lastly a "z" with an "f".

Of course the person recieving will get a bunch of giberish so he has to reverse the process which is why they are backwards from each other...
Reply with quote
minish1
Beginner


Joined: 24 Feb 2005
Posts: 23

PostPosted: Thu Jun 09, 2005 2:52 am   
 
thanks for the help, the settings you put didnt work correctly, but helped greatly in pointing me in the right direction... by the reverse order, i meant i had to change "ghijklmnopqrstuvwxyzabcdef" to "fedcbazyxwvutsrqponmlkjihg"... but yea, i got that and the rest all figured out... like i said, thank you for the help
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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