Closed byoxygen closed 2 years ago
Hi guys,
I want earn XP points predicting a match result. Can someone help me with this?
@byoxygen Here's simple XP system on the following link: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/XPSystem_v1.js
I wish it would be helpful for you.
Edit: I have found another script with betting system, on GitHub. You can also try it through the script on the following link: https://github.com/Elinous-Electra/another-haxball-bot-script/blob/master/index.js
@thenorthstar I appreciate your help so much. How to keep names and xp in local?
I also got the following errors when I try to voting.
at Array.chat_bet (<anonymous>:317:43)
at room.onPlayerChat (<anonymous>:513:48)
@thenorthstar I appreciate your help so much. How to keep names and xp in local?
I also got the following errors when I try to voting.
at Array.chat_bet (<anonymous>:317:43) at room.onPlayerChat (<anonymous>:513:48)
@byoxygen How did you get this error then? Interestingly I haven't gotten such an error even though creating this code step by step.
Edit: Code updated and a null control added, try again please?
@thenorthstar It's solved, thanks. How to we keep names and xp in local?
@thenorthstar It's solved, thanks. How to we keep names and xp in local?
@byoxygen Data transfer with the localStorage is as follows:
Set: localStorage.setItem("playerList",JSON.stringify(playerList)) Get: JSON.parse(localStorage.getItem("playerList"))
But don't worry I have done it myself for you for the last time. Further ones will be homework for you anymore. Here's the code: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/XPSystem_v2.js
@thenorthstar It's solved, thanks. How to we keep names and xp in local?
@byoxygen Data transfer with the localStorage is as follows:
Set: localStorage.setItem("playerList",JSON.stringify(playerList)) Get: JSON.parse(localStorage.getItem("playerList"))
But don't worry I have done it myself for you for the last time. Further ones will be homework for you anymore. Here's the code: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/XPSystem_v2.js Bu Hatayı alıyoruz @thenorthstar
@thenorthstar It's solved, thanks. How to we keep names and xp in local?
@byoxygen Data transfer with the localStorage is as follows: Set: localStorage.setItem("playerList",JSON.stringify(playerList)) Get: JSON.parse(localStorage.getItem("playerList")) But don't worry I have done it myself for you for the last time. Further ones will be homework for you anymore. Here's the code: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/XPSystem_v2.js Bu Hatayı alıyoruz @thenorthstar
@qoksel00 Ben öyle bir hata almıyorum?
@thenorthstar, can you add xp transfer feature between players? In addition, usage may be restrained for under 0 xp players.
@thenorthstar, can you add xp transfer feature between players? In addition, usage may be restrained for under 0 xp players.
@byoxygen It has been updated on the following code: https://github.com/thenorthstar/HaxBall-Example-Scripts/blob/main/Beginner/XPSystem_v2.js
@thenorthstar Hi,
I got the following errors when I try to send xp. Sometimes, i am getting won is not appearing on stats command.
at Array.chat_xpSending (<anonymous>:494:91)
at room.onPlayerChat (<anonymous>:638:48)
I got the following errors when I try to send xp. Sometimes, i am getting won is not appearing on stats command.
Merhaba @thenorthstar ben bu kodları rs botuna eklemeye çalısıyorum bu hatayı alıyorum
@thenorthstar Hi,
I got the following errors when I try to send xp. Sometimes, i am getting won is not appearing on stats command.
at Array.chat_xpSending (<anonymous>:494:91) at room.onPlayerChat (<anonymous>:638:48)
@byoxygen I have updated the code, it's working now.
Sending:
Getting:
I got the following errors when I try to send xp. Sometimes, i am getting won is not appearing on stats command.
Merhaba @thenorthstar ben bu kodları rs botuna eklemeye çalısıyorum bu hatayı alıyorum
@qoksel00 Bir yerleri değiştirmiş ya da bozmuş olabilirsin. Bir diğer ihtimal localStorage'ı temizlemiş olabilirsin. Bunları kontrol et, sonra konuşalım tekrar.
@thenorthstar Hi, I got the following errors when I try to send xp. Sometimes, i am getting won is not appearing on stats command.
at Array.chat_xpSending (<anonymous>:494:91) at room.onPlayerChat (<anonymous>:638:48)
@byoxygen I have updated the code, it's working now.
Sending:
Getting:
I got the following errors when I try to send xp. Sometimes, i am getting won is not appearing on stats command.
Merhaba @thenorthstar ben bu kodları rs botuna eklemeye çalısıyorum bu hatayı alıyorum
@qoksel00 Bir yerleri değiştirmiş ya da bozmuş olabilirsin. Bir diğer ihtimal localStorage'ı temizlemiş olabilirsin. Bunları kontrol et, sonra konuşalım tekrar.
merhaba en baştan ekledım sizin için biryerde hatamı yaptım diye öncelikle ilk eklediğimde aynı bu hatayı alıyorum
daha sonra specte boş duran botu yani noplayer kısmını botu specten kaldırınca hata buna dönüşüyor
@thenorthstar I am grateful for your forbearance as you've worked through the issue.
@thenorthstar Hi, I got the following errors when I try to send xp. Sometimes, i am getting won is not appearing on stats command.
at Array.chat_xpSending (<anonymous>:494:91) at room.onPlayerChat (<anonymous>:638:48)
@byoxygen I have updated the code, it's working now. Sending: Getting:
I got the following errors when I try to send xp. Sometimes, i am getting won is not appearing on stats command.
Merhaba @thenorthstar ben bu kodları rs botuna eklemeye çalısıyorum bu hatayı alıyorum
@qoksel00 Bir yerleri değiştirmiş ya da bozmuş olabilirsin. Bir diğer ihtimal localStorage'ı temizlemiş olabilirsin. Bunları kontrol et, sonra konuşalım tekrar.
merhaba en baştan ekledım sizin için biryerde hatamı yaptım diye öncelikle ilk eklediğimde aynı bu hatayı alıyorum
daha sonra specte boş duran botu yani noplayer kısmını botu specten kaldırınca hata buna dönüşüyor
@qoksel00 Resimlerden hataları nerelerde aldığını anlayabiliyorum. O konuda sorun yok da ilk attığın hatayı ben hiçbir şekilde almadım. Çok büyük ihtimalle sen noPlayer: true olayını kullanmadığın için alıyorsun o hatayı. İkinci hatayı neden aldığını ise henüz çözemedim ama ilki için iki çözüm var:
var isRoomSet = false;
room.onRoomLink = function(url){
if(isRoomSet == false){
playerList["Host"] = { name: "Host", id: 0, auth: "Auth, conn: "Conn", xp: 0, xpMultiplier: 1, bet: { red: 0, blue: 0 }, hasBet: false, canSendXP: true }; //Auth ve Conn yazılı yerlere odayı kuran kişinin bilgileri geliyor. Name yerine de oda kurulduğunda gelen botun adı gelecek.
isRoomSet = true;
}
}
@thenorthstar I am grateful for your forbearance as you've worked through the issue.
@byoxygen You're welcome. It's a pleasure for me.👍
@thenorthstar Hi again, Ive managed to put elsewhere without showing error code but xp values don't changing even using console. I always get session is unavailable message with multiple players.
@thenorthstar Hi again, Ive managed to put elsewhere without showing error code but xp values don't changing even using console. I always get session is unavailable message with multiple players.
@byoxygen Make sure if roomObject.xpSessionFeatureActive is set to true and check the player amount in both for the red and blue teams. At least one player must be in both of the red and blue teams.
Hi guys,
I want earn XP points predicting a match result. Can someone help me with this?