i was wondering if someone could help me make a script for mushclient for the circle-mud necromium. basically, i dont know how to script at all and need something to help me count the souls i have.. (im a Necromancer).. in necromium, each kill i get a soul, and theres something called a 'soul jar' to keep track, but they are very expensive, and i heard one could script a 'soulcounter'. err, so, i have the messages and what they do, i just need someone to put it all together. help? if anyone would like to, please reply to this (or e-mail asspants69@hotmail.com). thanks.
Gray, faithful mushclient user
Post the message that you get when you kill a soul and we'll see what we can do with it. :)
ok, this is the information as was given to me by someone who supposedly know how this works: (=P)
[remove paranthesis of course]
{With a wicked grin, you absorb the soul} {increment your soul counter by 1}
{You scream in triumph as the souls of your enemies are released from your body into a sphere of deathly energy around you.} { -5 from soul counter}
{You begin chanting quietly, and your fingers glow with deathly energy.} {set it back to zero, that's the first death touch message}
{As the last drop of life is released from your body, a tunneling cyclone of energy erupts from your body spilling forth your captured souls.} {reset to zero again, that's what it says when you die}
thanks.
You need three script routines, to add one, subtract five, and set to zero. If JScript they would look like this:
function OneMoreSoul (thename, theoutput, wildcardsVB)
{
var iSouls;
// get current number
iSouls = world.GetVariable ("souls");
// if no such variable, make zero
if (iSouls == null)
iSouls = 0;
iSouls++;
world.SetVariable ("souls", iSouls);
}
function FiveLessSouls (thename, theoutput, wildcardsVB)
{
var iSouls;
// get current number
iSouls = world.GetVariable ("souls");
// if no such variable, make zero
if (iSouls == null)
iSouls = 0;
iSouls -= 5;
if (iSouls < 0)
iSouls = 0;
world.SetVariable ("souls", iSouls);
}
function NoSouls (thename, theoutput, wildcardsVB)
{
world.SetVariable ("souls", 0);
}
Now you just need to set up some triggers, to call the appropriate scripts, eg.
Trigger: With a wicked grin, you absorb the soul
Label: OneMoreSoul
Script: OneMoreSoul
Trigger: You scream in triumph as the souls of your enemies are released from your body into a sphere of deathly energy around you.
Label: FiveLessSouls
Script: FiveLessSouls
Trigger: You begin chanting quietly, and your fingers glow with deathly energy.
Label: NoSouls_1
Script: NoSouls
Trigger: As the last drop of life is released from your body, a tunneling cyclone of energy erupts from your body spilling forth your captured souls.
Label: NoSouls_2
Script: NoSouls
ok.. i copied all three of those functions (whatever theyre referred to as) in a notepad, saved as soulcounter.js.. loaded it in mushclient, added the triggers just as you said.. and its all there. what do i do now to get it to tell me how many souls i have (or dont have)? sorry if this is an obvious answer, im totally new to scripting.
thanks
~Gray
You could just type in:
/world.note (world.getvariable ("souls"));
To save typing that all the time you could make an alias:
Alias: souls
Send: think souls = @souls
Expand variables: checked
Then just type "souls" it it will "think" "souls = 5" or whatever.
A third approach is to add the following line to each of the script functions (at the end, but before the final "}"):
world.setstatus ("souls = " + world.getvariable ("souls"));
What this will do is constantly update the status line (near the bottom of the window) with the number of souls, so you can just glance at that without having to type anything.
um, i tried all three methods and it didnt work =( maybe i did something wrong (didnt choose an option, click a checkbox) or set up the triggers wrong. actually, my mushclient has never really handled triggers correctly. i cant figure it out. maybe thats the reason for all the problems. (when i type "souls" it always returns '0', even after ive just killed a few mobs/monsters) sorry if this is a bother to you, its very frustrating for me not knowing how to do anything nor keep track of my souls. thanks for trying to help.
~Gray
Set the triggers to colour the lines so you can see if the trigger is matching or not. If not, you might have an extra space or something in it. The trigger must match exactly what arrives.
If the trigger is matching make sure you have scripting enabled, and the "script file" as the file with the script functions in it.
Then check under the world configuration "variables" window, to see if the "souls" variable has a correct value in it.