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

Need some help with your MUD client? Forgot your password? Get help here.
Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
Post Reply
User avatar
nils
Titan
Posts: 458
Joined: 22 Jul 2016 17:13

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

Post by nils » 14 Jun 2017 13:42

Area in question: The entrance (A) and four rooms (1, 2, 3 and 4) containing three guards each.
square.JPG
square.JPG (8.56 KiB) Viewed 3480 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.

Explanation:
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!
Last edited by nils on 14 Jun 2017 14:30, edited 1 time in total.
Nil Mortifi Sine Lucre

User avatar
Tarax the Terrible
Myth
Posts: 1331
Joined: 09 Mar 2010 20:33
Location: UK

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

Post by Tarax the Terrible » 14 Jun 2017 14:15

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

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

"kobold dies" koboldInRoom -1

if koboldInRoom = 0, move
http://genesisquests.pbworks.com/
Join up and help each other with Quests :)

User avatar
nils
Titan
Posts: 458
Joined: 22 Jul 2016 17:13

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

Post by nils » 14 Jun 2017 14:22

Not sure if you get the concept of basic. What you're suggesting certainly isn't.
Nil Mortifi Sine Lucre

Post Reply
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/