I liked it.
I liked it.
Well I need to do something better than log then.
Updated for version 1.2.0.
Little examples from new version:
getdistancebetween
if getdistancebetween(11111, 22222, 7, 22222, 33333, 7) >= 100 then
print("WHOA! WE'RE FAR")
end
-- alternative invocation
local pos1 = {11111, 22222, 7}
local pos2 = {22222, 33333, 7}
print(getdistancebetween(pos1, pos2))
-- alternative invocation
local pos1 = {x = 11111, y = 22222, z = 7}
local pos2 = {x = 22222, y = 33333, z = 7}
print(getdistancebetween(pos1, pos2))
isabletocast
print(isabletocast('exura ico'))
-- checks if you meet the spell requirements to cast and the cooldown period
cancast
print(cancast('utito tempo'))
-- checks if you met the spell requirements to cast and the duration of spell period
-- alternative invocation
if cancast('exori ico', $attacked) then -- checks if can cast on a creature
cast('exori ico')
end
unequipitem/unequip
unequip('weapon') -- moves your weapon to any backpack
unequip('weapon', 'backpack of holding', 1) -- moves 1 weapon to the backpack of holding
unequip('weapon', 1) -- moves 1 weapon to any backpack
Valid slots: "amulet", "neck", "weapon", "rhand", "shield", "lhand", "ring", "finger", "armor", "chest", "boots", "feet", "ammo", "belt", "helmet", "head"
isinsidearea
print(isinsidearea(100, 110, 200, 210, 7)) -- true if you are inside those coordinates
--alternate invocations
print(isinsidearea({100, 110, 200, 210, 7}, {200, 210, 100, 110, 7})) -- true if you are inside one of those group of coordinates
pvpworld
print(pvpworld()) -- true if pvp world, false if not.
checklocation
print(checklocation(7)) -- same as islocation(7), true or false if you are inside the waypoint location
-- alternative invocation
checklocation(7, "Label If not location", "section") -- doesn't return nothing, goes to the label "Label If not location" on the section given if not on location.
Last edited by Leonardo; 02-15-2014 at 11:03 PM.
Awesome new functions lol
Updated for version 1.2.1, moved project to GitHub.
Examples:
getareatype/setareatype
if getareatype('NewSpecialArea') == AREA_TYPE_BORDER then
setareatype('newSpecialArea', AREA_TYPE_FILLED)
end
It will change the area type to "Square (Filled)" if the given special area type is "Square (Border Only")
getareaextrapolicy/setareaextrapolicy
if not getareaextrapolicy('NewSpecialArea', 'loot') then
setareaextrapolicy('NewSpecialArea', 'loot', true)
end
Checks if the "Ignore When Looting" is enabled on the given special area. If not then it enables it.
Alternative Invocations:
if getareaextrapolicy('NewSpecialArea', 'lure') then
setareaextrapolicy('NewSpecialArea', 'lure', false)
end
Checks if the "Ignore When Luring" is disabled on the given special area. If not then it will disable it.
Updated for version 1.3.0 to improve functions for version 1.3.1 of the bot.
Examples:
getareacomment/setareacomment
if getareacomment('SpecialArea') == 'My special area <3' then
setareacomment('SpecialArea', 'Hey I brought you flowers!')
end
It'll set the commentary of the special area named "SpecialArea" to "Hey I brought you flowers!" if the previous comment for it was "My special area <3".
Alternative Invocations:
setareacomment('SpecialArea')
It'll clean the commentaries of the special area named "SpecialArea".
loadstringf
for _, slot in ipairs('head', 'chest', 'legs', 'foot') do
print(loadstringf('return $%s', slot)())
end
This is just a improvement of the function loadstring. Adding the possibility to use strings and format them as the parameters while the default function accepts only a single string. The example will print out the information of your equipment slots from head to foot.
Updated for version 1.4.0.
Examples:
isontemple
if isontemple() then
logout()
end
It'll logout if you are inside a temple. If you are already logged out this function will keep the last value since your character was online.
withdrawitems
withdrawitems("Inbox", "0-15", "brown mushroom", "avalanche rune")
It'll withdraw brown mushroom and avalanche runes from your inbox and move to any opened backpack.
Alternate Invocation 1:
-- moving specific amount of items to a specific backpack
withdrawitems("inbox", {"backpack of holding", "avalanche rune", 200})
It'll move 200 avalanche rune to backpack of holding from your character inbox.
Alternate Invocation 2:
-- different entry model
withdrawitems("inbox", {backpack = "backpack of holding", name = "avalanche rune", amount = 200})
It'll do exactly as the example above, the only difference is in this scenario you'll be indexing values with names.
screentiles
for x, y, z in screentiles() do
moveto(x, y, z) waitping()
end
It'll walk over all tiles coordinates on your screen from the top-left to the bottom-right.
Alternate Invocation 1:
for x, y, z in screentiles(ORDER_RANDOM) do
moveto(x, y, z) waitping()
end
It'll walk over all tiles coordinates on your screen, picking a random position each time.
As order parameter you can pass a sorting function. The default sorting functions are ORDER_RANDOM, ORDER_RADIAL, ORDER_RADIAL_REVERSE, ORDER_EUCLIDEAN, ORDER_EUCLIDEAN_REVERSE, ORDER_REALDIST and ORDER_REALDIST_REVERSE.
Alternate Invocation 2:
for x, y, z in screentiles(false, 3) do
moveto(x, y, z)
end
It'll walk over all the tiles on the range of 3 from the position you started.
Alternate Invocation 3:
for x, y, z in screentiles(false, {-5, 5, -1, 1}) do
moveto(x, y, z)
end
It'll walk over all the tiles with x-axis range between -5 and 5 and y-axis range between -1 and 1 from the position you started.
Alternate Invocation 4:
for tile in screentiles(false, false, gettile) do
print(tile)
end
The last parameter is a coordinate modifier, it'll use the function given on the coordinates received and return a value aswell. The example will print all tiles informations about your entire screen.
Last edited by Leonardo; 02-16-2014 at 07:27 PM.
if isontemple() then
logout()
end
awesome
@Leonardo, check your lib again please. You used to fix "cancast" and now your ava hotkey is fcked. It's spamming ava even if there is cooldown. I just died because of it. I saw updating lib so I reloaded libs and it started spamming hotkey ;/
Updated to version 1.4.2
This adds an improved version of antifurnituretrap to scroll trough all pages on the browse field if the item is not listed on the first page. But like I said on another post this feature have a limitation, you can check it here: http://forums.tibiawindbot.com/showt...ll=1#post31028
This fixes the standtime bug of the second parameter of antifurnituretrap.