• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Open tibia advanced lib (OTAL)

Mock

Mock the bear (MTB)
Joined
Jul 29, 2008
Messages
619
Reaction score
109
Location
Brazil
Hello, i'm doing the biggest and most better open tibia functions lib. It will be called Open tibia advanced lib.
I'm finishing this project, my project it's only form otservers, but i need your help! My lib contais around 169 functions but if you want help show-me your lua function to i insert on the lib, i will not remove your credits!
I'm planning lunch it in around 4 days, Skyen hasus, magus, nord and others users from others forums is helping me with many functions like isWalkable, var_dump etc...
Here it's the current lua functions list:
LUA:
--- Xmls
xml:open(file[,kind])
xml:setSess(sessname,tagname,name)
xml:getSess(SessName)
xml:readSess(SessName)
xml:readFree(tagname)
--- Vip
vip.getVip(cid)
vip.getVipByAcc(acc)
vip.setVip(cid,time)
vip.getVipByAccount(acc)
vip.hasVip(cid)
vip.accountHasVip(acc)
vip.getDays(days)
vip.addVipByAccount(acc,time)
vip.setVipByAccount(acc,time)
vip.returnVipString(cid)
-- Tibia
doScrollMessage(uid, message)
doSummonCreatureWithCheck(name, pos)
isLevel(cid,level)
stringcontains(txt, str)
isWalkable(pos)
getStringCount(msg)
isOnline(name)
getAccountStorageValue(accid,value_id)
setAccountStorageValue(accid,value_id,value)
doInArea(pos,radius,luaString,var)
setPlayerName(cid,name,msg)
string.trim(str)
string.explode(str, sep[,limit])
doActionForAllPlayers(luaString)
isWeapon(uid)
isArmor(uid)
hasSqm(pos)
getFileString(file[,limit])
getPlayerInfo(cid,val)
executeInArea(cmd, pos, area)
math.percent(v, t, f)
math.module(x)
findItemById(pos, id)
math.interval(x, y)
doPlayerAddDepotItem(cid, item, count)
getInstantSpells(vocid)
setPlayerRecoveryKey(cid)
getPlayerTotalDefense(cid)
ddNumberOnArray(array, number)
getArrPosByName(array, name)
getCountOnArr(array, search)
doCalculateArray(array, calc)
changeLookDir(cid, dir)
getLuaFunctions()
doFindItemInPos(itens, pos)
doDelayAttack(cid, delay, min, max, type, effect, projectile, frompos, topos)
tableToString(tb)
saveTable(table,name)
getTable(name)
getItemIdByName2(name)
string.expand(s)
var_dump(...)
printT(tx,t)
string.impode(arr,sep)
doWriteLogFile(file, text,line)
getDirFiles(dir, ext)
getItemIdByName2(name)
getPlayerTotalArmor(cid)
getPlayerTotalAttack(cid)
--- Socket
-- Dns
socket.dns.toip(ip)
socket.dns.gethostname()
socket.dns.tohostname(address)
-- Mime functions
mime.normalize([marker])
mime.decode(vr)
mime.encode(vt)
mime.stuff()
mime.wrap("text" [, length])
mime.b64(C [, D])
mime.dot(m [, B])
mime.eol(C [, D, marker])
mime.qp(C [, D, marker])
mime.qpwrp(n [, B, length])
mime.unb64(C [, D])
mime.unqp(C [, D])
mime.wrp(n [, B, length])
-- Socket
socket.bind(address, port [, backlog])
socket.connect(address, port [, locaddr, locport])
socket.newtry(finalizer)
socket.protect(func)
socket.select(recvt, sendt [, timeout])
socket.sink(mode, socket)
socket.skip(d [, ret1, ret2 ... retN])
socket.sleep(time)
socket.source(mode, socket [, length])
socket.gettime()
socket.try(ret1 [, ret2 ... retN])
-- Tcp functions
socket.tcp()
server:accept()
master:bind(address, port)
master:close()
master:connect(address, port)
client:getpeername()
master:getsockname()
master:getstats()
master:listen(backlog)
client:receive([pattern [, prefix]])
client:send(data [, i [, j]])
client:setoption(option [, value])
master:setstats(received, sent, age)
master:settimeout(value [, mode])
client:shutdown(mode)
-- Udp functions
socket.udp()
connected:close()
connected:getpeername()
connected:getsockname()
connected:receive([size])
unconnected:receivefrom([size])
connected:send(datagram)
unconnected:sendto(datagram, ip, port)
unconnected:setpeername(address, port)
connected:setpeername('*')
unconnected:setsockname(address, port)
connected:setoption(option [, value])
connected:settimeout(value)
--- Ex lib
ex.getenv(name)
ex.setenv(name, value)
ex.environ()
ex.chdir(pathname)
ex.mkdir(pathname)
ex.currentdir()
ex.dir(pathname)
ex.dirent(pathname)
ex.lock(file, mode, offset, length)
ex.unlock(file, offset, length)
ex.pipe()
ex.sleep(interval, [unit])
ex.spawn(...)
ex.wait(proc)
--- Luasql
conn:close()
conn:commit()
conn:execute(statement)
conn:rollback()
conn:setautocommit(boolean)
cur:close()
cur:fetch([table[,modestring]])
cur:getcolnames()
cur:numrows()
env:connect(sourcename[,username[,password[,hostname[,port]]]])
--- Rings
rings.new (env)
state:close ()
state:dostring (string, ...)
remotedostring (string, ...)
stable.get (key)
stable.set (key, value)
--- Coexpcall [url]http://coxpcall.luaforge.net/index.htm[/url]
coxpcall(f, err)
copcall(f, ...)
--- Copas [url]http://www.keplerproject.org/copas/index.html[/url]  (Coroutine Oriented Portable Asynchronous Services)
copas.addserver(server, handler[, timeout])
copas.addthread(thrd[, ...])
copas.loop(timeout)
copas.step(timeout)
copas.flush(skt)
copas.receive(skt, pattern)
copas.send(skt, data)
copas.wrap(skt)

