View unanswered posts | View active topics It is currently 23 Jul 2018 09:48

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.



Reply to topic  [ 3 posts ] 
A -very- basic guide to old school scripting using CMUD 
Author Message
Great Adventurer
User avatar

Joined: 22 Jul 2016 17:13
Posts: 185
Area in question: The entrance (A) and four rooms (1, 2, 3 and 4) containing three guards each.

Attachment:
square.JPG
square.JPG [ 8.56 KiB | Viewed 976 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.



14 Jun 2017 13:42
Profile
Myth
User avatar

Joined: 09 Mar 2010 20:33
Posts: 1331
Location: UK
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:
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 :)


14 Jun 2017 14:15
Profile
Great Adventurer
User avatar

Joined: 22 Jul 2016 17:13
Posts: 185
Not sure if you get the concept of basic. What you're suggesting certainly isn't.


14 Jun 2017 14:22
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.