SIMPLE CUSTOM INTERFACE
This image is hosted on a possibly dangerous website (http://vpx.pl/i/2013/12/27/Interface_Hud.png). Please consider reuploading it on Imgur.com.
About:
- Simple Custom Interface - additional HUD with HP, MP, EXP and LVL - someone here want something like that.
- Put image to: ./windbot/images/
- You can move HUD with middle mouse button. Thanks to @sirmate.
Libraries:
- WindBot 1.1.2
- Raphael's Library 0.1.2
- Lucas Terra's Library 12.7
Version and Changelog:
- v1.0 - 28/12/2013 - stable version.
Code:
-- MADE by Turc @ --
init start
filterinput(false, true, false, false)
local hp, maxhp, hpcp, mp, maxmp, mppc, level, nick = $hp, $maxhp, $hppc, $mp, $maxmp, $mppc, $level ,$name
local Moving, Temp, Moved = false, {0, 0}, {0, 0}
function inputevents(e)
if (e.type == IEVENT_MMOUSEDOWN) then
Moving, Temp = true, {$cursor.x - Moved[1], $cursor.y - Moved[2]}
end
if (e.type == IEVENT_MMOUSEUP) then
Moving = false
end
end
local blueGradient = {0.0, color(36, 68, 105, 20), 0.23, color(39, 73, 114, 20), 0.76, color(21, 39, 60, 20)}
local blackGradient = {0.0, color(75, 75, 75, 20), 0.23, color(45, 45, 45, 20), 0.76, color(19, 19, 19, 20)}
local redGradient = {1.0, color(92, 6, 6), 0.23, color(139, 37, 13), 1.0, color(92, 6, 6)}
local greenGradient = { 1.0, color(36, 52, 6), 0.23, color(67, 99, 13), 1.0, color(36, 52, 6)}
init end
setcompositionmode(CompositionMode_SourceOver)
if (Moving) then
auto(10)
Moved = {$cursor.x - Temp[1], $cursor.y - Temp[2]}
end
setposition($clientwin.left + 2 + Moved[1], $worldwin.top - 28 + Moved[2])
setfillstyle('gradient', 'linear', 2, 0, 0, 0, 14)
-- background bar
addgradcolors(table.unpack(blackGradient))
header = addshape('roundrect', ($screenwin.width / 6) + 58, ($screenwin.height / 2) + 181, 600, 30, 2, 2)
-- hp bar
addgradcolors(table.unpack(redGradient))
header = addshape('roundrect', ($screenwin.width / 6) + 58, ($screenwin.height / 2) + 193, $hppc * 2.91, 13, 2, 2)
-- mp bar
addgradcolors(table.unpack(blueGradient))
header = addshape('roundrect', ($screenwin.width / 6) + 362, ($screenwin.height / 2) + 193, $mppc * 2.89, 13, 2, 2)
-- exp bar
setfillstyle('gradient', 'linear', 2, 0, 0, 0, 6)
addgradcolors(table.unpack(greenGradient))
header = addshape('roundrect', ($screenwin.width / 6) + 51.5, ($screenwin.height / 2) + 181, $levelpc * 6.10, 5, 2, 2)
-- main alyout
setbordercolor(-1)
setfillstyle('image', 'HudBar.png')
drawshape('rect', ($screenwin.width / 6) + 20, ($screenwin.height / 2) + 161, 700, 77)
-- text name
setfontstyle('Tahoma', 8, 40, 0xFFFFFF, 1, color(0, 0, 0, 20))
drawtext($name,($screenwin.width / 6) + 106, ($screenwin.height / 2) + 166 )
-- text hp
setfontstyle('Tahoma', 9, 70, 0xFFFFFF, 1, color(0, 0, 0, 20))
drawtext($hp ..'/' ..$maxhp ..' (' ..$hppc ..'%)',($screenwin.width / 6) + 160, ($screenwin.height / 2) + 192 )
-- text mp
setfontstyle('Tahoma', 9, 70, 0xFFFFFF, 1, color(0, 0, 0, 20))
drawtext($mp ..'/' ..$maxmp ..' (' ..$mppc ..'%)',($screenwin.width / 6) + 466, ($screenwin.height / 2) + 192 )
-- text exp
setfontstyle('Tahoma', 7, 60, 0xFFFFFF, 1, color(0, 0, 0, 20))
drawtext($exp ..'/' ..expatlvl($level) ..' (' ..math.floor(($exp - expatlvl($level)) * 100 / (expatlvl($level + 1) - expatlvl($level))) ..'%)',($screenwin.width / 6) + 306, ($screenwin.height / 2) + 179 )
-- text level
setfontstyle('Tahoma', 6, 61, 0xFFFFFF, 1, color(0, 0, 0, 20))
if $level > 100 then
drawtext($level,($screenwin.width / 6) + 51, ($screenwin.height / 2) + 206 )
else
drawtext($level,($screenwin.width / 6) + 54, ($screenwin.height / 2) + 206 )
end