Code:
Name: 'Improved/Final Prompt', VNum: [13440], RNum: [ 1724]
Trigger Intended Assignment: Mobiles
Trigger Type: Command , Numeric Arg: 100, Arg list: *
Commands:
if %self% != %actor%
halt
return 0
end
if %cmd% == help
set prompt 'prompt
if %prompt.contains('%arg%)% && %arg.contains(pr)%
%send% %self% Syntax:
%send% %self% fprompt <prompt>
%send% %self% fprompt default
%send% %self% prompt default
%send% %self% prompt <prompt>
%send% %self% tcolor
%send% %self% @n
%send% %self% @RImmortal ONLY!:@n
%send% %self% @n
%send% %self% Prompt default will set your prompt to a default setting, with only the
%send% %self% bare minimum of information posted in your prompt.
%send% %self% @n
%send% %self% Tcolor stands for "toggle color". This will automate percentile coloring
%send% %self% for life/mana/move/ and opponent's hp in your fprompt.
%send% %self% @n
%send% %self% Typing prompt with anything following it other than default will alter your
%send% %self% prompt to be whatever follows it. ie. To have <current>/<max> as your
%send% %self% prompt you would type: 'prompt #H/#MH'.
%send% %self% @n
%send% %self% Valid Fields for the prompt are as follows:
%send% %self% @n
%send% %self% Prompt Commands are:
%send% %self% #H - current hp
%send% %self% #MH - max hp
%send% %self% #MN - current mana
%send% %self% #MM - max mana
%send% %self% #V - current move
%send% %self% #MV - max move
%send% %self% #G - current gold
%send% %self% #EXP - current experience
%send% %self% #S - room sector
%send% %self% #EXIT - displays exits in current room
%send% %self% @n
%send% %self% #N - GOD ONLY displays room vnum
%send% %self% @n
%send% %self% When using the scripted prompt we suggest that you turn off the hard-coded prompt,
%send% %self% this can be done by typing 'display' off.
else
return 0
end
elseif %cmd% == prompt || %cmd% == fprompt
if %cmd% == prompt%
set revcmd fprompt
else
set revcmd prompt
end
if %arg% == default
rdelete s%cmd% %self.id%
%send% %self% %cmd% set to default. Remember that this does not delete the other
%send% %self% your %revcmd%.
else
if %arg.contains(actor)% || %arg.contains(self)%
%send% %actor% Your prompt may not contain the text 'self' or 'actor'.
halt
end
set s%cmd% %arg%
remote s%cmd% %self.id%
%send% %self% %cmd% has been set.
end
elseif %cmd% == tcolor
if %self.varexists(tcolor)%
rdelete tcolor %self.id%
%send% %self% Tcolor is now off.
else
set tcolor 1
remote tcolor %self.id%
%send% %self% Tcolor is now on!
end
else
return 0
wait 1
if %self.fighting%
set var f
end
if %self.varexists(s%var%prompt)%
eval p %%self.s%var%prompt%%
else
set p #H/#MH >
end
set n %p.strlen%
set i 1
while %i% <= %n%
set c %p.charat(%i%)%
if !%c%
set out @n @n
elseif %c% == #
set in_var 1
unset var
while %in_var%
eval i %i% + 1
set c %p.charat(%i%)%
eval 2 %2% + 1
switch %c%
case #
set out %out%#
set in_var 0
break
case H
set var %var%H
break
case P
set var %var%P
break
case M
set var %var%M
break
case V
set var %var%V
break
case G
set var %var%G
break
case E
set var %var%E
break
case X
set var %var%X
break
case I
set var %var%I
break
case T
set var %var%T
break
case S
set var %var%S
break
case N
set var %var%N
break
case O
set var %var%O
break
done
switch %var%
case H
set out %self.hitp%
set in_var 0
set max %self.maxhitp%
break
case MH
set out %self.maxhitp%
set in_var 0
break
case MN
set out %self.mana%
set max %self.maxmana%
set in_var 0
break
case MM
set out %self.maxmana%
set in_var 0
break
case V
set out %self.move%
set max %self.maxmove%
set in_var 0
break
case MV
set out %self.maxmove%
set in_var 0
break
case G
set out %self.gold%
set in_var 0
break
case EXP
set out %self.exp%
set in_var 0
break
case S
set out %self.room.sector%
set in_var 0
break
case EXIT
set exits Exits:
set 1 north
set 2 east
set 3 south
set 4 west
set 5 up
set 6 down
set d 1
while %d% <7
if %actor.level% > 30
set out %self.room.vnum%
else
set out %c%
end
set in_var 0
break
case OH
if %self.fighting%
eval oh ((%self.fighting.hitp% / %self.fighting.maxhitp%) * 100)
set out %oh%
else
set out %c%
end
set in_var 0
break
done
if %self.varexists(tcolor)%
if %max% || %out% == %oh%
if %out% == %oh%
set per %oh%
else
eval per ((%out% / %max%) * 100)
end
unset max
if %per% > 90
set col @W%out%@n
elseif %per% > 70
set col @G%out%@n
elseif %per% > 40
set col @Y%out%@n
elseif %per% > 10
set col @R%out%@n
else
set col @D%out%@n
end
set out %col%
end
end
done
else
set out %c%
end
set prmpt %prmpt%%out%
eval i %i% + 1
done
%send% %self% %prmpt%
end
257 lines.
for TBA.