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
Lilith383
Beginner


Joined: 10 Mar 2003
Posts: 17
Location: USA

PostPosted: Mon Mar 10, 2003 11:15 pm   

Scrambler Bot
 
Does anyone know how to write a scrambler bot in VB or Zscript just like the one that is made for aol chat rooms. I would like a similar program for zmud if possible. If this can't be done, what about hooking up the AUTOSCRAM http://www.geocities.com/SiliconValley/Network/2033/as.html program to zmud so that it's connected? Any ideas? Thanks.
Reply with quote
Lilith383
Beginner


Joined: 10 Mar 2003
Posts: 17
Location: USA

PostPosted: Mon Mar 10, 2003 11:16 pm   
 
Ack sorry, didn't mean to post the topic twice.
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Tue Mar 11, 2003 12:12 am   
 
#alias scram {
#var phrase {%-1}
#var sphrase ""
#loop 1,%len(@phrase) {
#var sphrase {%additem(%copy(@phrase,%i,1)), @sphrase}
}
#var phrase ""
#while (@sphrase) {
#var i %random(1, %numitems(@sphrase))
#var phrase %concat(@phrase, %item(@sphrase, @i))
#delnitem sphrase @i
}
chat @phrase
}

This will scramble a phrase you pass to it, then chat the scrambled phrase. If you want to do something with it, (use it in a tell, or save it for later), just change the last line.

scram this message will be scrambled and then chatted.


--------

moon.icebound.net:9000
Reply with quote
Lilith383
Beginner


Joined: 10 Mar 2003
Posts: 17
Location: USA

PostPosted: Tue Mar 11, 2003 12:20 am   
 
sweet, thanks.
Reply with quote
Lilith383
Beginner


Joined: 10 Mar 2003
Posts: 17
Location: USA

PostPosted: Tue Mar 11, 2003 12:27 am   
 
This didn't seem to work at all. any ideas of what went wrong?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Mar 11, 2003 12:46 am   
 
Just a small syntax error. Here is the offending line with the corrections made:
#VAR sphrase {%additem(%copy(@phrase, %i, 1), @sphrase)}

Looking at the link you provided, I think that what you want is to scramble every word separetly in the line instead of every character in the line. To do that, use this modified version fo Emit's script instead:
#ALIAS scram {#VARIABLE phrase %replace( "%-1", " ", "|");#VARIABLE sphrase "";#VARIABLE sphrase "";#LOOP 1,%numitems( @phrase) {#VARIABLE sphrase %additem( "", @sphrase);#VARIABLE i {%i};#LOOP 1,%len( %item( @phrase, @i)) {#VARIABLE sphrase %replaceitem( %additem( %copy( %item( @phrase, @i), %i, 1), %item( @sphrase, @i)), @i, @sphrase)}};#VARIABLE phrase "";#FORALL @sphrase {#VARIABLE word {%i};#FORALL @word {#VARIABLE i %random( 1, %numitems( @word));#VARIABLE phrase %concat( @phrase, %item( @word, @i));#DELNITEM word @i};#VARIABLE phrase %concat( @phrase, " ")};chat %trim( @phrase)}

Kjata
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Tue Mar 11, 2003 2:20 am   
 
Whoops! nice catch Kjata.

--------

moon.icebound.net:9000
Reply with quote
Lilith383
Beginner


Joined: 10 Mar 2003
Posts: 17
Location: USA

PostPosted: Tue Mar 11, 2003 2:48 am   
 
ok, how exactly does this work? I changed chat to say for testing purposes. To scramble a word would I type "scram hello" and get something like "leohl" if that's it, it didn't work either. Also can you script it to where it makes a "Scrambot Folder" so it is all in one place and not mixed with all my outside triggers? Thanks for the help.
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Tue Mar 11, 2003 3:08 am   
 
um, it worked ok for me. Be sure to use Kjata's and not the buggy one i gave you earlier :P. Also, since its just one alias, you can make a folder for it and drag it there in the settings editor with relative ease.

--------

moon.icebound.net:9000
Reply with quote
Lilith383
Beginner


Joined: 10 Mar 2003
Posts: 17
Location: USA

PostPosted: Tue Mar 11, 2003 3:36 am   
 
Still unable to get it to work. I've tried to install it three ways, through the command input line, through file/import, and manually adding it under alias. When I do this it makes a folder called "," and makes 2 variables, @word and @sphrase and the alias scram. Not sure what I'm doing wrong and I'm not exactly sure how to test it. As far as I've gotten was typing scram hello and it just repeated the word Hello with spaces like this: H E L L O

Got any ideas?
Reply with quote
Lilith383
Beginner


Joined: 10 Mar 2003
Posts: 17
Location: USA

PostPosted: Tue Mar 11, 2003 4:19 am   
 
ohh ok, I figured out what I was doing. You made the script so that it would affect more than one word. "Hello, how are you?" scrambles well. How would I also scramble just one word by itself without it spacing out like that? EG. H E L L O
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Mar 11, 2003 4:27 am   
 
You're right. Ok to fix that, add this:
#VARIABLE sphrase {%additem("", @sphrase)}

right after this line:
#VARIABLE phrase ""

Oh, and I just noticed there are two of these in a row:
#VARIABLE sphrase ""

You may remove one of them.

Kjata
Reply with quote
Lilith383
Beginner


Joined: 10 Mar 2003
Posts: 17
Location: USA

PostPosted: Tue Mar 11, 2003 4:38 am   
 
Perfect, it works great. Thank you all for your 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