Welcome to Certabo forum

Both posts in italian and in english are accepted on the forum to help everybody to provide contribution irrespective to geographical location. Object of the forum is to provide technical information on various items and help developer and users to personalise software for Certabo chessboards. User explicitly accepts the conditions of use of this forum here reported.

A brief introduction of user is always appreciated in section Welcome to….

Benvenuti nel forum di Certabo

Sul forum possono essere postati articoli sia in lingua italiana che inglese per permettere a tutti di dare il proprio contributo da diversi luoghi geografici. Il forum ha come scopo fornire informazioni tecniche in generale e aiutare gli sviluppatori ed utenti a personalizzare software per le scacchiere Certabo. L’utente accetta esplicitamente le condizioni del presente forum consultabili qui.

Un breve saluto del nuovo utente è sempre gradito nella sezione Benvenuti a….

Forum breadcrumbs - You are here:ForumCERTABO FORUM: Certabo generalcertabodroid
Please or Register to create posts and topics.

certabodroid

Hi Pietro,

I spend a lot of time to test all stuff with the new board.

The lichess function in the app has one problem. You don't add the ratingrange to the api request, so I got an player > 600 rating. Normally you can use the api to detect the own rating compared to the selected timemode. Than it is really helpfull to limit the range +-150 points, so you find player at your level. Or a manual slidebar could solve this. Inside davinci this functions comes from the lichess web. Also a function to fetch a new/current game could be very helpful to play tournaments. That is also easy.. you fetch the api and start the game if you find one. So you can scan the port and step inside a game via web and than it transfers automaticly to the app. The same you did if I start a lichess game via web and I have open the davinci.

Dirk

Hi Dirk

Thank you for your suggestions will try to address them to improve that part.

All the best

Pietro

 

Hi Pietro,

here some python examples:

1st: generate ratingrange:

client = berserk.Client(session=session)

#autorating
file = str(client.account.get())

#bullet
aresult = file.find('bullet')
bresult = file.find('rating',aresult)
cresult = file.find(',',bresult)
bulletrating = file[bresult+9:cresult]
bulletlow = int(bulletrating)-150
bullethigh = bulletlow +300
bulletratingrange = str(bulletlow)+"-"+str(bullethigh)
print(bulletratingrange)

#blitz
aresult = file.find('blitz')
bresult = file.find('rating',aresult)
cresult = file.find(',',bresult)
blitzrating = file[bresult+9:cresult]
blitzlow = int(blitzrating)-150
blitzhigh = blitzlow +300
blitzratingrange = str(blitzlow)+"-"+str(blitzhigh)
print(blitzratingrange)

#longgames
aresult = file.find('correspondence')
bresult = file.find('rating',aresult)
cresult = file.find(',',bresult)
corresrating = file[bresult+9:cresult]
correslow = int(corresrating)-150
correshigh = correslow +300
corresratingrange = str(correslow)+"-"+str(correshigh)
print(corresratingrange)

#classic
aresult = file.find('classical')
bresult = file.find('rating',aresult)
cresult = file.find(',',bresult)
classicrating = file[bresult+9:cresult]
classiclow = int(classicrating)-150
classichigh = classiclow +300
classicratingrange = str(classiclow)+"-"+str(classichigh)
print(classicratingrange)

#rapid
aresult = file.find('rapid')
bresult = file.find('rating',aresult)
cresult = file.find(',',bresult)
rapidrating = file[bresult+9:cresult]
rapidlow = int(rapidrating)-150
rapidhigh = rapidlow +300
rapidratingrange = str(rapidlow)+"-"+str(rapidhigh)
print(rapidratingrange)

To check with range is th right one:

if int(gtime) < 3:
ratingrange = bulletratingrange
if int(gtime) < 10:
ratingrange = blitzratingrange
if int(gtime) < 30:
ratingrange = rapidratingrange
if int(gtime) > 120:
ratingrange = corresratingrange

 

To start a new game with a rating range:

client.board.seek(30, 20, rated=False, variant='standard', color='black', rating_range=f'{ratingrange}')

To start only a watcher and wait that a game or tournament was startet via web:

while gameid == "":
for event in client.board.stream_incoming_events():
if ('type' in event.keys()):
if (event.get('type') == "gameStart"):

#print("is gameStart")
if ('game' in event.keys()):
#print(event)
gameid = event.get('game').get('id')
break