• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

TalkAction Buying Command [ADVANCED]

noone said that i copy it maybe i add new items o.ô

I said you copy it, owner also said you copied it on another thread. So yes, someone is saying it.

And you didnt "add new items", you just took the script, modified the item examples, changed a few of the comment words and posted it taking credit for it and advertising your personal website with it, when it did the exact same as the other, nothing was optimized here.

That my friend, is lame. At least you posted credits now, but still, if you want to advertise a website, next time do it with a script you make on your own or a script you optimized, so people can know about your talent or lack of it and then decide if visiting the website is worth it.

Right now, it isnt.

Cheers.
 
Last edited:
--script by zieli--? You should at least give me credits for it after copying it from my thread.
 
Last edited:
ty for script.

but i gotta ask a thing:

why are so many of the semi-pro scripters on otland doing this:
PHP:
    for i, item in ipairs(items) do
        par = getFullParam(par)
        if item[1] == 1 then

people here must learn that you dont need to loop, to check for a match in a table!!! heres what you should have done:

PHP:
table items = {4891, 35000}
local item = getItemIdByName(string.lower(param), false)
if items[item] ~= nil then
    do whatever you want with items[item]
else
this item is not buyable.
 
ty for script.

but i gotta ask a thing:

why are so many of the semi-pro scripters on otland doing this:
PHP:
    for i, item in ipairs(items) do
        par = getFullParam(par)
        if item[1] == 1 then

people here must learn that you dont need to loop, to check for a match in a table!!! heres what you should have done:

PHP:
table items = {4891, 35000}
local item = getItemIdByName(string.lower(param), false)
if items[item] ~= nil then
    do whatever you want with items[item]
else
this item is not buyable.

Since I use anonymous tables, I need to do so. I really hate to write:
Code:
items = {
["bp swords"] = {price = 2000}
}

if items[param] then
-- blablabla
end

There are less options for multiple keywords. On the example above, I can only have one keyword, otherwise I'll have to make two tables for the same item.

Loops are NOT bad! They are useful and should be used more often, even on these cases.
 
Last edited:
ty for script.

but i gotta ask a thing:

why are so many of the semi-pro scripters on otland doing this:
PHP:
    for i, item in ipairs(items) do
        par = getFullParam(par)
        if item[1] == 1 then

people here must learn that you dont need to loop, to check for a match in a table!!! heres what you should have done:

PHP:
table items = {4891, 35000}
local item = getItemIdByName(string.lower(param), false)
if items[item] ~= nil then
    do whatever you want with items[item]
else
this item is not buyable.

Agree, loops are useless and takes more memory...
 
loops are not useless, they are a must in lua scripting. however, if you can do something effective without using loops, you should always choose that way...
 
Since I use anonymous tables, I need to do so. I really hate to write:
Code:
items = {
["bp swords"] = {price = 2000}
}

if items[param] then
-- blablabla
end

There are less options for multiple keywords. On the example above, I can only have one keyword, otherwise I'll have to make two tables for the same item.

Loops are NOT bad! They are useful and should be used more often, even on these cases.

why not just write:

PHP:
local items = {
[1239] = 3000 -- itemid, price
}

explode the param, check for ammount or bp keywords, instead of using an own value for bp in table, just check for it in param seperatly..

convert the item-name in the param, to itemid, and use it to find your values in the table.
 
But in this case, loop is useless, ye?

#Edit:
I don't mean loops are useless in all the lua...
 
i would say its useless in this case, ye, cuz you can do it more directly without loops
 
Back
Top