夜游神 发表于 2022-12-31 21:13:52

传奇战神引擎英雄玩家排行榜脚本代码

//福布斯排行         GA0          71         73         福布斯排行榜         0      13      0      600

program Mir2;
//初始化设置
Const FBS_GetCount = 8;//显示最多条数10
Const FBS_GetNum = 10;//获取多少元宝以上数据

var
FBS_YBNum : array of string;
FBS_UserName : array of string;
PaiHangStr : string;
num : Integer;

procedure OnInitialize;                //初始化操作
var i:integer;
begin
      PaiHangStr := '';
      num := 0;
      for i = 1 to 10 do
      begin
                FBS_YBNum := '';
                FBS_UserName := '';
      end;
end;

procedure Execute;//自动执行
var
i : integer;
begin
      This_DB.ExecuteQuery('select ChrName,YBNum from gamedata.yb_user_data where YBNum > '+IntToStr(FBS_GetNum)+' order by YBNum desc limit 10;');//查询前十
      for i := 1 to FBS_GetCount do
      begin
                if This_DB.PsEof() then
                begin
                        break;
                end else
                begin
                        FBS_UserName := This_DB.PsFieldByName('ChrName');
                        FBS_YBNum := This_DB.PsFieldByName('YBNum');
                        This_DB.PsNext();
                end;
      end;
end;


begin
      for Num := 1 to FBS_GetCount do
      begin
                if This_DB.PsEof() then
                begin
                        break;
                end else
                begin
                        PaiHangStr := PaiHangStr +'|第'+IntToStr(Num)+'名:'+ FBS_UserName + '^资产:' + FBS_YBNum;
                        This_DB.PsNext();
                end;
      end;
      IF PaiHangStr = '' then
      begin
                PaiHangStr := '| |还没有人能上到排行榜';
      end;
      This_Npc.NpcDialog(This_Player,'只有前'+IntToStr(FBS_GetCount)+'名'+IntToStr(FBS_GetNum)+'元宝以上才有资格上榜!'+PaiHangStr);
end.

Chinese.Doll 发表于 2023-12-27 07:34:07

积分任务
页: [1]
查看完整版本: 传奇战神引擎英雄玩家排行榜脚本代码