Many unsefull functions, old luasql lib, lua ex, Lua socket (i will post an server chat you can connect in another server and create an channel with 2 servers, and you can trade items with servers not in same PC)
and many other functions.

If you want your function on this list it's just say :D

Tested in:
Open tibia
TFS 0.3.4 --> dont use on tfs 0.3.5 because TFS with or without lib crashes alot.

Self instalattion:
lib.png


Otal's website http://otal.leadhoster.com/index.php
 
Last edited:
When you install on first time your server creates an txt called: Your Server Function List, it contains ALL server lua functions without params, I used it on open tibia svn and it contais:
LUA:
1 - addAccountBan
2 - addDamageCondition
3 - addEvent
4 - addIPBan
5 - addNumberOnArray
6 - addOutfitCondition
7 - addPlayerBan
8 - assert
9 - bit.band
10 - bit.bnot
11 - bit.bor
12 - bit.bxor
13 - bit.lshift
14 - bit.rshift
15 - bit.uband
16 - bit.ubnot
17 - bit.ubor
18 - bit.ubxor
19 - bit.ulshift
20 - bit.urshift
21 - broadcastMessage
22 - canPlayerLearnInstantSpell
23 - canPlayerWearOutfit
24 - changeLookDir
25 - changeName
26 - cleanHouse
27 - collectgarbage
28 - coroutine.create
29 - coroutine.resume
30 - coroutine.running
31 - coroutine.status
32 - coroutine.wrap
33 - coroutine.yield
34 - createCombatArea
35 - createCombatObject
36 - createConditionObject
37 - debug.debug
38 - debug.getfenv
39 - debug.gethook
40 - debug.getinfo
41 - debug.getlocal
42 - debug.getmetatable
43 - debug.getregistry
44 - debug.getupvalue
45 - debug.setfenv
46 - debug.sethook
47 - debug.setlocal
48 - debug.setmetatable
49 - debug.setupvalue
50 - debug.traceback
51 - debugPrint
52 - doActionForAllPlayers
53 - doAddCondition
54 - doAddContainerItem
55 - doAddContainerItemEx
56 - doAddMapMark
57 - doAreaCombatCondition
58 - doAreaCombatDispel
59 - doAreaCombatHealth
60 - doAreaCombatMana
61 - doCalculateArray
62 - doChallengeCreature
63 - doChangeSpeed
64 - doChangeTypeItem
65 - doCombat
66 - doConvinceCreature
67 - doCreateItem
68 - doCreateItemEx
69 - doCreateTeleport
70 - doCreatureAddHealth
71 - doCreatureChangeOutfit
72 - doCreatureSay
73 - doDecayItem
74 - doDelayAttack
75 - doFindItemInPos
76 - doInArea
77 - doMonsterChangeTarget
78 - doMoveCreature
79 - doPlayerAddDepotItem
80 - doPlayerAddExp
81 - doPlayerAddItem
82 - doPlayerAddItemEx
83 - doPlayerAddMana
84 - doPlayerAddManaSpent
85 - doPlayerAddMoney
86 - doPlayerAddOutfit
87 - doPlayerAddOutfitEx
88 - doPlayerAddSkillTry
89 - doPlayerAddSoul
90 - doPlayerBroadcastMessage
91 - doPlayerDepositMoney
92 - doPlayerFeed
93 - doPlayerJoinParty
94 - doPlayerPopupFYI
95 - doPlayerRemoveItem
96 - doPlayerRemoveMoney
97 - doPlayerRemoveOutfit
98 - doPlayerRemoveOutfitEx
99 - doPlayerSendCancel
100 - doPlayerSendDefaultCancel
101 - doPlayerSendOutfitWindow
102 - doPlayerSendTextMessage
103 - doPlayerSendToChannel
104 - doPlayerSetGuildNick
105 - doPlayerSetGuildRank
106 - doPlayerSetIdleTime
107 - doPlayerSetLossPercent
108 - doPlayerSetMasterPos
109 - doPlayerSetRate
110 - doPlayerSetTown
111 - doPlayerSetVocation
112 - doPlayerSummonCreature
113 - doPlayerTransferMoneyTo
114 - doPlayerWithdrawMoney
115 - doRelocate
116 - doRemoveCondition
117 - doRemoveCreature
118 - doRemoveItem
119 - doSavePlayer
120 - doSaveServer
121 - doScrollMessage
122 - doSendAnimatedText
123 - doSendDistanceShoot
124 - doSendMagicEffect
125 - doSendTutorial
126 - doSetCreatureDropLoot
127 - doSetCreatureLight
128 - doSetCreatureOutfit
129 - doSetItemActionId
130 - doSetItemOutfit
131 - doSetItemSpecialDescription
132 - doSetItemText
133 - doSetMonsterOutfit
134 - doSetMonsterTarget
135 - doShowTextDialog
136 - doShowTextWindow
137 - doSummonCreature
138 - doSummonCreatureWithCheck
139 - doTargetCombatCondition
140 - doTargetCombatDispel
141 - doTargetCombatHealth
142 - doTargetCombatMana
143 - doTeleportThing
144 - doTileAddItemEx
145 - doTransformItem
146 - doWriteLogFile
147 - dofile
148 - error
149 - ex.chdir
150 - ex.currentdir
151 - ex.dir
152 - ex.dirent
153 - ex.environ
154 - ex.getenv
155 - ex.lock
156 - ex.mkdir
157 - ex.pipe
158 - ex.remove
159 - ex.setenv
160 - ex.sleep
161 - ex.spawn
162 - ex.unlock
163 - ex.wait
164 - executeInArea
165 - findItemById
166 - gcinfo
167 - getAccountBanList
168 - getAccountNumberByPlayerName
169 - getAccountStorageValue
170 - getArrPosByName
171 - getConfigValue
172 - getContainerCap
173 - getContainerItem
174 - getContainerSize
175 - getCountOnArr
176 - getCreatureBaseSpeed
177 - getCreatureByName
178 - getCreatureHealth
179 - getCreatureLight
180 - getCreatureLookDir
181 - getCreatureMaster
182 - getCreatureMaxHealth
183 - getCreatureName
184 - getCreatureOutfit
185 - getCreaturePosition
186 - getCreatureSpeed
187 - getCreatureSummons
188 - getCreatureTarget
189 - getDataDir
190 - getDepotId
191 - getDirFiles
192 - getFileString
193 - getFluidSourceType
194 - getGlobalStorageValue
195 - getGuildId
196 - getHouseAccessList
197 - getHouseBedCount
198 - getHouseByPlayerGUID
199 - getHouseDoorCount
200 - getHouseEntry
201 - getHouseList
202 - getHouseName
203 - getHouseOwner
204 - getHouseRent
205 - getHouseTilesSize
206 - getHouseTown
207 - getIPBanList
208 - getIPByPlayerName
209 - getInstantSpellInfoByName
210 - getInstantSpellWords
211 - getInstantSpells
212 - getItemDescriptions
213 - getItemIdByName
214 - getItemIdByName2
215 - getItemName
216 - getItemRWInfo
217 - getItemSpecialDescription
218 - getItemWeight
219 - getLuaFunctions
220 - getMonsterFriendList
221 - getMonsterTargetList
222 - getPartyMembers
223 - getPlayerAccess
224 - getPlayerBalance
225 - getPlayerBanList
226 - getPlayerDepotItems
227 - getPlayerExperience
228 - getPlayerFlagValue
229 - getPlayerFood
230 - getPlayerFrags
231 - getPlayerFreeCap
232 - getPlayerGUID
233 - getPlayerGUIDByName
234 - getPlayerGuildId
235 - getPlayerGuildName
236 - getPlayerGuildNick
237 - getPlayerGuildRank
238 - getPlayerInfo
239 - getPlayerInstantSpellCount
240 - getPlayerInstantSpellInfo
241 - getPlayerItemById
242 - getPlayerItemCount
243 - getPlayerLastLogin
244 - getPlayerLearnedInstantSpell
245 - getPlayerLevel
246 - getPlayerLossPercent
247 - getPlayerMagLevel
248 - getPlayerMana
249 - getPlayerMasterPos
250 - getPlayerMaxMana
251 - getPlayerNameByGUID
252 - getPlayerParty
253 - getPlayerPremiumDays
254 - getPlayerRedSkullTicks
255 - getPlayerSex
256 - getPlayerSkill
257 - getPlayerSkullTicks
258 - getPlayerSkullType
259 - getPlayerSlotItem
260 - getPlayerSoul
261 - getPlayerStorageValue
262 - getPlayerTotalArmor
263 - getPlayerTotalAttack
264 - getPlayerTotalDefense
265 - getPlayerTown
266 - getPlayerVocation
267 - getPlayersByAccountNumber
268 - getPlayersByIPAddress
269 - getPlayersOnlineList
270 - getSpectators
271 - getStringCount
272 - getThing
273 - getThingFromPos
274 - getThingPos
275 - getTileHouseInfo
276 - getTileItemById
277 - getTileItemByType
278 - getTilePzInfo
279 - getTileThingByPos
280 - getTopCreature
281 - getTownIdByName
282 - getTownNameById
283 - getTownTemplePosition
284 - getWaypointPositionByName
285 - getWorldCreatures
286 - getWorldLight
287 - getWorldTime
288 - getWorldType
289 - getWorldUpTime
290 - getfenv
291 - getmetatable
292 - hasCondition
293 - hasProperty
294 - hasSqm
295 - http.open
296 - http.request
297 - io.close
298 - io.flush
299 - io.input
300 - io.lines
301 - io.lock
302 - io.open
303 - io.output
304 - io.pipe
305 - io.popen
306 - io.read
307 - io.tmpfile
308 - io.type
309 - io.unlock
310 - io.write
311 - ipairs
312 - isArmor
313 - isContainer
314 - isCorpse
315 - isCreature
316 - isHouseGuildHall
317 - isInArray
318 - isItemContainer
319 - isItemDoor
320 - isItemFluidContainer
321 - isItemMoveable
322 - isItemRune
323 - isItemStackable
324 - isLevel
325 - isMoveable
326 - isOnline
327 - isPremium
328 - isPzLocked
329 - isSightClear
330 - isValidUID
331 - isWalkable
332 - isWeapon
333 - load
334 - loadTable
335 - loadfile
336 - loadstring
337 - luasql.mysql
338 - luasql.sqlite3
339 - math.abs
340 - math.acos
341 - math.asin
342 - math.atan
343 - math.atan2
344 - math.ceil
345 - math.cos
346 - math.cosh
347 - math.deg
348 - math.exp
349 - math.floor
350 - math.fmod
351 - math.frexp
352 - math.interval
353 - math.ldexp
354 - math.log
355 - math.log10
356 - math.max
357 - math.min
358 - math.mod
359 - math.modf
360 - math.module
361 - math.percent
362 - math.pow
363 - math.rad
364 - math.random
365 - math.randomseed
366 - math.sin
367 - math.sinh
368 - math.sqrt
369 - math.tan
370 - math.tanh
371 - mime.b64
372 - mime.decode
373 - mime.dot
374 - mime.encode
375 - mime.eol
376 - mime.normalize
377 - mime.qp
378 - mime.qpwrp
379 - mime.stuff
380 - mime.unb64
381 - mime.unqp
382 - mime.wrap
383 - mime.wrp
384 - module
385 - newproxy
386 - next
387 - numberToVariant
388 - os.chdir
389 - os.clock
390 - os.currentdir
391 - os.date
392 - os.difftime
393 - os.dir
394 - os.dirent
395 - os.environ
396 - os.execute
397 - os.exit
398 - os.getenv
399 - os.mkdir
400 - os.remove
401 - os.rename
402 - os.setenv
403 - os.setlocale
404 - os.sleep
405 - os.spawn
406 - os.time
407 - os.tmpname
408 - package.loadlib
409 - package.seeall
410 - pairs
411 - pcall
412 - playerLearnInstantSpell
413 - positionToVariant
414 - print
415 - printT
416 - queryTileAddThing
417 - rawequal
418 - rawget
419 - rawset
420 - registerCreatureEvent
421 - removeAccountBan
422 - removeIPBan
423 - removePlayerBan
424 - require
425 - saveTable
426 - select
427 - setAccountStorageValue
428 - setCombatArea
429 - setCombatCallback
430 - setCombatCondition
431 - setCombatFormula
432 - setCombatParam
433 - setConditionFormula
434 - setConditionParam
435 - setCreatureMaxHealth
436 - setCreatureMaxMana
437 - setGlobalStorageValue
438 - setHouseAccessList
439 - setHouseOwner
440 - setPlayerName
441 - setPlayerRecoveryKey
442 - setPlayerStorageValue
443 - setfenv
444 - setmetatable
445 - socket.__unload
446 - socket.bind
447 - socket.choose
448 - socket.connect
449 - socket.gettime
450 - socket.newtry
451 - socket.protect
452 - socket.select
453 - socket.sink
454 - socket.skip
455 - socket.sleep
456 - socket.source
457 - socket.tcp
458 - socket.try
459 - socket.udp
460 - stopEvent
461 - string.byte
462 - string.char
463 - string.dump
464 - string.expand
465 - string.explode
466 - string.find
467 - string.format
468 - string.gfind
469 - string.gmatch
470 - string.gsub
471 - string.impode
472 - string.len
473 - string.lower
474 - string.match
475 - string.rep
476 - string.reverse
477 - string.sub
478 - string.trim
479 - string.upper
480 - stringToVariant
481 - stringcontains
482 - table.concat
483 - table.foreach
484 - table.foreachi
485 - table.getn
486 - table.insert
487 - table.maxn
488 - table.remove
489 - table.setn
490 - table.sort
491 - tableToString
492 - targetPositionToVariant
493 - tonumber
494 - tostring
495 - type
496 - unpack
497 - var_dump
498 - variantToNumber
499 - variantToPosition
500 - variantToString
501 - vip.accountHasVip
502 - vip.addVipByAccount
503 - vip.getDays
504 - vip.getVip
505 - vip.getVipByAcc
506 - vip.getVipByAccount
507 - vip.hasVip
508 - vip.returnVipString
509 - vip.setVip
510 - vip.setVipByAccount
511 - xml.getSess
512 - xml.open
513 - xml.readFree
514 - xml.readSess
515 - xml.setSess
516 - xpcall

Please help, showme your function to me put on lib too :D
 
My newest funciton:
LUA:
function isItemOnPos(itemid, pos) -- by Shawak
	itemOnPos, i = false, 0
        while i <= 5 do
                pos.stackpos = i
                nowitem = getThingfromPos(pos)
                if nowitem.uid ~= false then
                        if isCreature(nowitem.uid) == false then
                                if nowitem.itemid == itemid then
                                        itemOnPos = true
                                        break
				end
                        end
                end
                i = i+1
        end
	return itemOnPos
end
Not tested, but would be nice to have this. :thumbup:
 
@nostra~
Yes, in the moment i'm looking on lua forge for anothers libs...
@shawak
omg
pwned!
My lib already have this function, not this but something like this :D
findItemOnPos :S
 
@shawak
ops fail
it's findItemInPos
So, if your function find more than 1 item or only 1 usinga an number or table i will remove old function and put your :D
 
Back
Top