CCBlueX Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    下面这个脚本哪里出错了?

    Chinese
    1
    1
    35
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      SCPLOVER last edited by

      我想写一个脚本可以定时随机更换标题,但只是更换标题的部分都有问题,我应该怎么改?我第一次编写脚本。

      var scriptName = "BetterTitle";
      var scriptVersion = 1.1;//JS版本
      var scriptAuthor = "SCPLOVER";//JS作者
      
      var Random = Java.type('java.util.Random');
      var Display = Java.type('org.lwjgl.opengl.Display')
      
      var Debug = new Debug();
      var client;
      
      function Debug() {
      	var HM,H,M,S;//新建变量
      	var random = new Random();
          var a = random.nextInt(13); //随机数
      	//var a = Random //新建变量
          this.getName = function() {
              return "BetterTitle";
          };//功能名字
      
          this.getDescription = function() {
              return "GoodTitle By SCPLOVER";
          };//热点注释
      
          this.getCategory = function() {
              return "Render";
          };//功能位置
          this.onEnable = function() {
      		HM = 0;//tick
      		H = 0;//小时
      		M = 0;//分钟
      		S = 0;//秒
          }//打开事件
          this.onUpdate = function() {
      		HM += 1;//tick+1
              if (HM == 20){//如果等于20tick则+1 20tick=1秒
      			S = S + 1;
      			HM = 0;
      		}
              if (S == 60){
      		    M = M + 1;
      			S = 0;
      		}
              if (M == 60){
                  H = H + 1;
      			M = 0;
      		}
      		switch (a){
      			case 1:
                      Display.setTitle("[SCP Foundation]	清风不识字,何故乱翻书?	|"+ ' 你已经游玩了: '+ H  +'时'  +M +'分'+S+'秒');
                      break;
                  case 2:
                      Display.setTitle("[SCP Foundation]	游荡的孤高灵魂不需要羁绊之地。 _春物	|"+ ' 你已经游玩了: '+ H  +'时'  +M +'分'+S+'秒');
                      break;
                  case 3:
                      Display.setTitle("[SCP Foundation]	吾于冥河沉浮,受尽命运捉弄,纵然汝将忘吾,吾亦伴汝身旁。 _Re:0	|"+ ' 你已经游玩了: '+ H  +'时'  +M +'分'+S+'秒');
                      break;
                  case 4:
                      Display.setTitle("[SCP Foundation]	爆裂吧,现实!粉碎吧,精神!Banishiment This World!   _中二病也要谈恋爱		|"+ ' 你已经游玩了: '+ H  +'时'  +M +'分'+S+'秒');
                      break;
                  case 5:
                      Display.setTitle("[SCP Foundation]	我自横刀向天笑,去留肝胆两昆仑!	|"+ ' 你已经游玩了: '+ H  +'时'  +M +'分'+S+'秒');
                      break;
                  case 6:
                      Display.setTitle("[SCP Foundation]	人生自古谁无死,留取丹心照汗青。	|"+ ' 你已经游玩了: '+ H  +'时'  +M +'分'+S+'秒');
                      break;
                  case 7:
                      Display.setTitle("[SCP Foundation]	你相信时间会抚平一切,可时过境迁,你已不复醒。   _缘之空	|"+ ' 你已经游玩了: '+ H  +'时'  +M +'分'+S+'秒');
                      break;
                  case 8:
                      Display.setTitle("[SCP Foundation]	因为喜欢,所以会误会。因为喜欢,所以会错过。  _缘之空	|"+ ' 你已经游玩了: '+ H  +'时'  +M +'分'+S+'秒');
                      break;
                  case 9:
                      Display.setTitle("[SCP Foundation]	无命而去,无命而赴——然必有命而逝——以上。 _游戏人生	|"+ ' 你已经游玩了: '+ H  +'时'  +M +'分'+S+'秒');
                      break;
                  case 10:
                      Display.setTitle("[SCP Foundation]	羌笛何须怨杨柳,春风不度玉门关。	|"+ ' 你已经游玩了: '+ H  +'时'  +M +'分'+S+'秒');
                      break;
                  case 11:
                      Display.setTitle("[SCP Foundation]	当黑白之剑交叉时,那一刻就许下要永远保护你,彼此守护着对方。_刀剑神域		|"+ ' 你已经游玩了: '+ H  +'时'  +M +'分'+S+'秒');
                      break;
                  case 12:
                      Display.setTitle("[SCP Foundation]	我们终会相知,在那悠远的苍穹。 _缘之空		|"+ ' 你已经游玩了: '+ H  +'时'  +M +'分'+S+'秒');
                      break;
                  default:
                      
              }
      	}//打开中事件
          this.onDisable = function () {	
      	}//关闭事件
      }
      while (a=a) {
      	var random = new Random();
          var a = random.nextInt(13)
      }
      function onLoad() {}
      
      function onEnable() {
          client = moduleManager.registerModule(Debug);
      }
      
      function onDisable() {
          moduleManager.unregisterModule(client);
      }
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      About
      • Terms of Service
      • Privacy Policy
      • Status
      • Contact Us
      Downloads
      • Releases
      • Source code
      • License
      Docs
      • Tutorials
      • CustomHUD
      • AutoSettings
      • ScriptAPI
      Community
      • Forum
      • Guilded
      • YouTube
      • Twitter
      • D.Tube