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
Asylum
Newbie


Joined: 15 Dec 2021
Posts: 5
Location: Under your bed!

PostPosted: Wed Dec 15, 2021 10:56 pm   

a Little help please and thank you! <3
 
Hey dudes and dudettes!!

A LONG LONG time ago I used to play on a mud that someone created a thieves cant script, where if your character spoke in thieves cant to someone else who didn't have they would get garbled text.

I'm a utter noob and would love if someone could aid me with a script for CMUD.

I'd like to use it when my character uses the say/gossip/cgossip/tell/reply command.

Much love and peace to the dude or dudette that helps me!

<3
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Thu Dec 16, 2021 6:30 pm   
 
Gonna need a bit more to go off to help you with this idea.
_________________
Discord: Shalimarwildcat
Reply with quote
Asylum
Newbie


Joined: 15 Dec 2021
Posts: 5
Location: Under your bed!

PostPosted: Thu Dec 16, 2021 9:32 pm   
 
shalimar wrote:
Gonna need a bit more to go off to help you with this idea.


Firstly, thanks for answering!

Okay i will try explain it as best as possible. Here goes!

There was a script for CMUD that if i typed TC (Thieves Cant) it would cause my character to emote : Bob says in (Thieves Cant) "The days looking beautiful".
the person who he was emoting it to if they didnt have TC (Thieves Cant) would see : Bob says in (Thieves Cant) "Asd sdfd ggrweqh lrwjkwerjk". This script could be used for says, tells, replies, emotes, gossip or for clan gossip in the MUD.

Now obviously anyone with half a brain could work it out or decode it, however the script allowed you to change the variables so that each day the Thieves guild would send out a note saying the new enigma is "123456" instead of "654321" and that would then jumble the letters up differently for the day.

Please forgive me if i wasn't able to explain it correctly, however I'm not a fundi like you guys.

Hope this helps!

Much love!
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Fri Dec 17, 2021 1:27 am   
 
You are describing an alias to start with:

Code:
#ALIAS tc {
  $this=%params
  emote says in ~(Thieves Cant~), %concat(%char(34), $this, %char(34))
  }


Only you want to go through and change $this into $that according to the %char value of each character thereof based on a changeable @enigma code.

That part is a little trickier but quite possible.
_________________
Discord: Shalimarwildcat
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Fri Dec 17, 2021 2:12 am   
 
For the encoding, you need to do some fancy math on the %char values, and loop through your string a lot.
I suggest running it through a function, which will also make it easier to use in the various mediums you mentioned:

Code:

#FUNC encodeTC($enigma, $message) {
  #LOCAL $that
  #WHILE (%len($message)>0) {
    $code=$enigma
    #LOOP %len($code) {
      $key=%left($code, 1)
      $code=%right($code, 1)
      $encodeing=%left($message, 1)
      $message=%right($message, 1)
      #IF ((%char($encoding)>96) AND (%char($encoding)<123)) {
        $new=(%char($encoding)+$key)
        #IF ($new>122) {$new=($new-26)}
        $that=$concat($that, %char($new))
        } {
        $that=$concat($that, $encoding)
        }
      }
    }
  #RETURN $that
  }


This is untested mind you. But to use it you would essentially do:
$that=@encodeTC(@enigma, $this)
You would need a decoder as well, to make sense of anything.
_________________
Discord: Shalimarwildcat
Reply with quote
Asylum
Newbie


Joined: 15 Dec 2021
Posts: 5
Location: Under your bed!

PostPosted: Sat Dec 18, 2021 1:12 pm   
 
shalimar wrote:
For the encoding, you need to do some fancy math on the %char values, and loop through your string a lot.
I suggest running it through a function, which will also make it easier to use in the various mediums you mentioned:

Code:

#FUNC encodeTC($enigma, $message) {
  #LOCAL $that
  #WHILE (%len($message)>0) {
    $code=$enigma
    #LOOP %len($code) {
      $key=%left($code, 1)
      $code=%right($code, 1)
      $encodeing=%left($message, 1)
      $message=%right($message, 1)
      #IF ((%char($encoding)>96) AND (%char($encoding)<123)) {
        $new=(%char($encoding)+$key)
        #IF ($new>122) {$new=($new-26)}
        $that=$concat($that, %char($new))
        } {
        $that=$concat($that, $encoding)
        }
      }
    }
  #RETURN $that
  }


This is untested mind you. But to use it you would essentially do:
$that=@encodeTC(@enigma, $this)
You would need a decoder as well, to make sense of anything.


Hey dude!

THanks for writing this up! Do you have a decoder written for this by any chance please?

<3
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Sun Dec 19, 2021 6:10 pm   
 
I did not make the decoder.
I figured you could pull that off using this as an example.
Consider it your homework.

I also am only changing lowercase letters, as they are %char 97-122.
Uppercase is 65-90.
_________________
Discord: Shalimarwildcat
Reply with quote
Asylum
Newbie


Joined: 15 Dec 2021
Posts: 5
Location: Under your bed!

PostPosted: Mon Dec 20, 2021 5:29 am   
 
shalimar wrote:
I did not make the decoder.
I figured you could pull that off using this as an example.
Consider it your homework.

I also am only changing lowercase letters, as they are %char 97-122.
Uppercase is 65-90.


Hey my dude.

I know zero about coding, so homework would mean me having to learn how to code, which I know Zero about. Hence me being super appreciative about anyone helping me out, or trying to help me.

If i have to pay for someone to do this, then i guess that's the avenue I'm going to have to go, to enjoy a game i play for free.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Mon Dec 20, 2021 4:49 pm   
 
That is rather the point of this forum.
Learning to code.
_________________
Discord: Shalimarwildcat
Reply with quote
Asylum
Newbie


Joined: 15 Dec 2021
Posts: 5
Location: Under your bed!

PostPosted: Tue Dec 21, 2021 5:03 pm   
 
Ah okay, i didnt know that. My humblest of apologies.
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Mon Dec 27, 2021 8:10 pm   
 
Once one begins writing one's own code it can become a bit obsessive. Where a thing can be improved or streamlined there is a kind of compulsion to act.
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