Page 1 of 1

A -very- basic guide to old school scripting using CMUD

Posted: 14 Jun 2017 13:42
by nils
Area in question: The entrance (A) and four rooms (1, 2, 3 and 4) containing three guards each.
square.JPG (8.56 KiB) Viewed 1962 times
Make a simple text-file using notepad, let's call it "square.txt". For this instruction you
plan to start in room A, move east, follow the numbers and end up back where you started.

The file should look like this when you're done:

e;kill guard
n;kill guard
e;kill guard
s;kill guard
w;w;#close 1

Move or place the file directly into your cmud-directory.

Alias for starting script: start_kill_square
Command: #file 1 square.txt;#read 1

Triggers you will need:

String: died.
Command: kill guard

String: You find no such living creature.
Command: #read 1

Execution: Stand in room A and write: start_kill_square

Watch as the beauty of automation unfolds.

As your alias does #read 1 square.txt it will load the file into cmud's memory. #read 1 will
execute the first line in your file, in this case "e;kill guard", meaning it will move east
and kill guard. As your first guard dies, your trigger on "died." will make you attack the
next guard and so on untill there are no more guards left. The game will then echo "You find
no such living creature." and your trigger now makes cmud read the next line in the file, in
this case "n;kill guard". The rest is self-explanatory. As the last line is read, the command
#close 1 will now unload square.txt from cmud's memory.

This is what you could call the skeleton of a script, and is basically all there is to it.

A tip: Pay attention! This type of scripting will not take into consideration that someone
else may be fighting in a room, and will simply attack the guard regardless. This is considered
extremely rude and people have been killed over less. A simple #read 1 if you see someone fighting
will skip the room and proceed to the next. (hint: triggers are your friend)

Don't expect anyone to send their script, they may have put time and efforts into making it.

Make your own!

Re: A -very- basic guide to old school scripting using CMUD

Posted: 14 Jun 2017 14:15
by Tarax the Terrible
Come on Nils get with the mudlet revolution... :P

Good show tho, there are lots of players who like the web client but want a bit more power.

Just one thing I'd say..
Don't use this basic try and kill next then move script if you are in the red fang guild.
As your eyes glow when u can't find something to attack.
Which this would do every room.

Code: Select all

String: You find no such living creature:
Command: #read 1
At which point many friendly players will attack you to see if you are botting unattended.

Alternative to that is to have the script more advanced that it recognizes how many mobs are in it when you entered and counts them down.
eg in general terms not any client syntax
a trigger x no. of watching orcs, set variable mobsInRoom = x
trigger mob died, mobsInRoom -1

or fire health all command and count them
A lot easier for random description enemies like kobolds

set koboldInRoom 0
activate koboldCounter trigger
health all
"kobold is feeling" = koboldInRoom +1
> = deactivate counter trigger

"kobold dies" koboldInRoom -1

if koboldInRoom = 0, move

Re: A -very- basic guide to old school scripting using CMUD

Posted: 14 Jun 2017 14:22
by nils
Not sure if you get the concept of basic. What you're suggesting certainly isn't.