Discuss Scratch

god286
Scratcher
1000+ posts

scratchclient - A scratch API wrapper for python

PizzasAreGreat wrote:

Don't forget to put your password in a .env file, especially if you are using an online IDE.
if you use replit, do not put things in the env file. instead use the lock button on the sidebar to get access into env.

Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
MyMessage
Scratcher
100+ posts

scratchclient - A scratch API wrapper for python

PizzasAreGreat wrote:

MyMessage wrote:

How do I read a variable value in a certain project?

I tried using the connection.get_cloud_variable(“VARIABLENAMEHERE”) in different ways, but I'm having trouble with it.

This should work:
 
import os
from scratchclient import ScratchSession
session = ScratchSession("MyMessage", os.getenv("password"))
project_id = xxxxxxxxxx
connection = session.create_cloud_connection(project_id)
print(connection.get_cloud_variable("cloud_1"))
Don't forget to put your password in a .env file, especially if you are using an online IDE.
Thanks it works, also yes I was going to use .env

MSG CLAN
MyMessage
kccuber
Scratcher
1000+ posts

scratchclient - A scratch API wrapper for python

MyMessage wrote:

PizzasAreGreat wrote:

MyMessage wrote:

How do I read a variable value in a certain project?

I tried using the connection.get_cloud_variable(“VARIABLENAMEHERE”) in different ways, but I'm having trouble with it.

This should work:
 
import os
from scratchclient import ScratchSession
session = ScratchSession("MyMessage", os.getenv("password"))
project_id = xxxxxxxxxx
connection = session.create_cloud_connection(project_id)
print(connection.get_cloud_variable("cloud_1"))
Don't forget to put your password in a .env file, especially if you are using an online IDE.
Thanks it works, also yes I was going to use .env
NO. If you use Replit click the Lock Icon to make envs. I think .env files may not be actually hidden, so redact your password from there (IF YOU USED REPLIT) and change your password


Made using Nord Theme & Inkscape
MyMessage
Scratcher
100+ posts

scratchclient - A scratch API wrapper for python

kccuber wrote:

MyMessage wrote:

PizzasAreGreat wrote:

MyMessage wrote:

How do I read a variable value in a certain project?

I tried using the connection.get_cloud_variable(“VARIABLENAMEHERE”) in different ways, but I'm having trouble with it.

This should work:
 
import os
from scratchclient import ScratchSession
session = ScratchSession("MyMessage", os.getenv("password"))
project_id = xxxxxxxxxx
connection = session.create_cloud_connection(project_id)
print(connection.get_cloud_variable("cloud_1"))
Don't forget to put your password in a .env file, especially if you are using an online IDE.
Thanks it works, also yes I was going to use .env
NO. If you use Replit click the Lock Icon to make envs. I think .env files may not be actually hidden, so redact your password from there (IF YOU USED REPLIT) and change your password
Yes, I saw that part of the discussion too, apologies for not referencing it.

MSG CLAN
MyMessage
BoopBoop92
Scratcher
4 posts

scratchclient - A scratch API wrapper for python

slight issue: i've been trying to get my code to work since this morning (woke up at like 6:30) since it worked the day earlier. now it keeps coming back with errors about trying to log in, help?

from keep_alive import keep_alive
keep_alive()
import os
scratch_username = “BoopBoop92”
my_secret = os.environ'login' (also this isnt a part of the code but i believe brackets messes it up so there are none on here)
from scratchclient import ScratchSession
session = ScratchSession(scratch_username, my_secret)
connection = session.create_cloud_connection(627859798)
connection.set_cloud_variable(“annoyance”, 50000)

