键值输出的值不是数字的和 而是数字组成的数列

dalao们 我现在已经把不同用户的好感度区分开了 但是我发现每次输出的值 不是好感度 而是历史好感度的数列 像这样 请问该如何把好感度以和的形式呈现?我想过把数列的数字加起来的和 但是貌似只适用于一位数(


下面是我的代码

这是我的配置

这是我的日志(因为太长了 所以我是reload之后一直到目前为止的所有代码)

0000|1|2023-10-25 20:22:27 [E] launcher 2023-10-25 20:22:27.952 koishell[745:7278] _TIPropertyValueIsValid called with 4 on nil context!
0000|1|2023-10-25 20:22:27 [E] launcher 2023-10-25 20:22:27.952 koishell[745:7278] imkxpc_getApplicationProperty:reply: called with incorrect property value 4, bailing.
0000|1|2023-10-25 20:22:27 [E] launcher 2023-10-25 20:22:27.952 koishell[745:7278] Text input context does not respond to _valueForTIProperty:
0000|1|2023-10-25 20:22:27 [E] launcher 2023-10-25 20:22:27.952 koishell[745:7278] _TIPropertyValueIsValid called with 4 on nil context!
0000|1|2023-10-25 20:22:27 [E] launcher 2023-10-25 20:22:27.952 koishell[745:7278] imkxpc_getApplicationProperty:reply: called with incorrect property value 4, bailing.
0000|1|2023-10-25 20:22:27 [E] launcher 2023-10-25 20:22:27.952 koishell[745:7278] Text input context does not respond to _valueForTIProperty:
0000|1|2023-10-25 20:22:29 [E] launcher 2023-10-25 20:22:29.554 koishell[745:7278] _TIPropertyValueIsValid called with 4 on nil context!
0000|1|2023-10-25 20:22:29 [E] launcher 2023-10-25 20:22:29.554 koishell[745:7278] imkxpc_getApplicationProperty:reply: called with incorrect property value 4, bailing.
0000|1|2023-10-25 20:22:29 [E] launcher 2023-10-25 20:22:29.554 koishell[745:7278] Text input context does not respond to _valueForTIProperty:
0000|1|2023-10-25 20:22:29 [E] launcher 2023-10-25 20:22:29.554 koishell[745:7278] _TIPropertyValueIsValid called with 4 on nil context!
0000|1|2023-10-25 20:22:29 [E] launcher 2023-10-25 20:22:29.554 koishell[745:7278] imkxpc_getApplicationProperty:reply: called with incorrect property value 4, bailing.
0000|1|2023-10-25 20:22:29 [E] launcher 2023-10-25 20:22:29.555 koishell[745:7278] Text input context does not respond to _valueForTIProperty:
0000|1|2023-10-25 20:22: [E] launcher 2023-10-25 20:22:.466 koishell[745:7278] _TIPropertyValueIsValid called with 4 on nil context!
0000|1|2023-10-25 20:22: [E] launcher 2023-10-25 20:22:.466 koishell[745:7278] imkxpc_getApplicationProperty:reply: called with incorrect property value 4, bailing.
0000|1|2023-10-25 20:22: [E] launcher 2023-10-25 20:22:.466 koishell[745:7278] Text input context does not respond to _valueForTIProperty:
0000|1|2023-10-25 20:22: [E] launcher 2023-10-25 20:22:.467 koishell[745:7278] imkxpc_getApplicationProperty:reply: called with incorrect property value 4, bailing.
0000|1|2023-10-25 20:22: [E] launcher 2023-10-25 20:22:.467 koishell[745:7278] Text input context does not respond to _valueForTIProperty:
0000|1|2023-10-25 20:22: [E] launcher 2023-10-25 20:22:.467 koishell[745:7278] _TIPropertyValueIsValid called with 4 on nil context!
1000|2|2023-10-25 20:22: [I] blockly Loading 1 plugin(s)
1000|2|2023-10-25 20:22: [I] blockly Loaded 1 plugin(s)
1000|2|2023-10-25 20:22:40 [I] blockly Loading 1 plugin(s)
1000|2|2023-10-25 20:22:40 [I] blockly Loaded 1 plugin(s)

2 个赞

因为blockly里的键值对的值都是转为字符串的类型存储的,你在存进去之后,数字类型就转成了字符串,你再后面再做加法就是字符串+数字,结果就是字符串拼接(

1 个赞

你可以再取出来后加一个转为数字的块,全部都送数字以后在做加减法

1 个赞

刚才我自己研究了一会 先把键值转换成变量 然后两个变量加成一个新的变量 输出完文字再把变量转换成键值 总之还是谢谢你

1 个赞