e o que eu precisava....rsrsrsr
local config = {
defaultName = "LatestScript",
waypointPrefixe = "wpt", -- param1 = type
targetingPrefixe = "tgt", -- param1 = name, param2 = targetingType, param3 = priorityMonster
looterPrefixe = "loot", -- param1 = id, param2 = backpack start from 0
axis = 3,
}
local waypointsType = {
{ name = "node", prefixe = "Node", tag = 0 },
{ name = "stand", prefixe = "Stand", tag = 1 },
{ name = "weak", prefixe = "WNode", tag = 5},
{ name = "rope", prefixe = "Rope", tag = 3},
{ name = "hole", prefixe = "Hole", tag = 4},
{ name = "ladder", prefixe = "Ladder", tag = 2},
{ name = "label", prefixe = "LABEL_NAME", tag = 255},
{ name = "script", prefixe = "SCRIPT", tag = 254},
}
local targetingType = {
{ name = "donothing", tag = 0 },
{ name = "follow", tag = 1 },
{ name = "diagonal", tag = 2 },
{ name = "sqm3diag", tag = 3 },
{ name = "sqm4diag", tag = 4 },
{ name = "sqm3dist", tag = 5 },
{ name = "sqm4dist", tag = 6 },
{ name = "dynamic", tag = 7 },
}
local targetingPrio = {
{ name = "ifstuck", tag = 0},
{ name = "verylow", tag = 1},
{ name = "low", tag = 2},
{ name = "medium", tag = 3},
{ name = "high", tag = 4},
{ name = "veryhigh", tag = 5},
}
-- [[ Do not change nothing below this line! ]] --
-- [[ Do not change nothing below this line! ]] --
-- [[ Do not change nothing below this line! ]] --
local stringWaypoints = ""
local stringTargeting = ""
local stringLooter = ""
local file
local tag = -2
local lastX = 0
local lastY = 0
local lastZ = 0
function split(msg)
local table = { }
local i = 0
for spl in string.gmatch(msg, "[^%s]+") do
table[i] = spl
i = i + 1
end
return table
end
function checkApproach(currPos, gotoPos)
local check = (currPos - gotoPos)
check = (check < 0 and (check * -1) or check)
if (check <= config.axis) then
return true
end
return false
end
function onSpeak(c, msg)
c:SendYellowMessage(Self.Name(), msg)
if (tag == -2) then
file = io.open("../Settings/" .. msg .. ".xbst", 'w')
if file then
defaultName = msg
stringWaypoints = "<panel name=\"Walker\">\n"
stringWaypoints = stringWaypoints .. "\t<control name=\"WaypointList\">\n"
stringTargeting = "<panel name=\"Targeting\">\n"
stringTargeting = stringTargeting .. "\t<control name=\"TargetingList\">\n"
stringLooter = "<panel name=\"Looter\">\n"
stringLooter = stringLooter .. "\t<control name=\"LootList\">\n"
tag = -1
c:SendOrangeMessage("Waypoint Maker", "Ok, start creating your waypoints right now.")
else
c:SendOrangeMessage("Waypoint Maker", "Ooops, looks like the file name has been used before. Change it to ensure that will be correctly saved!")
end
else
--start scripting
if (msg:lower() == "start") then
c:SendOrangeMessage("Waypoint Maker", "Auto waypointer started")
ModuleWaypointMaker:Start()
elseif (msg:lower() == "stop") then
if (ModuleWaypointMaker:IsActive()) then
c:SendOrangeMessage("Waypoint Maker", "Auto waypointer stopped")
ModuleWaypointMaker:Stop()
end
else
local m = split(msg)
if (m[0] == config.waypointPrefixe) then
--WPT ADD
for key,value in ipairs(waypointsType) do
if (value.name:lower() == m[1]:lower()) then
local x = Self.Position().x
local y = Self.Position().y
local z = Self.Position().z
if (#m >= 2) then
if (m[2]:lower() == "up") then
y = y - 1
elseif (m[2]:lower() == "down") then
y = y + 1
elseif (m[2]:lower() == "left") then
x = x - 1
elseif (m[2]:lower() == "right") then
x = x + 1
end
end
if (value.tag ~= 255 and value.tag ~= 254) then
stringWaypoints = stringWaypoints .. "\t\t<item text=\"".. value.prefixe .. " (" .. Self.Position().x .. ", " .. Self.Position().y .. ", " .. Self.Position().z ..")\" tag=\"".. value.tag .. "\"/>\n"
c:SendOrangeMessage("Waypoint Maker", value.prefixe .. " added to " .. (#m >= 2 and m[2] or "center") .. "!")
elseif (value.tag == 255) then
stringWaypoints = stringWaypoints .. "\t\t<item text=\"".. m[2] .."\" tag=\"".. value.tag .. "\"/>\n"
c:SendOrangeMessage("Waypoint Maker", "Label named \"" .. m[2] .. "\" added!")
elseif (value.tag == 254) then
local mScript = msg
mScript = string.gsub(mScript, value.name, "")
stringWaypoints = stringWaypoints .. "\t\t<item text=\"".. mScript .."\" tag=\"".. value.tag .. "\"/>\n"
c:SendOrangeMessage("Waypoint Maker", "Script \"" .. mScript .. "\" added!")
end
end
end
elseif(m[0] == config.targetingPrefixe) then
--argument 1 = name
--argument 2 = follow type
--argument 3 = priority monster
local atkType = 0
local atkPrio = 0
for k1, v1 in ipairs(targetingType) do
if v1.name:lower() == m[2]:lower() then atkType = v1.tag end
end
for k1, v1 in ipairs(targetingPrio) do
if v1.name:lower() == m[3]:lower() then atkPrio = v1.tag end
end
stringTargeting = stringTargeting .. "\t\t<item type=\"" .. m[1] .. "\" spl=\"exori hur\" rne=\"3158\" atk=\"".. atkType .."\" max=\"100\" min=\"0\" prio=\"".. atkPrio .."\" prox=\"7\" count=\"1\" />\n"
c:SendOrangeMessage("Waypoint Maker", "Monster \"" .. m[1] .. "\" added!")
elseif (m[0] == config.looterPrefixe) then
--argument 1 = id
--argument 2 = backpack starting from 1
local id = m[1]
local bp = m[2]
stringLooter = stringLooter .. "\t\t<item ID=\"".. id .."\" action=\"".. (bp - 1) .."\" />\n"
c:SendOrangeMessage("Waypoint Maker", "Loot with id " .. id .. " added to backpack #".. bp .."!")
end
end
end
end
function onClose(c)
if (tag ~= -2) then
print("Waypoint Maker closed! File saved as \"" .. defaultName .. ".xbst\"")
stringWaypoints = stringWaypoints .. "\t</control>\n"
stringWaypoints = stringWaypoints .. "</panel>\n"
stringTargeting = stringTargeting .. "\t</control>\n"
stringTargeting = stringTargeting .. "</panel>\n"
stringLooter = stringLooter .. "\t</control>\n"
stringLooter = stringLooter .. "</panel>\n"
file:write(stringWaypoints)
file:write(stringTargeting)
file:write(stringLooter)
file:close()
else
print("Waypoint Maker error! Please, try again.")
end
end
local c = Channel.Open("Waypoint Maker", onSpeak, onClose)
c:SendOrangeMessage("Waypoint Maker", "Hello, " .. Self.Name() .. "! Please, choose your file name!")
ModuleWaypointMaker = Module.New('DoWaypointMaker', function(DoWaypointMaker)
if (not checkApproach(lastX, Self.Position().x) or not checkApproach(lastY, Self.Position().y)) then
lastX = Self.Position().x
lastY = Self.Position().y
lastZ = Self.Position().z
stringWaypoints = stringWaypoints .. "\t\t<item text=\"Node (" .. Self.Position().x .. ", " .. Self.Position().y .. ", " .. Self.Position().z ..")\" tag=\"0\"/>\n"
c:SendOrangeMessage("Waypoint Maker", "--AUTO-- New node added!")
end
DoWaypointMaker:Delay(50)
end, false)
"""""""""""""""""""""
Well, i'm looking around forum and found a wptMaker made by Syntax/Spectrus, looked on file and noticed that is a beta version, do it my own to improve some skills...
Credits: Syntax and Spectrus
Last edited by Leonardo; 03-14-2014 at 04:09 PM.
hows its going
Would be perfect waiting for it!
How will we add actions?XD
Guys, I guess UNF is not working on it anymore. I'll close this thread. @User Not Found if you wants to reopen it again then talk to me.