Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Miniwindows ➜ MiniWindows [House of Ghouls]

MiniWindows [House of Ghouls]

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1  2  3 

Posted by Scarn   (47 posts)  Bio
Date Reply #30 on Tue 02 Sep 2008 10:33 AM (UTC)
Message

local hp_perc = math.ceil((var.HP_CUR/var.HP_MAX) * 100)

status = left = 3


local hp_right = left + math.ceil(barwidth*(hp_perc*.01))


status = Window.gradient3( 6, hp_right, top, left+barwidth, bottom,ColourNameToRGB("midnightblue"),ColourNameToRGB("indigo"), ColourNameToRGB("mediumorchid"))


status = Window.gradient3( 6, left, top, hp_right, bottom,ColourNameToRGB("maroon"),ColourNameToRGB("red"), ColourNameToRGB("lightcoral"))


status = WindowRectOp (6, 5, left - 1, top - 1, left + barwidth + 1, bottom + 1, 5, 15)


status = Window.textshadow( 6, "f","HP: " .. var.HP_CUR .. "/" .. var.HP_MAX .. ("..hp_perc.."%)", left + 4, top, left+barwidth, bottom, ColourNameToRGB("white"), ColourNameToRGB("black"))

end



When I fire this the following error pops up, can't see its source though...


Error number: -2146827282
Event: Execution of line 19 column 43
Description: Expected ')'

Line in error:

status = Window.textshadow( 6, "f","HP: " .. var.HP_CUR .. "/" .. var.HP_MAX .. ("..hp_perc.."%)", left + 4, top, left+barwidth, bottom, ColourNameToRGB("white"), ColourNameToRGB("black"))
Called by: Immediate execution
Top

Posted by Darwin   USA  (125 posts)  Bio
Date Reply #31 on Tue 02 Sep 2008 07:00 PM (UTC)

Amended on Tue 02 Sep 2008 07:04 PM (UTC) by Darwin

Message
Window.gradient3 doesn't return any values so there's no need for the "status = " part for those lines.

It seems you're missing a double-quote in your line.

You have:
Quote:
status = Window.textshadow( 6, "f",
"HP: " .. var.HP_CUR .. "/" .. var.HP_MAX .. ("..hp_perc.."%)", 
left + 4, top, left+barwidth, bottom, 
ColourNameToRGB("white"), ColourNameToRGB("black"))


Which should be:
status = Window.textshadow( 6, "f",
"HP: " .. var.HP_CUR .. "/" .. var.HP_MAX .. "("..hp_perc.."%)", 
left + 4, top, left+barwidth, bottom, 
ColourNameToRGB("white"), ColourNameToRGB("black"))


You get the error because you have a left parenthesis that is not enclosed in quotes so it is expecting a right parenthesis to accompany it.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


92,670 views.

This is page 3, subject is 3 pages long:  [Previous page]  1  2  3 

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.