• 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!

The most LUA unnecessary function you know

Mazen

Developer
Joined
Aug 20, 2007
Messages
612
Reaction score
38
Location
Sweden
What is/Wish are the most unnecessary LUA function you know?

Two Rules:
- Not more than 10 functions per post.
- Describe why it's unnecessary.

Mine is math.pow(x, y). Really unnecessary because you can just write (x^y) and get the same result.
 
Have it your way..

table.getn(t)
Use operator # instead.
 
Code:
isCreature(cid)

I think it is unneccessary because of other functions that do similar things.
There isn't a really specific use for the above function.

Code:
isPlayer(cid)
isMonster(cid)
isNpc(cid)
 
Are we talking about Lua functions or OpenTibia functions .. or both?
 
Code:
isCreature(cid)

I think it is unneccessary because of other functions that do similar things.
There isn't a really specific use for the above function.

Code:
isPlayer(cid)
isMonster(cid)
isNpc(cid)

Actually all three you've mentioned are based on isCreature.

Code:
function isPlayer(cid)
        return isCreature(cid) and cid >= AUTOID_PLAYERS and cid < AUTOID_MONSTERS
end

function isMonster(cid)
        return isCreature(cid) and cid >= AUTOID_MONSTERS and cid < AUTOID_NPCS
end

function isNpc(cid)
        return isCreature(cid) and cid >= AUTOID_NPCS
end

Have it your way..

table.getn(t)
Use operator # instead.

Some people don't like when their script looks like commented ;)


And my winner is...!
string.rep
 
ooooooooo!!!!!!!!!!1 yes!!!!11

doCreatureSay(uid, text, type, ghost, cid, pos) ROX!
yes it has so much rocks in he that i had to patch it into 0.2.6

but why doCreatureSay(uid <? item can say things too? oo fuked
 
Back
Top