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

Lua Function Search

Elexonic

Well-Known Member
Joined
Jun 18, 2008
Messages
1,920
Reaction score
59
Someone knows a function either mysql or lua .. to make a script that is able to find items in the ot?
For example to look who has the item in the whole ot 2268/2269/2270?

Another question added to a scrtip to create a log ..
doWriteLogFile (". / data / logs / etc etc.

I need to put something so that when you close the log or something? can lag if I leave well alone?

thanks.
 
Last edited:
ok go into your database in there u should have a table as players and a table player, hit the table Player. then under that hit the sub table player_items, then once ur there go to the top.. hit search. then for itemtype value just enter the item id. and hit go. thats all u have to edit. just make sure operator is at =
 
SQL:
SELECT `players`.`name`, SUM(`player_items`.`count`) AS `total`
FROM `players`, `player_items`
WHERE `player_items`.`itemtype` = 2269
AND `players`.`id` = `player_items`.`player_id`
GROUP BY `players`.`name`
ORDER BY `total` DESC
 
As if I would be if the player is level 50+ and has the item 2269 , give 3 days more premium?
with that function or other similar D=

would be like to add two items on the list?

WHERE `player_items`.`itemtype` = 2269;2270 ?

Thanks.
 
SQL:
SELECT `players`.`name`, SUM(`player_items`.`count`) AS `total`
FROM `players`, `player_items`
WHERE `player_items`.`itemtype` IN( 2268,2269,2270 )
AND `players`.`id` = `player_items`.`player_id`
GROUP BY `players`.`name`
ORDER BY `total` DESC
 
Thanks you!
and
As if I would be if the player is level 50+ and has the item 2269 , give 3 days more premium?
with that function or other similar D=
 
SQL:
CREATE TEMPORARY TABLE t1 SELECT player_id FROM player_items WHERE itemtype = 2269 GROUP BY player_id;

CREATE TEMPORARY TABLE t2 SELECT account_id FROM players WHERE level >= 50 AND id IN ( SELECT * FROM t1 ) GROUP BY account_id;

UPDATE accounts SET premdays = premdays + 3 WHERE id IN ( SELECT * FROM t2 );
 
Last edited:
I need to run a query each time you want to happen? or is always already there?

One last thing :(

how could I do that if the player does not have that item or the level required to remove the item [only item no level, if have item..]?

Thanks you Cykotitan
 
how could I do that if the player does not have that item or the level required to remove the item [only item no level, if have item..]?

If player have item 2268 example.
But no have required level 50 [ example]
scrtip removed item

and if you have the item level and nothing happened.
 
Last edited:
Back
Top