- UID
- 1723921
- 主题
- 0
- 阅读权限
- 20
- 帖子
- 91
- 精华
- 0
- 积分
- 46
- 金钱
- 534
- 荣誉
- 0
- 人气
- 0
- 在线时间
- 63 小时
- 评议
- 0
- 帖子
- 91
- 精华
- 0
- 积分
- 46
- 金钱
- 534
- 荣誉
- 0
- 人气
- 0
- 评议
- 0
|
在国外的网站看到个“MOD”但是他说是要自己加代码。。。无奈本人是“小白”实在不明白他的意思,特来求助~!
这是原贴的描述。。不知道是说MOD还是说效果...
It's good that you're not afraid to use gosubs, but I think maybe you're not sure how they are used. Your first one (SubPlayerControl) is only called upon once. Worse, it loops with a wait even when there's a wait just before the subroutine. ANY time code is called upon only once, there's no gain in making it a subroutine. The other thing I noticed is that both of these commands
...weigh seven bytes. Substituting one for the other gains nothing. In fact, using a subroutine JUST for that command is not only two bytes heavier because of the return command, but the computer needs to set the gosub variable, jump to that address, run the command, and return. Instead of JUST running the command. Since all of your subroutines are either only used once or weigh the same as the code they replace but with more overhead, there's no benefit to having subroutines in this thread. In fact, cutting them out would not only save you the overhead and the two bytes for the one return command, but you could also save the seven bytes of setting $key to equal 17. Which should be a local var anyways.
Other than that, this is a really cool idea. And your code is well commented I would've made the trigger different. Only other tip I have is that you should be checking if player defined before addressing the player at all. In fact, doing this replaces the need for checking if wasted and if busted. Incorporate all of these ideas and here's what the code would look like
Insert this in your script |
|