Thankx a lot Nick, i made it work with your suggestions!
Now this is what i made with it, a graphical status display version 0.1.
It shows my mental and physical in the bars you desribed in another topic. Just have to post my creation here!
Pleae be aware that this is my first vernture into the world of coding and it is very probable that it can be done a lot simpler.
CODE:
sub DoPhysical (name, line, wildcards)
dim amount_used
dim amount_unused
dim max_amount
dim hp_me1
dim hp
max_amount = 40
amount_used = len (wildcards(2))
amount_unused = len (wildcards(3))
hp_me1 = 100 * ( amount_used / max_amount )
' world.note wildcards (1) & " : " & CStr (amount_used) & " units used"
' world.note wildcards (1) & " : " & CStr (hp_me1) & "%"
world.SetVariable "hp_me" , hp_me1
world.InfoClear
world.InfoFont "Arial", 12, 1 ' 12 point Arial *bold*
DoGaugehp " HP: ", world.getvariable ("hp_me"), "green", "red"
DoGaugemp " MP: ", world.getvariable ("mp_me"), "blue" , "purple"
world.note hp_me1
end sub
sub DoMental (name, line, wildcards)
dim amount_used
dim amount_unused
dim max_amount
dim mp_me1
dim mp
max_amount = 40
amount_used = len (wildcards(2))
amount_unused = len (wildcards(3))
mp_me1 = 100 * ( amount_used / max_amount )
' world.note wildcards (1) & " : " & CStr (amount_used) & " units used"
' world.note wildcards (1) & " : " & CStr (mp_me1) & "%"
world.SetVariable "mp_me" , mp_me1
end sub
sub Doreset (name, line, wildcards)
world.SetVariable "hp_me" , 0
world.SetVariable "mp_me" , 0
end sub
sub DoGaugehp (sPrompt, iCurrent, sGoodColour, sBadColour)
dim pc, count, hp_me1
'
' Do prompt in black Arial
'
world.InfoColour "black"
world.InfoFont "Arial", 10, 0
world.Info sPrompt
'
' Use Webdings for gauge (black square)
'
world.InfoFont "Webdings", 10, 0
hp_me1 = Cint (world.getvariable("hp_me"))
pc = CInt ((hp_me1) / 4)
'
' Below 40% warn by using different colour
'
if hp_me1 < 40 then
world.InfoColour sBadColour
else
world.InfoColour sGoodColour
end if
'
' Draw active part of gauge
'
for count = 1 to pc
world.Info "g"
next
'
' Draw rest of gauge in grey (ie. unfilled bit)
'
world.InfoColour "black"
while count < 25
count = count + 1
world.Info "g"
wend
end sub
sub DoGaugemp (sPrompt, iCurrent, sGoodColour, sBadColour)
dim count, mp_me1, pc2
'
' Do prompt in black Arial
'
world.InfoColour "black"
world.InfoFont "Arial", 10, 0
world.Info sPrompt
'
' Use Webdings for gauge (black square)
'
world.InfoFont "Webdings", 10, 0
mp_me1 = Cint (world.getvariable("mp_me"))
pc2 = Cint ((mp_me1) / 4)
'
' Below 40% warn by using different colour
'
if mp_me1 < 40 then
world.InfoColour sBadColour
else
world.InfoColour sGoodColour
end if
'
' Draw active part of gauge
'
for count = 1 to pc2
world.Info "g"
next
'
' Draw rest of gauge in grey (ie. unfilled bit)
'
world.InfoColour "black"
while count < 25
count = count + 1
world.Info "g"
wend
end sub
Well if you have any remarks on what i can improve, im always welcoming criticism.
Other question:
Could someone point me in the right direction of how to make a database which has to be filled with triggers ( i want to be able to list what monsters i killed, when, over different periods, what equipment they had and what how much money i made on them).
Just point me in the right direction, maybe a howto on creating databases with mushqlient?
( i dont have experience with Acces or other database programs so please dont point me to a knowledgebase or something..)
Tonight i will rewrite the above script so i can also see my partymembers hp and mana in thesame bar as mine.
Zebra worships Nick for creating MUSHClient...i love it!
|