(side note: the keep_alive() function is for what it says, it shouldn't effect anything)
(also error keeps coming back as the incorrect username or password thing)

Last edited by BoopBoop92 (Jan. 13, 2022 21:39:22)

mrcoat
Scratcher
100+ posts

scratchclient - A scratch API wrapper for python

BoopBoop92 wrote:

slight issue: i've been trying to get my code to work since this morning (woke up at like 6:30) since it worked the day earlier. now it keeps coming back with errors about trying to log in, help?

from keep_alive import keep_alive
keep_alive()
import os
scratch_username = “BoopBoop92”
my_secret = os.environ
from scratchclient import ScratchSession
session = ScratchSession(scratch_username, my_secret)
connection = session.create_cloud_connection(627859798)
connection.set_cloud_variable(“annoyance”, 50000)

(side note: the keep_alive() function is for what it says, it shouldn't effect anything)
(also error keeps coming back as the incorrect username or password thing)
Whenever I got an error with logging in, the scratch website is either down, or the login service is.

My cartoon
Watch My Show!
I was gonna put an image of the studio but it didn't work.

Cool thing I made
when [Awesomeness v] > (100)
forever
play sound [Victory v] until done
set rotation style [The best style v]
go to [The party v]
end
BoopBoop92
Scratcher
4 posts

scratchclient - A scratch API wrapper for python

mrcoat wrote:

BoopBoop92 wrote:

slight issue: i've been trying to get my code to work since this morning (woke up at like 6:30) since it worked the day earlier. now it keeps coming back with errors about trying to log in, help?

from keep_alive import keep_alive
keep_alive()
import os
scratch_username = “BoopBoop92”
my_secret = os.environ
from scratchclient import ScratchSession
session = ScratchSession(scratch_username, my_secret)
connection = session.create_cloud_connection(627859798)
connection.set_cloud_variable(“annoyance”, 50000)

(side note: the keep_alive() function is for what it says, it shouldn't effect anything)
(also error keeps coming back as the incorrect username or password thing)
Whenever I got an error with logging in, the scratch website is either down, or the login service is.
i even tried logging in myself, it worked perfectly fine
BoopBoop92
Scratcher
4 posts

scratchclient - A scratch API wrapper for python

ok i think this is an issue with scratchclient since i have double checked almost everything and tried different methods but nothing works.
god286
Scratcher
1000+ posts

scratchclient - A scratch API wrapper for python

BoopBoop92 wrote:

scratch_username = “BoopBoop92”
my_secret = os.environ
from scratchclient import ScratchSession
Where you define my_secret did you mean to put this?
my_secret = os.environ['PASSWORD']

Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
BoopBoop92
Scratcher
4 posts

scratchclient - A scratch API wrapper for python

god286 wrote:

BoopBoop92 wrote:

scratch_username = “BoopBoop92”
my_secret = os.environ
from scratchclient import ScratchSession
Where you define my_secret did you mean to put this?
my_secret = os.environ['PASSWORD']
i put ‘login’ with brackets on the sides after os.environ idk why it doesnt show though i think brackets messes it up

Last edited by BoopBoop92 (Jan. 13, 2022 21:36:48)

ToastersUnited
Scratcher
1000+ posts

scratchclient - A scratch API wrapper for python

BoopBoop92 wrote:

god286 wrote:

BoopBoop92 wrote:

scratch_username = “BoopBoop92”
my_secret = os.environ
from scratchclient import ScratchSession
Where you define my_secret did you mean to put this?
my_secret = os.environ['PASSWORD']
i put ‘login’ with brackets on the sides after os.environ idk why it doesnt show though i think brackets messes it up
I think it should be normal brackets
os.environ('PASSWORD')


Sign on the M18 Motorway warning that horses, horse-drawn vehicles, pedestrians and bicycles are forbidden.

Road signs in the Republic of Ireland do not differ greatly from those used elsewhere in Europe – with the notable exception that hazard or warning signs follow the “New World” style of a yellow diamond. The symbols used on these warning signs do, nevertheless, resemble much more closely those used (on red-bordered white or yellow triangles) in the rest of Europe than many of those seen in the United States.


Typical road signs in rural areas of the Republic of Ireland. Here, a fingerpost with old road number and Bord Fáilte logo. Signpost located in Rathangan, Co. Kildare.

Regulatory signs (relating to limits and prohibitions) differ very little from those used in the rest of Europe.

The system of directional signs is based upon, and is very similar to, that employed in the United Kingdom, but is bilingual everywhere except in the Gaeltacht, where only the Irish language is used on signs.

In Ireland, the highest category of road is a motorway (mótarbhealach, plural: mótarbhealaí), indicated by the prefix M followed by a one- or two-digit number (the number of the national route of which each motorway forms a part). The motorway network consists entirely of motorway-grade dual carriageways and is largely focused upon Dublin. There are also several three-lane motorways, while Ireland's busiest road, the M50, incorporates four-lane, five-lane, and six-lane stretches.
robotkid828
Scratcher
100+ posts

scratchclient - A scratch API wrapper for python

ToastersUnited wrote:

BoopBoop92 wrote:

god286 wrote:

BoopBoop92 wrote:

scratch_username = “BoopBoop92”
my_secret = os.environ
from scratchclient import ScratchSession
Where you define my_secret did you mean to put this?
my_secret = os.environ['PASSWORD']
i put ‘login’ with brackets on the sides after os.environ idk why it doesnt show though i think brackets messes it up
I think it should be normal brackets
os.environ('PASSWORD')
looks like its like a random issue, should go away soon

Last edited by robotkid828 (Jan. 14, 2022 02:18:41)


the robotkid828 suddenly appears!

random programmer/game developer here, probably wont be on scratch much other than the forums.
Chiroyce
Scratcher
1000+ posts

scratchclient - A scratch API wrapper for python

BoopBoop92 wrote:

i put ‘login’ with brackets on the sides after os.environ idk why it doesnt show though i think brackets messes it up
you sure you used square brackets and not ( ?

my_secret = os.environ['login']







April Fools' topics:
New Buildings in Scratch's headquarters
Give every Scratcher an M1 MacBook Air
Scratch should let users edit other Scratchers' projects
Make a statue for Jeffalo
Scratch Tech Tips™
Make a Chiroyce statue emoji


<img src=“x” onerror=“alert('XSS vulnerability discovered')”>

this is a test sentence
9pfs
Scratcher
100+ posts

scratchclient - A scratch API wrapper for python

Chiroyce wrote:

BoopBoop92 wrote:

i put ‘login’ with brackets on the sides after os.environ idk why it doesnt show though i think brackets messes it up
you sure you used square brackets and not ( ?

my_secret = os.environ['login']
WHY DID PEOPLE HELP THEM??? NOW THEY'RE DDOSING GRIFFPATCH'S PROJECTS!!! THE FACT THAT THEY HAD A KEEP-ALIVE SCRIPT SHOULD'VE BEEN A RED FLAG!!! WHY????????

Update to Chrome 98 immediately More info
Share


topic/571765 MUST be apologized for.
Turns out, it was!!!

ajsya
Scratcher
1000+ posts

scratchclient - A scratch API wrapper for python

9pfs wrote:

Chiroyce wrote:

BoopBoop92 wrote:

i put ‘login’ with brackets on the sides after os.environ idk why it doesnt show though i think brackets messes it up
you sure you used square brackets and not ( ?

my_secret = os.environ['login']
WHY DID PEOPLE HELP THEM??? NOW THEY'RE DDOSING GRIFFPATCH'S PROJECTS!!! THE FACT THAT THEY HAD A KEEP-ALIVE SCRIPT SHOULD'VE BEEN A RED FLAG!!! WHY????????
?

That's just so their replit doesn't die…

Feel free to message me on my profile if you need to tell me something/want someone to talk to.

Hi, I'm ajsya!

| GitHub | Wiki | My Posts |

Before creating a new topic on the forums search Ocular to see if one already exists!ˇ
dhuls
Scratcher
1000+ posts

scratchclient - A scratch API wrapper for python

ajsya wrote:

(#476)

9pfs wrote:

Chiroyce wrote:

BoopBoop92 wrote:

i put ‘login’ with brackets on the sides after os.environ idk why it doesnt show though i think brackets messes it up
you sure you used square brackets and not ( ?

my_secret = os.environ['login']
WHY DID PEOPLE HELP THEM??? NOW THEY'RE DDOSING GRIFFPATCH'S PROJECTS!!! THE FACT THAT THEY HAD A KEEP-ALIVE SCRIPT SHOULD'VE BEEN A RED FLAG!!! WHY????????
?

That's just so their replit doesn't die…
This user ended up ddosing Griffpatch's cloud projects
Or so I heard.
god286
Scratcher
1000+ posts

scratchclient - A scratch API wrapper for python

dhuls wrote:

This user ended up ddosing Griffpatch's cloud projects
Or so I heard.
yeah it did happen.
but lets not get offtopic

Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
JackK211424
Scratcher
500+ posts

scratchclient - A scratch API wrapper for python

9pfs wrote:

Chiroyce wrote:

BoopBoop92 wrote:

i put ‘login’ with brackets on the sides after os.environ idk why it doesnt show though i think brackets messes it up
you sure you used square brackets and not ( ?

my_secret = os.environ['login']
WHY DID PEOPLE HELP THEM??? NOW THEY'RE DDOSING GRIFFPATCH'S PROJECTS!!! THE FACT THAT THEY HAD A KEEP-ALIVE SCRIPT SHOULD'VE BEEN A RED FLAG!!! WHY????????
Not like they could have known, after all, they probably arent fortune tellers.

Also what is a keep alive script?

Last edited by JackK211424 (Jan. 15, 2022 23:15:33)


hiPeeps124816
Scratcher
500+ posts

scratchclient - A scratch API wrapper for python

JackK211424 wrote:

9pfs wrote:

Chiroyce wrote:

BoopBoop92 wrote:

i put ‘login’ with brackets on the sides after os.environ idk why it doesnt show though i think brackets messes it up
you sure you used square brackets and not ( ?

my_secret = os.environ['login']
WHY DID PEOPLE HELP THEM??? NOW THEY'RE DDOSING GRIFFPATCH'S PROJECTS!!! THE FACT THAT THEY HAD A KEEP-ALIVE SCRIPT SHOULD'VE BEEN A RED FLAG!!! WHY????????
Not like they could have known, after all, they probably arent fortune tellers.

Also what is a keep alive script?
a script that keeps your project alive until you stop it

Generation 7: First time you see this? Copy and paste it on top of your signature in the forums and increase generation by 1.

thethethethethethethethethethethethethethethethethethethethethethethethethethethethethethethethethethethethethethethethethethethethethethethe
Specs -
OS: macOS 11.6.4
Browser: Varies, usually Safari 15.3 or Opera GX 83 or Firefox 96
Computer: Late 2013 MacBook Pro 2.4GHz Dual Core Intel Core i5
highlight and shift down arrow




;
Chiroyce
Scratcher
1000+ posts

scratchclient - A scratch API wrapper for python

9pfs wrote:

WHY DID PEOPLE HELP THEM??? NOW THEY'RE DDOSING GRIFFPATCH'S PROJECTS!!! THE FACT THAT THEY HAD A KEEP-ALIVE SCRIPT SHOULD'VE BEEN A RED FLAG!!! WHY????????
I thought this was a topic where you're meant to help…







April Fools' topics:
New Buildings in Scratch's headquarters
Give every Scratcher an M1 MacBook Air
Scratch should let users edit other Scratchers' projects
Make a statue for Jeffalo
Scratch Tech Tips™
Make a Chiroyce statue emoji


<img src=“x” onerror=“alert('XSS vulnerability discovered')”>

this is a test sentence

Powered by DjangoBB