OK論壇

 找回密碼
 註冊
查看: 1035|回復: 2

SEAR 10.132 登入腳本問題

 關閉 [複製鏈接]
  • TA的每日心情
    無聊
    2014-11-5 01:32 AM
  • 簽到天數: 11 天

    連續簽到: 1 天

    [LV.3]偶爾看看II

    發表於 2014-9-14 15:11:18 | 顯示全部樓層 |閱讀模式
    EA
    私服版號: sear 10.132
    問題內容: 腳本問題
    本帖最後由 change11j 於 2014-9-20 03:02 AM 編輯

    大家好 最近我在載入腳本時有一個問題 就是我想使用一個每日登入送禮物的腳本 但就是沒有辦法出現效果 小黑窗載入時沒有報錯但角色登入後就報錯了 不知道為什麼,可以教教我嗎?我使用的
    伺服器 sear 10.132
    登入器 20100730a RagexeRE

    腳本如下

    1. -        script        LOGIN        -1,{
    2. OnWhisperGlobal:
    3. OnLoginCmnd:
    4. OnPCLoginEvent:
    5.         sleep2 1000 + .Rest * 60000;
    6.         set .@i, (gettime(7) * 365 * 24 * 60) + (gettime(8) * 24 * 60) + (gettime(3) * 60) +gettime(2);
    7.         if(.@i >= (#LastDailyReward + .MinWait)){
    8.                 if(.@i < #LastDailyReward + .MaxWait){
    9.                         set #DRewardCon, #DRewardCon + 1;
    10.                 } else {
    11.                         set #DRewardCon, 1;
    12.                 }
    13.                 set .@g, (#DRewardCon > getarraysize(.Rewards$)) ? getarraysize(.Rewards$) : #DRewardCon;
    14.                 explode(.@TT$,.Rewards$[.@g],"|");
    15.                 if(.Mode & 1 && .@TT$[4]){
    16.                         explode(.@XT$, .@TT$[4],":");
    17.                         //[Note]: I need to figure out a checkweight for all items tired atm lol, for now ill leave it missing
    18.                         for(set .@x,0; .@x < getarraysize(.@XT$); set .@x,.@x + 2){
    19.                                 getitem  atoi(.@XT$[.@x]),  atoi(.@XT$[.@x+1]);
    20.                                 message strcharinfo(0),"Recived "+  .@XT$[.@x+1] +" "+ getitemname( atoi(.@XT$[.@x]));
    21.                         }
    22.                 }
    23.                 if(.Mode & 2 && .@TT$[0]){
    24.                         setd getd(.@TT$[1]),getd(.@TT$[1]) + atoi(.@TT$[0]);
    25.                         message strcharinfo(0),"Recived "+ .@TT$[0] +" "+ .@TT$[1];
    26.                 }
    27.                 if(.Mode & 4 && (.@TT$[2] || .@TT$[3])) getexp atoi(.@TT$[2]),atoi(.@TT$[3]);
    28.                 if(.Mode & 8){
    29.                         for(set .@x,0; .@x < getarraysize(.BuffInfo); set .@x,.@x + 4){
    30.                                 if(#DRewardCon % .BuffInfo[.@x + 1] == 0) sc_start .BuffInfo[.@x], .BuffInfo[.@x + 2] * 60000, .BuffInfo[.@x + 3];
    31.                         }
    32.                 }
    33.                 message strcharinfo(0),"You have collected your daily reward, for "+#DRewardCon+" day"+((#DRewardCon > 1)?"s":"")+" in a row.";
    34.                 set #LastDailyReward, .@i;
    35.         } else {
    36.                 set .@days,(#LastDailyReward + .MinWait - .@i)/60/24;
    37.                 set .@hours,((#LastDailyReward + .MinWait - .@i)/60)%24;
    38.                 set .@mins,(#LastDailyReward + .MinWait - .@i)%60;
    39.                 message strcharinfo(0),"You have "+ (.@days)?""+.@days+"D:":"" + (.@hours)?""+.@hours+"H:":"" + (.@mins)?""+.@mins+"M:":"" +" till your next reward";
    40.         }
    41. end;
    42. OnInit:
    43.         //Basic Settings
    44.         //   1: Item | 2: "Points" | 4: Exp
    45.         //   8: Gain Buffs Every X Consecutive Days logged in
    46.         // (a bit value, e.g. 3 = Items & Points from Multi)
    47.         set .Mode,1 + 2 + 4 + 8;


    48.         //Minimum Minuets Between Collecting Daily Reward
    49.         //   Day: 22*60 - 24*60
    50.         //   Week: 10080
    51.         set .MinWait,1320;

    52.         //Minuets Before Lose Consecutive Daily Reward
    53.         //   Day: 48*60 - 50*60
    54.         //   Week: 20160
    55.         set .MaxWait,3000;

    56.         //Number of mins after logging before collecting prize
    57.         set .Rest,0;

    58.         // Consecutive Days Buff
    59.         // Each buff contains 4 variables (32 Total Max)
    60.         // <Type>,<Days>,<Duration>,<Rate>, // Buff 1
    61.         // <Type>,<Days>,<Duration>,<Rate>, // Buff 2
    62.         //   ...;
    63.         //
    64.         //  Example: 188,7,45,3
    65.         //    -Every 7th consecutive day logged in Player gains +3 Str for 45 mins
    66.         //
    67.         //  Type is 188, which references which SC_ to use, SC_INCSTR in this example
    68.         //     -For a full list of SC_ visit the db/const.txt
    69.         //  Days is days buff is applied, in this example 7, so every 7th day, 14,21,28....
    70.         //  Duration is buff duration is Minuits, in this example 45 mins
    71.         //  Rate is buff strength, in this example player gains 3 Str
    72.         setarray .BuffInfo        ,188,7,45,3        // +3 Str for 45 Mins Every 7th Day
    73.                                 ,194,4,45,25        // +25 Hit for 45 Mins Every 4th Day
    74.                                 ,198,10,60,10        // +10% Hp for 60 Mins Every 10th Day
    75.                                 ,257,9,120,50;        // +50% Exp for 120 Mins Every 9th Day

    76.         // Daily Prize items (max 128 days):
    77.         //   "<Points>|<PointType>|<BaseExp>|<JobExp>|<itemID-1>:<amount-1>:<itemID-2>:<amount-2>...etc", // Day 1
    78.         //   "<Points>|<PointType>|<BaseExp>|<JobExp>|<itemID-1>:<amount-1>:<itemID-2>:<amount-2>...etc"  // Day 2
    79.         //   ...;
    80.         // Total length of any days string must be 255 or shorter
    81.         // * If players login longer than the last set
    82.         //   day, they will keep getting the last prize.
    83.         setarray .Rewards$,
    84.                 "0|Zeny|0|0|512:1",                        // Day 1: 1 Apple
    85.                 "0|Zeny|0|0|513:2",                        // Day 2: 2 Bananas
    86.                 "1000|Zeny",                                // Day 3: 1000 Zeny
    87.                 "0|Zeny|100|50",                        // Day 4: 100 Base 50 Job Exp
    88.                 "1|#ExamplePoint|0|0|512:1:513:2";        // Day 5: 1 Apple + 2 Bananas + 1 #ExamplePoint
    89. end;
    90. }
    複製代碼
    map-sever 出現的錯誤如下

    本帖子中包含更多資源

    您需要 登錄 才可以下載或查看,沒有帳號?註冊

    x
    回復

    使用道具 舉報

  • TA的每日心情
    擦汗
    2014-8-7 11:27 AM
  • 簽到天數: 23 天

    連續簽到: 1 天

    [LV.4]偶爾看看III

    發表於 2014-9-18 17:24:42 | 顯示全部樓層
    本帖最後由 jasonwu0319 於 2014-9-18 06:08 PM 編輯

    找到問題了

    請你將以下
    if(.mode & 1 && .@TT$[4] )

    改成
    if(.mode & 1 && .@TT$[4] != "")

    因為.@TT$[4]是字串而非數值
    只有數值可以用if()來判定是否為零
    回復 支持 反對

    使用道具 舉報

  • TA的每日心情
    無聊
    2014-11-5 01:32 AM
  • 簽到天數: 11 天

    連續簽到: 1 天

    [LV.3]偶爾看看II

     樓主| 發表於 2014-9-19 22:05:23 | 顯示全部樓層
    jasonwu0319 發表於 2014-9-18 05:24 PM
    找到問題了

    請你將以下

    喔喔喔喔 感謝您 我把該改的地方改一改之後果然可以用了 實在十分感謝您
    回復 支持 反對

    使用道具 舉報

    您需要登錄後才可以回帖 登錄 | 註冊

    本版積分規則

    Archiver|手機版|小黑屋|OK討論區

    GMT+8, 2024-4-25 01:04 PM , Processed in 0.076061 second(s), 22 queries , Gzip On.

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回復 返回頂部 返回列表