Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 10/07/19 in all areas

  1. 1 point
    bWolfie

    how to optimize this script

    In my opinion, best thing to do is to save all data as char_reg variables, e.g. WoE_Kill += 1; And then once WoE is finished, run a SQL query to copy data from char_reg_num_db and char_reg_str_db to your custom table. E.g. OnAgitEnd: query_sql("TRUNCATE TABLE `woe_rank`;"); // clear old data. this table is only used to hold temporary values for displaying elsewhere .@count = query_sql("SELECT `char_id`, `value` FROM `char_reg_num_db` WHERE `key` = 'WoE_Kill';", .@CID, .@WoE_Kill); for (.@i = 0; .@i < .@count; .@i++) { query_sql(sprintf("INSERT INTO `woe_rank`(`char_id`, `kills`) VALUES(%d, %d);", .@CID, .@WoE_Kill)); sleep(50); // don't perform too many queries at once (20 per second) } end; So then the query_sql() command is only being run under controlled circumstances, and only used once.
  2. 1 point
    Dastgir

    Plugin Collections

    Updated https://github.com/dastgirp/HPM-Plugins/commit/82c428fc5e1177cb724c4ea48d8668d3fdee2caf
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.