anyone need a tank whiner for MUD?

Posted by Guest1 on Tue 19 Feb 2002 07:28 AM — 1 posts, 9,002 views.

USA #0
here's one I got to work, if it's of use to you... I use it on SlothMUDIII (www.slothmud.org)
-there are several variables, alias's, a trigger and some vbs script to add...


-THE COMMANDS-

whineon - activates the whiner when you are in a group
whineoff - turns it off :)
(you need to manually enter your maximum hitpoints in the variables, although you could easily do an alias for this.)


-THE ALIAS'-

alias: whineon
   sends: (leave blank)
   script: whineon

alias: whineoff
   sends: (leave blank)
   script: whineoff


-THE VARIABLES-

name: maxhp 
   contents: (enter your maximum hitpoints manually)

name: oldhp
   contents: (script will update this. enter 0 to start)


-THE TRIGGERS-

(the trigger obviously depends on how your hitpoints are displayed in-game after every move/action you do)
trigger:<*hp *
   label: whinetrigger
   script: whiner


-THE SCRIPT (vbs)-

sub whineoff (thename, theoutput, thewildcards)
     World.EnableTrigger "whinetrigger", FALSE
     World.send "grouptell Tank Whiner is OFF"
end sub

sub whineon (thename, theoutput, thewildcards)
     World.EnableTrigger "whinetrigger", TRUE
     World.send "grouptell Tank Whiner is ON"
end sub

sub whiner (strTriggerName, trig_line, arrWildCards)
dim maxhpVar
dim oldhpVar 
dim hpVar
dim difference
     hpVar = arrWildCards (1)
     maxhpVar = World.GetVariable("maxhp")
     oldhpVar = World.GetVariable("oldhp")
     if hpVar < oldhpVar then
	difference = oldhpVar - hpVar
	World.send "grouptell " & hpVar & " / " & maxhpVar & " (-" & difference & ") *ACK* that HURT!"
	World.SetVariable "oldhp", hpVar
      end if
      if hpVar > oldhpVar then
	difference = hpVar - oldhpVar
	World.send "grouptell " & hpVar & " / " & maxhpVar & " (+" & difference & ") ahhh that's better."
	World.SetVariable "oldhp", hpVar
      end if      
end sub



that's it :)
hope someone gets some use out of it.
cheers