The Players Corner Archive

Using Counters to Count Enemies Killed

Could anyone explain how counters are used? Like.. I'd like to make a script.. where everytime it matches the death of the critter (For instance I'm wanting one for wights) it'll add 1 to the counter.. then whenever I want I can type somethin and it displays how much is in the counter.. I'm usin this to keep track of how many kills I get for Voln.. if anyone could help, I'd appreciate it!

------------------
"The world was dark, people were dying.. there was one single candle, a ray of hope, a shining beacon of light.. then.. I blew it out" reg

counter add increases the counter by 1
counter subtract decreases the counter by 1

the counter variable is reset every time you run a script, however the save variable is kept in memory as long as you are running the wizard FE.

The basic script would be.

if_1 goto skip

counter set %s
skip:

match count <deathmessage>
matchwait

count:
counter add
save %c
goto skip

the check script would just be

echo You have released %s undead.

or if you want one complete script, just make another match string for something, like your character thinking, and have it branch off to the echo above and then go back.

the if_1 statement is for the first running of the script. Their will be nothing but gibberish in %s, so you dont want to set the counter to it.

So, the first time you run the counting script, just type .<scriptname> blah -- blah being anything you feel like typing. After that, to continue with your current count just run the script without blah.


reg

You could do that, but skip the save part and just change the echo to like 'you have released %c undead"

Sonic reg

Alright- I got the counter thing to work.. now I want to make a script that attacks as soon as the thing is knocked over by callwind.. and if it kills, (duh, add to counter) search it.. then start again.. It also recognizes when haste2 runs out, and gievs out a command that'll activate the script on my other char that'll cast haste2 on him.. this is what I have:

#Counting kills for wights


if_1 goto skip

counter set %s

skip:
match count You hear a sound like a weeping child as a white glow separates itself from the arch wight's body as it rises, disappearing into the heavens.
match howmanydead howmanydead
match swingagain 6 sec
match swing An arch wight is knocked over by the wind
match hasteme You notice that things have returned to their normal speed
matchwait

swing:
put amb wight neck
goto skip

swingagain:
pause .5
goto swing

hasteme:
put 'haste me
goto skip

count:
pause .5
put search wight
counter add
save %c
goto skip

howmanydead:
echo You have released %s undead.
goto skip

It doesn't quite work right for some reason.. for example: It says 'haste me' twice when it recognizes the haste spell has ran out.. it puts amb wight neck twice when it recognizes the wight get callwinded.. and it also pauses about 3-4seconds before it searches the wight (if I kill on the first hit) Can anyone fix this? Thanks!

------------------
"The world was dark, people were dying.. there was one single candle, a ray of hope, a shining beacon of light.. then.. I blew it out" reg

Well for the case of swinging and speaking twice, just put a 'WAITFOR You swing' and a 'WAITFOR You say' before the goto skip and problem solved there. I'm not really sure about the 3 second pause if you kill it on a first swing. You might want to put an ECHO before the pause .5 in the search loop and an ECHO afterwards to see where the strange pause is occuring. After you figure that out, it should be easier to diagnose.

Sonic reg