local worldWidth, worldHeight, x, y, z, width, height, avoidance, name, policy, areaType
local specialAreaRect = {}
local innerRect = {}
local function gettilepos(x, y, z)
local tile = getobjectarea(x, y, z)
if tile == nil then
local xDiff, yDiff = x - $posx, y - $posy
if math.abs($posx - x) <= 7 then
tile = getobjectarea(x, $posy, $posz)
xDiff = 0
elseif math.abs($posy - y) <= 5 then
tile = getobjectarea($posx, y, $posz)
yDiff = 0
else
tile = getobjectarea($posx, $posy, $posz)
end
-- Some strange stuff happens when you go from 0 to -1, so I'm
-- adding this as a precaution.
if tile ~= nil then
local width, height = $worldwin.width, $worldwin.height
local function getAreaRect(x, y, w, h)
local ret = {x = 0, y = 0, w = 0, h = 0}
local topLeftTilePos = gettilepos(x, y, $posz)
local botRightTilePos = gettilepos(x + w - 1, y + h - 1, $posz)
if topLeftTilePos and botRightTilePos then
ret.x = math.max(topLeftTilePos.left, 0)
ret.y = math.max(topLeftTilePos.top, 0)
ret.w = math.min(botRightTilePos.right, worldWidth) - ret.x
ret.h = math.min(botRightTilePos.bottom, worldHeight) - ret.y
end
return ret
end
local function drawInnerRect(areaType, x, y, width, height)
innerRect = {w = 0, h = 0}
if areaType == 'Square (Border Only)' then
innerRect = getAreaRect(x + 1, y + 1, width - 2, height - 2)
elseif areaType == 'Square (Double Border)' then
innerRect = getAreaRect(x + 2, y + 2, width - 4, height - 4)
end
if innerRect.w > 0 and innerRect.h > 0 then
setfillstyle('color', 0xFF000000)
drawroundrect(innerRect.x, innerRect.y, innerRect.w, innerRect.h, 10, 10)
end
end
foreach settingsentry e 'Cavebot/SpecialAreas' do
x, y, z = getsetting(e, 'Coordinates'):match('.-(%d+).-(%d+).-(%d+)')
x, y, z = tonumber(x), tonumber(y), tonumber(z)
if z == $posz then
width, height = getsetting(e, 'Size'):match('(%d+).-(%d+)')
width, height = tonumber(width), tonumber(height)
specialAreaRect = getAreaRect(x, y, width, height)
if specialAreaRect.w > 0 and specialAreaRect.h > 0 then
avoidance = tonumber(getsetting(e, 'Avoidance'))
areaType = getsetting(e, 'Type')
name = getsetting(e, 'Name')
policy = getsetting(e, 'Policy'):gsub('[^A-Z]', '')
if specialAreaRect.w > 10 then
drawtext(
string.fit(name, specialAreaRect.w - 10, '...', true),
specialAreaRect.x + 5,
specialAreaRect.y + 3
)
drawtext(
string.fit(policy, specialAreaRect.w - 10, '...', true),
specialAreaRect.x + 5,
specialAreaRect.y + 15
)
end
end
end
end
if contextmenuinfo() == nil then
if draggedSP then
set(draggedSP, 'Coordinates', string.format('x:%i, y:%i, z:%i', $cursorinfo.x, $cursorinfo.y, $cursorinfo.z))
elseif resizedSP then
local x, y = get(resizedSP, 'Coordinates'):match(REGEX_COORDS)
x, y = tonumber(x), tonumber(y)
set(resizedSP, 'Size', string.format('%i x %i', math.max(1, 1 + ($cursorinfo.x - x)) , math.max(1, 1 + ($cursorinfo.y - y))))
end
end
Just awsome :P Love your work here guys ! This bot is growing so fast :]
12-18-2013, 11:41 PM
RoxZin xD
I fucking love you so fucking much <3
12-18-2013, 11:48 PM
Lure Avros
Time for awesome scripts!!
12-19-2013, 02:12 AM
joraanpe
yeahhhhh!!!!! <3
12-19-2013, 04:57 AM
Monster
It has begun.
12-19-2013, 05:19 AM
Stoned
thank you! gonna try it out now!
12-19-2013, 05:34 AM
SuNe
Time to get some shit done! Awesome mate
12-19-2013, 08:00 AM
Frox
Seriously, I love you!
12-19-2013, 03:53 PM
Dehan
Things are getting interesting ;)
Thank you raph
12-19-2013, 06:32 PM
hiransm
oh man, nice job <3
12-19-2013, 11:04 PM
Raphael
Script Updated!
Please download the new version for WindBot 1.1.3 compatibility!
12-19-2013, 11:57 PM
Amel
Hello im new anyone can make tutorial ?
12-20-2013, 02:16 PM
joraanpe
Hey raph, ive already updated to wb1.1.3 and also updated your library but still cant get any visual diference on the hud, specially on the side of the transparency. Any idea?
12-20-2013, 02:53 PM
Raphael
Quote:
Originally Posted by joraanpe
Hey raph, ive already updated to wb1.1.3 and also updated your library but still cant get any visual diference on the hud, specially on the side of the transparency. Any idea?
What do you mean, exactly? Can you post a picture?
12-20-2013, 03:27 PM
joraanpe
Its like the latest version i guess, without transparency, here it is:
nope im using w7, with visual theme as "basic", eventhough tested using aero as well and didnt change the hud looking
12-20-2013, 05:03 PM
Raphael
Quote:
Originally Posted by joraanpe
nope im using w7, with visual theme as "basic", eventhough tested using aero as well and didnt change the hud looking
Tried changing to Aero, restarting the bot and checking again? Do other HUDs with transparency work for you?
12-20-2013, 05:40 PM
joraanpe
Quote:
Originally Posted by Raphael
Tried changing to Aero, restarting the bot and checking again? Do other HUDs with transparency work for you?
Restarted pc and works properly now, thanks mate
12-20-2013, 07:39 PM
Raphael
Was it just a matter of restarting the PC or did you have to enable Aero as well?
12-21-2013, 01:20 AM
joraanpe
Quote:
Originally Posted by Raphael
Was it just a matter of restarting the PC or did you have to enable Aero as well?
ofcourse, enabled aero back again
12-29-2013, 10:11 AM
Dworak
After Update Bot, its showing areas from The >> Side and to the >>>> not from <<<< to >>>> Something is bugged after Up
Regards
12-29-2013, 02:00 PM
mistgun
Yes as Dvorak said, we have this problem :P
01-01-2014, 03:41 PM
Raphael
Quote:
Originally Posted by Dworak
After Update Bot, its showing areas from The >> Side and to the >>>> not from <<<< to >>>> Something is bugged after Up
Regards
Quote:
Originally Posted by mistgun
Yes as Dvorak said, we have this problem :P
Wat? I couldn't understand it. If you can, please post an image.
01-01-2014, 03:45 PM
mistgun
Now we dont have these problems because Lucas fixed this bugs with getobjectarea(x, y, z).
Now its working good =]
01-01-2014, 03:47 PM
Dworak
yes its fixed in 1.2.2 ;-)
01-01-2014, 07:34 PM
Raphael
Cool then.
01-13-2014, 11:21 AM
K4r4biN
Ey, could you edit your code to show other colors for specific areas? Like Lucas did to show waypoints?
01-13-2014, 12:27 PM
Leonardo
Quote:
Originally Posted by K4r4biN
Ey, could you edit your code to show other colors for specific areas? Like Lucas did to show waypoints?
Signed, and btw, both HUD's were made by Raphael.
Also possibility to move/edit areas by drag drop, could be useful.
01-13-2014, 12:42 PM
Raphael
Quote:
Originally Posted by K4r4biN
Ey, could you edit your code to show other colors for specific areas? Like Lucas did to show waypoints?
What criteria would be used though?
01-13-2014, 02:05 PM
K4r4biN
Quote:
Originally Posted by Raphael
What criteria would be used though?
Well, so it shows different color for areas considered by none, targeting, cavebot and cavebot&targeting. It would be more useful to see other than just red color for everthing.
Example:
White = None
Red = Cavebot
Blue = Targeting
Purple = Cavebot&Targeting
And I love idea with moving area HUDs to change coordinates xD
Well, I tried to edit this code myself, but didn't work, so Idk how to change it xD
01-13-2014, 07:12 PM
Raphael
Quote:
Originally Posted by K4r4biN
Well, so it shows different color for areas considered by none, targeting, cavebot and cavebot&targeting. It would be more useful to see other than just red color for everthing.
Example:
White = None
Red = Cavebot
Blue = Targeting
Purple = Cavebot&Targeting
And I love idea with moving area HUDs to change coordinates xD
Well, I tried to edit this code myself, but didn't work, so Idk how to change it xD
Problem is finding colors for it, because it was already troublesome to find the 10 colors for the Waypoints HUD.
01-13-2014, 07:22 PM
Leonardo
Quote:
Originally Posted by Raphael
Problem is finding colors for it, because it was already troublesome to find the 10 colors for the Waypoints HUD.
Ok, it seems you misunderstood me.
Finding the colors isn't a problem, finding colors that are easy to tell the difference one from another is. Specially 14 colors.